还原战力计算公式

back_recharge
jiahuiwen 2021-09-17 16:20:13 +08:00
parent 01457210b5
commit 8427f08a4a
1 changed files with 58 additions and 58 deletions

View File

@ -2748,65 +2748,65 @@ public class HeroLogic{
public int calForce( Map<Integer, Long> heroAllAttribute ){
double result = 0;
// 旧战力计算
// for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
// Integer propertyId = item.getKey();
// float propertyValue = item.getValue();
// if(propertyId == HeroAttributeEnum.EquipForce.getPropertyId()){
// continue;
// }
// SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(propertyId);
// if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
// propertyValue = propertyValue / 100F;
// }
// float score = sPropertyConfig.getScore();
for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
Integer propertyId = item.getKey();
float propertyValue = item.getValue();
if(propertyId == HeroAttributeEnum.EquipForce.getPropertyId()){
continue;
}
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(propertyId);
if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
propertyValue = propertyValue / 100F;
}
float score = sPropertyConfig.getScore();
result += propertyValue*score;
}
// SPropertyConfig sPropertyConfigHP = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Hp.getPropertyId());
// float hpScore = sPropertyConfigHP.getScore();
// SPropertyConfig sPropertyConfigAttack = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Attack.getPropertyId());
// float attackScore = sPropertyConfigAttack.getScore();
// SPropertyConfig sPropertyConfigPhysicalDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.PhysicalDefence.getPropertyId());
// float pdScore = sPropertyConfigPhysicalDefence.getScore();
// SPropertyConfig sPropertyConfigMagicDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.MagicDefence.getPropertyId());
// float mdScore = sPropertyConfigMagicDefence.getScore();
//
// result += propertyValue*score;
// }
SPropertyConfig sPropertyConfigHP = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Hp.getPropertyId());
float hpScore = sPropertyConfigHP.getScore();
SPropertyConfig sPropertyConfigAttack = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Attack.getPropertyId());
float attackScore = sPropertyConfigAttack.getScore();
SPropertyConfig sPropertyConfigPhysicalDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.PhysicalDefence.getPropertyId());
float pdScore = sPropertyConfigPhysicalDefence.getScore();
SPropertyConfig sPropertyConfigMagicDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.MagicDefence.getPropertyId());
float mdScore = sPropertyConfigMagicDefence.getScore();
// 新战力计算2021 9 17
// 面板最大生命值
float xishu = 10000;
float finalHp = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hp.getPropertyId(), 0L).floatValue();
// 面板攻击
float finalAttack = heroAllAttribute.getOrDefault(HeroAttributeEnum.Attack.getPropertyId(), 0L).floatValue();
// 面板护甲
float finalPhysicalDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.PhysicalDefence.getPropertyId(), 0L).floatValue();
// 面板魔抗
float magicDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.MagicDefence.getPropertyId(), 0L).floatValue();
// 伤害加成
float damageBocusFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageBocusFactor.getPropertyId(), 0L).floatValue();
// 伤害减免
float damageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageReduceFactor.getPropertyId(), 0L).floatValue();
// 命中几率
float hit = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hit.getPropertyId(), 0L).floatValue();
// 闪避几率
float dodge = heroAllAttribute.getOrDefault(HeroAttributeEnum.Dodge.getPropertyId(), 0L).floatValue();
// 暴击几率
float critFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritFactor.getPropertyId(), 0L).floatValue();
// 抗暴几率
float antiCritDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.AntiCritDamageFactor.getPropertyId(), 0L).floatValue();
// 暴伤加成
float critDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageFactor.getPropertyId(), 0L).floatValue();
// 暴伤减免
float critDamageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageReduceFactor.getPropertyId(), 0L).floatValue();
// 受疗加成
float cureFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.CureFacter.getPropertyId(), 0L).floatValue();
// 治疗加成
float treatFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.TreatFacter.getPropertyId(), 0L).floatValue();
result = (finalHp * hpScore + finalAttack * attackScore + finalPhysicalDefence * pdScore + magicDefence * mdScore)
* (1 + (damageBocusFactor + damageReduceFactor + hit + dodge + critFactor +
antiCritDamageFactor + critDamageFactor + critDamageReduceFactor + cureFacter + treatFacter) / 2 / xishu);
// // 新战力计算2021 9 17
// // 面板最大生命值
// float xishu = 10000;
// float finalHp = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hp.getPropertyId(), 0L).floatValue();
// // 面板攻击
// float finalAttack = heroAllAttribute.getOrDefault(HeroAttributeEnum.Attack.getPropertyId(), 0L).floatValue();
// // 面板护甲
// float finalPhysicalDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.PhysicalDefence.getPropertyId(), 0L).floatValue();
// // 面板魔抗
// float magicDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.MagicDefence.getPropertyId(), 0L).floatValue();
// // 伤害加成
// float damageBocusFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageBocusFactor.getPropertyId(), 0L).floatValue();
// // 伤害减免
// float damageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageReduceFactor.getPropertyId(), 0L).floatValue();
// // 命中几率
// float hit = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hit.getPropertyId(), 0L).floatValue();
// // 闪避几率
// float dodge = heroAllAttribute.getOrDefault(HeroAttributeEnum.Dodge.getPropertyId(), 0L).floatValue();
// // 暴击几率
// float critFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritFactor.getPropertyId(), 0L).floatValue();
// // 抗暴几率
// float antiCritDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.AntiCritDamageFactor.getPropertyId(), 0L).floatValue();
// // 暴伤加成
// float critDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageFactor.getPropertyId(), 0L).floatValue();
// // 暴伤减免
// float critDamageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageReduceFactor.getPropertyId(), 0L).floatValue();
// // 受疗加成
// float cureFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.CureFacter.getPropertyId(), 0L).floatValue();
// // 治疗加成
// float treatFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.TreatFacter.getPropertyId(), 0L).floatValue();
//
// result = (finalHp * hpScore + finalAttack * attackScore + finalPhysicalDefence * pdScore + magicDefence * mdScore)
// * (1 + (damageBocusFactor + damageReduceFactor + hit + dodge + critFactor +
// antiCritDamageFactor + critDamageFactor + critDamageReduceFactor + cureFacter + treatFacter) / 2 / xishu);
return (int)result;
}