yyl
3 天以前 38a309977fee4c17369f263412c60c9c4e748186
125 战斗 闪避问题修复 伤害类型错误描述变更
2个文件已修改
18 ■■■■ 已修改文件
Main/System/Battle/BattleObject/BattleObject.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Define/BattleDmgInfo.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleObject/BattleObject.cs
@@ -314,7 +314,7 @@
        //  这里
        if (dmgInfo.IsType(DamageType.Dodge) && !buffMgr.isControled[BattleConst.HardControlGroup])
        if (dmgInfo.IsType(DamageType.Dodge) /*&& !buffMgr.isControled[BattleConst.HardControlGroup]*/)//如果被控制了还闪避了 要看看服务器怎么处理了
        {
            if (isLastHit)
            {
@@ -426,6 +426,7 @@
    {
        // 处理复活逻辑
        teamHero.curHp = GeneralDefine.GetFactValue(vNetData.HP, vNetData.HPEx);
        teamHero.isDead = false;
        heroGo.SetActive(true);
        motionBase.PlayAnimation(MotionName.idle, true);
    }
Main/System/Battle/Define/BattleDmgInfo.cs
@@ -30,6 +30,8 @@
    public List<BattleDmg> targetDamageList = new List<BattleDmg>();
    public List<BattleDmg> casterDamageList = new List<BattleDmg>();
    public uint m_rawAttackType;
    #region Initialization
    public BattleDmgInfo(string battleFieldGuid, BattleHurtParam battleHurtParam)
@@ -38,6 +40,8 @@
        this.battleHurtParam = battleHurtParam;
        this.isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1;
        
        m_rawAttackType = hurt == null ? 0 : hurt.AttackTypes;
        HandleDamageType();
        HandleAttackTypeAndDamage();
    }
@@ -94,15 +98,18 @@
                    break;
                
                case ServerDamageType.DamageReverse:
                    Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 DamageReverse({serverValue}) 在客户端没有对应的枚举值");
                    convertedAttackTypes |= (int)DamageType.Damage;
                    // Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 DamageReverse({serverValue}) 在客户端没有对应的枚举值");
                    break;
                
                case ServerDamageType.SuckHpReverse:
                    Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 SuckHpReverse({serverValue}) 在客户端没有对应的枚举值");
                    convertedAttackTypes |= (int)DamageType.Damage;
                    // Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 SuckHpReverse({serverValue}) 在客户端没有对应的枚举值");
                    break;
                
                case ServerDamageType.SelfHarm:
                    Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 SelfHarm({serverValue}) 在客户端没有对应的枚举值");
                    convertedAttackTypes |= (int)DamageType.Damage;
                    // Debug.LogWarning($"[BattleDmgInfo] 服务器伤害类型 SelfHarm({serverValue}) 在客户端没有对应的枚举值");
                    break;
                
                default:
@@ -286,7 +293,7 @@
        if (DamageNumConfig.Get(attackType) != null)
            return attackType;
        UnityEngine.Debug.LogError($"服务器给的伤害类型不对,强制转换为普通伤害/治疗, attackType: {attackType}");
        UnityEngine.Debug.LogError($"转换伤害类型错误或者未实现,强制转换为普通伤害/治疗, attackType: {attackType} rawAttackType: {m_rawAttackType}");
        if ((attackType & (int)DamageType.Damage) != 0)
            return (int)DamageType.Damage;