From 78704c6e35821ab717f08a3e0daf49f3fc4b9723 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Jul 2023 20:54:47 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/controller/battle_base_controller.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 6d47cc75..ce1c452a 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -298,7 +298,18 @@ function BattleBaseController:onLinkChange() end if not self:getCurActionUnitComp():getActiveSkillLimit() then - local aniSequence, influenceElementType, lineCount, elementTypeMap, linkElementType = self:calculateCurElimination(true) + local aniSequence, influenceElementType, lineCount, elementTypeMap, linkElementType, effectGridMap, randomPosList = self:calculateCurElimination(true) + if randomPosList then + for _, posId in ipairs(randomPosList) do + local gridEntity = self.battleData:getGridEntity(posId) + if gridEntity and gridEntity:canLink() then + local elementType = gridEntity:getElementType() + if elementTypeMap[elementType] and elementTypeMap[elementType] > 0 then + elementTypeMap[elementType] = elementTypeMap[elementType] - 1 + end + end + end + end self.battleUI:refreshSkill(elementTypeMap, count > 0, self.curActionSide) end @@ -1197,7 +1208,7 @@ function BattleBaseController:calculateCurElimination(onlyCheck) end end - return self.aniSequence, influenceElementTypeMap, lineCount, self.elementTypeMap, linkElementType, self.effectGridMap + return self.aniSequence, influenceElementTypeMap, lineCount, self.elementTypeMap, linkElementType, self.effectGridMap, randomPosList end function BattleBaseController:dealGridBreak(posId, condition, time, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck)