From fa89891f2f9e56c847826975018d006f2ad1e338 Mon Sep 17 00:00:00 2001 From: jiahuiwen Date: Wed, 22 Sep 2021 10:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=88=98=E6=96=97=E5=8A=9B=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/logic/hero/HeroLogic.java | 115 +++++++++--------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index c04277657..cfd3bc92f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -2748,65 +2748,64 @@ public class HeroLogic{ public int calForce( Map heroAllAttribute ){ double result = 0; // 旧战力计算 - for(Map.Entry 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(); +// for(Map.Entry 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(); // -// // 新战力计算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); +// result += propertyValue*score; +// } + + // 新战力计算2021 9 17 + // 面板最大生命值 + 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(); + + 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; }