调整敌人经验配置、修复百分率属性问题

This commit is contained in:
2026-09-24 23:03:59 +08:00
parent 02f4c67464
commit c61eb7fb68
5 changed files with 47 additions and 8 deletions
@@ -193,7 +193,21 @@ namespace SepCore.Battle
}
}
float finalValue = ((BaseValue + sumFlat) * (1f + sumPercentAdd)) * prodPercentMult;
float finalValue;
if (Type is StatType.CritChance or StatType.Dodge or StatType.LifeSteal)
{
// 概率/比率型属性(暴击率、闪避率、生命窃取):底数通常为 0~1 的小数概率。
// 无论是 Flat(如道具填 0.27)还是 PercentAdd(如升级奖励填 0.30),本质上均为点数直接加算(+30% 概率)。
// 若沿用标量乘法公式,由于 BaseValue 为 0,会导致 (0 + 0) * (1 + 0.30) = 0,从而百分比奖励完全失效。
finalValue = (BaseValue + sumFlat + sumPercentAdd) * prodPercentMult;
}
else
{
// 标量属性与倍率属性(MaxHp、MoveSpeed、DamagePercent、AttackSpeed 等):
// (Base + Flat) * (1 + PercentAdd) * PercentMult
finalValue = ((BaseValue + sumFlat) * (1f + sumPercentAdd)) * prodPercentMult;
}
return ClampStat(finalValue);
}