yyl
2025-09-12 e9742216aa9697ba61f89e8ad1612c379f7cb931
Main/System/Battle/BattleUtility.cs
@@ -122,35 +122,7 @@
    public static string DisplayDamageNum(long num, int attackType)
    {
        // 服务器位数到客户端类型ID的映射
        Dictionary<int, int> serverToClientTypeMap = new Dictionary<int, int>
        {
            { 1, 2 },    // 普通伤血
            { 2, 4 },    // 恢复回血
            { 3, 8 },    // 反弹伤血
            { 4, 16 },   // 持续伤血
            { 5, 32 },   // 格挡
            { 7, 64 },   // 暴击伤害
            { 9, 128 },  // 闪避
            // 其它类型如需补充可继续添加
        };
        int damageTypeValue = 0;
        for (int i = 0; i < 32; i++)
        {
            int flag = 1 << i;
            if ((attackType & flag) != 0)
            {
                // 只处理有映射的类型
                if (serverToClientTypeMap.TryGetValue(i + 1, out int clientTypeId))
                {
                    damageTypeValue += clientTypeId;
                }
            }
        }
        DamageType damageType = (DamageType)damageTypeValue;
        var config = DamageNumConfig.Get(damageTypeValue);
        var config = DamageNumConfig.Get(attackType);
        var basePowerStr = UIHelper.ReplaceLargeArtNum(num);
        var result = string.Empty;
        for (int i = 0; i < basePowerStr.Length; i++)
@@ -158,7 +130,7 @@
            var numChar = (char)GetDamageNumKey(config, basePowerStr[i]);
            if (numChar > 0)
            {
                result += numChar;
                result += numChar;
            }
        }
        return result;