添加战中属性
parent
782d39ab2d
commit
dfa218d8ba
|
@ -24,18 +24,18 @@ public enum HeroAttributeEnum {
|
|||
DifferDemonsBocusFactor(66),
|
||||
CurHpExtra(67),
|
||||
CurHpSpecialExtra(68),
|
||||
PVPDamageBocusFactor(69),
|
||||
PVPDamageReduceFactor(70),
|
||||
FireDamageBonusFactor(101),
|
||||
WindDamageBonusFactor(102),
|
||||
WaterDamageBonusFactor(103),
|
||||
LandDamageBonusFactor(104),
|
||||
PVPDamageBocusFactor(69),//PVP增伤
|
||||
PVPDamageReduceFactor(70),//PVP减伤
|
||||
RenBonus(101),//灭人
|
||||
FoBonus(102),//灭佛
|
||||
YaoBonus(103),//灭妖
|
||||
DaoBonus(104),//灭道
|
||||
LightDamageBonusFactor(105),
|
||||
DarkDamageBonusFactor(106),
|
||||
FireDamageReduceFactor(107),
|
||||
WindDamageReduceFactor(108),
|
||||
WaterDamageReduceFactor(109),
|
||||
LandDamageReduceFactor(110),
|
||||
RenReduce(107),//抗人
|
||||
FoReduce(108),//抗佛
|
||||
YaoReduce(109),//抗妖
|
||||
DaoReduce(110),//抗道
|
||||
LightDamageReduceFactor(111),
|
||||
DarkDamageReduceFactor(112),
|
||||
CritDamageReduceFactor(113), // 暴伤减免
|
||||
|
|
|
@ -95,22 +95,18 @@ public class HeroLogic {
|
|||
transTemplate.add(HeroAttributeEnum.AntiCritDamageFactor.getPropertyId()); // 抗暴率
|
||||
transTemplate.add(HeroAttributeEnum.TreatFacter.getPropertyId()); // 治疗加成系数
|
||||
transTemplate.add(HeroAttributeEnum.CureFacter.getPropertyId()); // 受治疗
|
||||
// transTemplate.add(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId()); // pvp 增伤
|
||||
// transTemplate.add(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId()); // pvp 减伤
|
||||
transTemplate.add(HeroAttributeEnum.DifferDemonsBocusFactor.getPropertyId()); // 增加受到的异妖伤害
|
||||
transTemplate.add(HeroAttributeEnum.DifferDemonsReduceFactor.getPropertyId()); // 异妖减伤率
|
||||
// transTemplate.add(HeroAttributeEnum.FireDamageBonusFactor.getPropertyId()); // 火系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.FireDamageReduceFactor.getPropertyId()); // 火系伤害减免系数
|
||||
// transTemplate.add(HeroAttributeEnum.WindDamageBonusFactor.getPropertyId()); // 风系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.WindDamageReduceFactor.getPropertyId()); // 风系伤害减免系数
|
||||
// transTemplate.add(HeroAttributeEnum.WaterDamageBonusFactor.getPropertyId()); // 冰系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.WaterDamageReduceFactor.getPropertyId());// 冰系伤害减免系数
|
||||
// transTemplate.add(HeroAttributeEnum.LandDamageBonusFactor.getPropertyId()); // 地系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.LandDamageReduceFactor.getPropertyId()); // 地系伤害减免系数
|
||||
// transTemplate.add(HeroAttributeEnum.LightDamageBonusFactor.getPropertyId()); // 雷系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.LightDamageReduceFactor.getPropertyId());// 雷系伤害减免系数
|
||||
// transTemplate.add(HeroAttributeEnum.DarkDamageBonusFactor.getPropertyId()); // 暗系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.DarkDamageReduceFactor.getPropertyId()); // 暗系伤害减免系数
|
||||
|
||||
transTemplate.add(HeroAttributeEnum.RenBonus.getPropertyId()); // 人系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.FoBonus.getPropertyId()); // 佛系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.YaoBonus.getPropertyId()); // 妖系伤害加成系数
|
||||
transTemplate.add(HeroAttributeEnum.DaoBonus.getPropertyId()); // 道系伤害加成系数
|
||||
|
||||
transTemplate.add(HeroAttributeEnum.RenReduce.getPropertyId()); // 人系伤害减免系数
|
||||
transTemplate.add(HeroAttributeEnum.FoReduce.getPropertyId()); // 佛系伤害减免系数
|
||||
transTemplate.add(HeroAttributeEnum.YaoReduce.getPropertyId());// 妖系伤害减免系数
|
||||
transTemplate.add(HeroAttributeEnum.DaoReduce.getPropertyId()); // 道系伤害减免系数
|
||||
|
||||
transTemplate.add(HeroAttributeEnum.CritDamageReduceFactor.getPropertyId()); // 暴伤减免
|
||||
|
||||
transTemplateByHeroPropertyName.put(1, new ArrayList<>(transTemplate));
|
||||
transTemplateByHeroPropertyName.put(2, new ArrayList<>(transTemplate));
|
||||
|
@ -119,12 +115,6 @@ public class HeroLogic {
|
|||
transTemplateByHeroPropertyName.put(5, new ArrayList<>(transTemplate));
|
||||
transTemplateByHeroPropertyName.put(6, new ArrayList<>(transTemplate));
|
||||
|
||||
transTemplateByHeroPropertyName.get(1).add(HeroAttributeEnum.FireDamageBonusFactor.getPropertyId());
|
||||
transTemplateByHeroPropertyName.get(2).add(HeroAttributeEnum.WindDamageBonusFactor.getPropertyId());
|
||||
transTemplateByHeroPropertyName.get(3).add(HeroAttributeEnum.WaterDamageBonusFactor.getPropertyId());
|
||||
transTemplateByHeroPropertyName.get(4).add(HeroAttributeEnum.LandDamageBonusFactor.getPropertyId());
|
||||
transTemplateByHeroPropertyName.get(5).add(HeroAttributeEnum.LightDamageBonusFactor.getPropertyId());
|
||||
transTemplateByHeroPropertyName.get(6).add(HeroAttributeEnum.DarkDamageBonusFactor.getPropertyId());
|
||||
|
||||
equipSkillPositionTemaplge.add(1);
|
||||
equipSkillPositionTemaplge.add(2);
|
||||
|
@ -3102,66 +3092,75 @@ 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();
|
||||
//
|
||||
// result += propertyValue*score;
|
||||
// }
|
||||
float forceNum=0;//基础值
|
||||
float forceAdd=0;//加成值
|
||||
//战力计算
|
||||
for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
|
||||
Integer propertyId = item.getKey();
|
||||
float propertyValue = item.getValue();
|
||||
///pvp增伤和减伤在计算之前已经算进去了
|
||||
if (propertyId==HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId()||propertyId==HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId()){
|
||||
continue;
|
||||
}
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(propertyId);
|
||||
if (sPropertyConfig==null){
|
||||
continue;
|
||||
}
|
||||
if (sPropertyConfig.getScore()==0){
|
||||
continue;
|
||||
}
|
||||
if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
|
||||
forceAdd += propertyValue*sPropertyConfig.getScore()/10000;
|
||||
}else{
|
||||
forceNum += propertyValue*sPropertyConfig.getScore();
|
||||
}
|
||||
}
|
||||
result=forceNum+(forceNum*forceAdd);
|
||||
|
||||
// 新战力计算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;
|
||||
// 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;
|
||||
// // 面板攻击
|
||||
// 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;
|
||||
}
|
||||
|
||||
public void combinedAttribute(Map<Integer, Long> otherAttriMaop, Map<Integer, Long> heroAttributeMap) {
|
||||
|
|
Loading…
Reference in New Issue