From 21c9a1c13c1b62f02b60108bde660779d7102449 Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 25 Apr 2023 22:13:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=80=E9=87=8F=E8=A2=AB=E5=8A=A8=E7=9A=84bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 2 +- lua/app/module/battle/team/battle_team.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index d4dc8d75..30a2d54a 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1211,7 +1211,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus) end end if hp > 0 then - self:checkPassiveEvent(PASSIVE_EVENT.HP_LOWER_THAN, atker, hpPercent) + self.team:checkPassiveEvent(PASSIVE_EVENT.HP_LOWER_THAN, atker, hpPercent) end end diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 3e51ee44..6492bbad 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -23,6 +23,12 @@ function BattleTeam:addUnit(unit, isMainUnit) end end +function BattleTeam:checkPassiveEvent(...) + for k, v in ipairs(self.unitList) do + v:checkPassiveEvent(...) + end +end + function BattleTeam:prepare() for k, v in ipairs(self.unitList) do v:prepare()