yyl
2025-09-12 a966d3ece73d1a7be49c8187702b94480d8f7861
Main/System/Battle/BattleUtility.cs
@@ -289,24 +289,13 @@
    public static List<long> DivideDamageToList(int[] damageDivide, long totalDamage)
    {
        List<long> fixedDamageList = new List<long>();
        long assigned = 0;
        int count = damageDivide.Length;
        for (int i = 0; i < count; i++)
        for (int i = 0; i < damageDivide.Length; i++)
        {
            long damage;
            if (i == count - 1)
            {
                // 最后一个分配项修正为剩余
                damage = totalDamage - assigned;
            }
            else
            {
                damage = (totalDamage * damageDivide[i] + 5000) / 10000; // 四舍五入
                assigned += damage;
            }
            fixedDamageList.Add(damage);
            float fixedDamage = (float)totalDamage * (float)damageDivide[i] / 10000f;
            fixedDamageList.Add((int)fixedDamage);
        }
        return fixedDamageList;
    }