From 86ece9cc1f9411c9f8f82f337aa4e6073d2a56a1 Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Tue, 16 May 2023 09:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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