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