yyl
2026-01-09 06cb31d6c6b74c60c1ac8f355678275f523db329
125 战斗 招架跟贯穿
5个文件已修改
75 ■■■■■ 已修改文件
Main/System/Battle/BattleConst.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/BattleField.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Define/BattleDmgInfo.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Define/DamageType.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Skill/SkillBase.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleConst.cs
@@ -75,6 +75,10 @@
    public const int BattleChaseAttack = 100005; // 追击
    public const int BattleStun = 100006; // 击晕
    public const int BreakArmor = 100007; // 贯穿
    public const int Parry = 100008; // 招架
    
    #endregion
@@ -247,6 +251,10 @@
    public const int BlockEffectID = 19999; // 格挡特效ID
    public const int RebornEffectID = 10025;    // 复活特效ID
    public const int BreakArmorEffectID = 10026; // 贯穿特效ID
    public const int ParryEffectID = 10027; // 招架特效ID
    
    #endregion
Main/System/Battle/BattleField/BattleField.cs
@@ -541,10 +541,12 @@
            }
            //  需要输出一下当前执行的死亡操作里的人员名单maybe
            // 只处理有效的死亡消息
            if (validDeadList.Count > 0)
            {
                DeathRecordAction recordAction = new DeathRecordAction(this, validDeadList);
                DeathRecordAction recordAction = new DeathRecordAction(this, validDeadList, causingRecordAction);
                //  如果有导致死亡的技能,将DeathRecordAction作为其子节点,并设置为WaitingPlay
                if (causingRecordAction != null)
                {
@@ -555,6 +557,7 @@
                    recordPlayer.ImmediatelyPlay(recordAction);
                }
            }
        }
    }
Main/System/Battle/Define/BattleDmgInfo.cs
@@ -164,6 +164,14 @@
                    convertedAttackTypes |= (int)DamageType.Damage;
                    break;
                
                case ServerDamageType.BreakArmor:
                    convertedAttackTypes |= (int)DamageType.BreakArmor;
                    break;
                case ServerDamageType.Parry:
                    convertedAttackTypes |= (int)DamageType.Parry;
                    break;
                default:
                    Debug.LogError($"[BattleDmgInfo] 未知的服务器伤害类型: {serverDamageType}({serverValue})");
                    break;
@@ -407,6 +415,13 @@
        targetDamageList.Add(new BattleDmg { damage = damage, attackType = attackType });
    }
    protected static List<DamageType> ExcludeDamageTypes = new List<DamageType>
    {
        DamageType.SuckHpReverse,
        DamageType.Parry,
        DamageType.BreakArmor,
    };
    /// <summary>
    /// 验证并修复攻击类型
    /// </summary>
@@ -419,9 +434,12 @@
            attackType &= ~(int)DamageType.Stunned;
        }
        if (IsType(DamageType.SuckHpReverse))
        foreach (var excludeType in ExcludeDamageTypes)
        {
            attackType &= ~(int)DamageType.SuckHpReverse;
            if (IsType(excludeType))
            {
                attackType &= ~(int)excludeType;
            }
        }
        if (DamageNumConfig.Get(attackType) != null)
Main/System/Battle/Define/DamageType.cs
@@ -33,6 +33,12 @@
    SuckHpReverse = 2048,//吸血毒药 (2^11 序号11)
    SelfHarm = 4096,//自残 (2^12 序号12)
    Protected = 8192,//本次伤害有受保护标记 (2^13 序号13)
    IngoreSheild = 16384,//无视护盾 (2^14 序号14)
    BreakArmor = 32768,//破甲伤害 (2^15 序号15)
    Parry = 65536,//招架 (2^16 序号16)
}
public enum DamageType
@@ -68,5 +74,9 @@
    CritRealdamage = Crit + Realdamage, //暴击真伤
    SuckHpReverse = 8192, //吸血反转为伤害
    BreakArmor = 32768,//破甲伤害 (2^15 序号15)
    Parry = 65536,//招架 (2^16 序号16)
}
Main/System/Battle/Skill/SkillBase.cs
@@ -755,6 +755,36 @@
                DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BattleStun);
                Hint(caster, hintConfig);
            }
            for (int i = 0; i < hitList.Count; i++)
            {
                var hurt = hitList[i];
                if ((hurt.AttackTypes & (int)DamageType.BreakArmor) == (int)DamageType.BreakArmor)
                {
                    BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
                    if (battleObject != null)
                    {
                        DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BreakArmor);
                        Hint(battleObject, hintConfig);
                        battleField.battleEffectMgr.PlayEffect(battleObject,
                            BattleConst.BreakArmorEffectID, battleObject.heroRectTrans, battleObject.Camp,
                            battleObject.teamHero.modelScale);
                    }
                }
                else if ((hurt.AttackTypes & (int)DamageType.Parry) == (int)DamageType.Parry)
                {
                    BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
                    if (battleObject != null)
                    {
                        DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.Parry);
                        Hint(battleObject, hintConfig);
                        battleField.battleEffectMgr.PlayEffect(battleObject,
                            BattleConst.ParryEffectID, battleObject.heroRectTrans, battleObject.Camp,
                            battleObject.teamHero.modelScale);
                    }
                }
            }
        }