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

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
Binary file not shown.
@@ -9,7 +9,7 @@
"attackRange": 1.5,
"speed": 3,
"coinDrop": 5,
"expDrop": 1,
"expDrop": 20,
"dropPercent": 0.3,
"scale": 1,
"color": "#44FF44",
@@ -25,7 +25,7 @@
"attackRange": 8,
"speed": 2.5,
"coinDrop": 4,
"expDrop": 2,
"expDrop": 20,
"dropPercent": 0.2,
"scale": 1,
"color": "#FF44FF",
@@ -41,7 +41,7 @@
"attackRange": 1.2,
"speed": 6,
"coinDrop": 3,
"expDrop": 1,
"expDrop": 25,
"dropPercent": 0.4,
"scale": 0.5,
"color": "#FF4444",
@@ -57,7 +57,7 @@
"attackRange": 1.8,
"speed": 2.5,
"coinDrop": 6,
"expDrop": 2,
"expDrop": 25,
"dropPercent": 0.3,
"scale": 1.3,
"color": "#CCCCCC",
@@ -73,7 +73,7 @@
"attackRange": 2.5,
"speed": 1.5,
"coinDrop": 10,
"expDrop": 3,
"expDrop": 30,
"dropPercent": 0.25,
"scale": 2,
"color": "#888888",
@@ -89,7 +89,7 @@
"attackRange": 10,
"speed": 3,
"coinDrop": 5,
"expDrop": 2,
"expDrop": 30,
"dropPercent": 0.3,
"scale": 0.8,
"color": "#88CCFF",
@@ -105,7 +105,7 @@
"attackRange": 12,
"speed": 2,
"coinDrop": 8,
"expDrop": 3,
"expDrop": 30,
"dropPercent": 0.2,
"scale": 1.2,
"color": "#FF8800",
@@ -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);
}