diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index c0e0dff562..767a65d197 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -754,6 +754,18 @@ function BattleUtil.ApplyDamageNoPassive(skill, atkRole, defRole, damage, bCrit, damage=realDamage end defRole.Event:DispatchEvent(BattleEventName.CheckFalseNoDead, damagingFunc, atkRole, realDamage, skill, dotType, bCrit, damageType,isDirect) + + local isToDied=false + --检测时空猪八戒格挡致死伤害 + local checkDamageShift = function(isDead) + isToDied=isDead + end + BattleLogic.Event:DispatchEvent(BattleEventName.CheckDamShift, checkDamageShift, atkRole, realDamage, defRole,skill) + --格挡成功 + if isToDied then + return + end + local finalDmg = defRole.data:SubValue(RoleDataName.Hp,realDamage) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then @@ -928,7 +940,6 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy isToDied=isDead end BattleLogic.Event:DispatchEvent(BattleEventName.CheckDamShift, checkDamageShift, atkRole, realDamage, defRole,skill) - --格挡成功 if isToDied then return @@ -1026,6 +1037,18 @@ function BattleUtil.FinalDamageCountShield(skill, atkRole, defRole, damage, bCri damage=realDamage end defRole.Event:DispatchEvent(BattleEventName.CheckFalseNoDead, damagingFunc, atkRole, realDamage, skill, dotType, bCrit, damageType,isDirect) + + local isToDied=false + --检测时空猪八戒格挡致死伤害 + local checkDamageShift = function(isDead) + isToDied=isDead + end + BattleLogic.Event:DispatchEvent(BattleEventName.CheckDamShift, checkDamageShift, atkRole, realDamage, defRole,skill) + --格挡成功 + if isToDied then + return + end + local finalDmg = defRole.data:SubValue(RoleDataName.Hp,realDamage) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then