From 89cdcef44f0b06cea5892ed7eacf02325aeb2dbf Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 25 Apr 2023 10:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A4=E7=9B=BEbuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/team/battle_team.lua | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 3da1586a..d753823b 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -269,13 +269,13 @@ function BattleTeam:updateBuffState(buff, num) if fxList then local fxCfg = BattleHelper:getFxConfig() for k, v in ipairs(fxList) do - for k2, v2 in ipairs(self.unitList) do - local fxInfo = fxCfg[v] - if fxInfo then - local res = fxInfo.res - local count = self.loopFxMap[res] or 0 - self.loopFxMap[res] = count - 1 - if count == 1 then + local fxInfo = fxCfg[v] + if fxInfo then + local res = fxInfo.res + local count = self.loopFxMap[res] or 0 + self.loopFxMap[res] = count - 1 + if count == 1 then + for k2, v2 in ipairs(self.unitList) do v2:removeEffect(res) end end @@ -287,13 +287,13 @@ function BattleTeam:updateBuffState(buff, num) if fxList then local fxCfg = BattleHelper:getFxConfig() for k, v in ipairs(fxList) do - for k2, v2 in ipairs(self.unitList) do - local fxInfo = fxCfg[v] - if fxInfo then - local res = fxInfo.res - local count = self.loopFxMap[res] or 0 - self.loopFxMap[res] = count + 1 - if count == 0 then + local fxInfo = fxCfg[v] + if fxInfo then + local res = fxInfo.res + local count = self.loopFxMap[res] or 0 + self.loopFxMap[res] = count + 1 + if count == 0 then + for k2, v2 in ipairs(self.unitList) do v2:getEffectAndPlay(fxInfo, true) end end