战斗力公式修改

back_recharge
jiahuiwen 2021-09-17 11:39:48 +08:00
parent 9e964a10f1
commit e125b19b99
2 changed files with 64 additions and 16 deletions

View File

@ -17,6 +17,10 @@ public enum HeroAttributeEnum {
TreatFacter(58),
DifferDemonsReduceFactor(59),
AntiCritDamageFactor(60),
HP_ADD_PERCENT(61), // 血量 加成百分比
ATTACK_ADD_PERCENT(62), // 攻击 加成百分比
PHYSICAL_DEFENCE_ADD_PERCENT(63), // 护甲 加成百分比
MAGIC_DEFENCE_ADD_PERCENT(64), // 魔抗 加成百分比
DifferDemonsBocusFactor(66),
CurHpExtra(67),
CurHpSpecialExtra(68),
@ -34,6 +38,7 @@ public enum HeroAttributeEnum {
LandDamageReduceFactor(110),
LightDamageReduceFactor(111),
DarkDamageReduceFactor(112),
CritDamageReduceFactor(113), // 暴伤减免
EquipForce(9999),
;

View File

@ -2747,23 +2747,66 @@ 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()){
// LOGGER.info("the equipScore={}",propertyValue);
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;
// }
result += propertyValue*score;
// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={}result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
}
// System.out.println(result);
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);
return (int)result;
}