diff --git a/lua/app/module/battle/helper/board_helper.lua b/lua/app/module/battle/helper/board_helper.lua index 0b387cf4..851864f5 100644 --- a/lua/app/module/battle/helper/board_helper.lua +++ b/lua/app/module/battle/helper/board_helper.lua @@ -24,13 +24,18 @@ end function BoardHelper:findPvpLinkOptimalSolution(battleController, startRow, endRow) local battleData = battleController.battleData local gridMap = BoardHelper:getEmptyTable() - local minRow = math.min(startRow, endRow) - local maxRow = math.max(startRow, endRow) - for row = minRow, maxRow do -- 遍历所有的可使用格子 + local gridEntities = BoardHelper:getEmptyTable() + local step = 1 + if startRow > endRow then + step = -1 + end + + for row = startRow, endRow, step do -- 遍历所有的可使用格子 for column = 1, BattleConst.COLUMN_COUNT do local posId = ModuleManager.BattleManager:getPosId(row, column) local gridEntity = battleData:getGridEnties()[posId] if gridEntity and gridEntity:canLink() then + table.insert(gridEntities, posId) gridMap[posId] = gridEntity end end @@ -38,7 +43,8 @@ function BoardHelper:findPvpLinkOptimalSolution(battleController, startRow, endR local maxPath local maxPathCount = 0 - for posId, entity in pairs(gridMap) do + for _, posId in pairs(gridEntities) do + local entity = gridMap[posId] local mainElementType if not entity:getSkillId() then mainElementType = entity:getElementType() diff --git a/lua/app/ui/battle/battle_ui_pvp.lua b/lua/app/ui/battle/battle_ui_pvp.lua index 9f20c9cd..e2077f9a 100644 --- a/lua/app/ui/battle/battle_ui_pvp.lua +++ b/lua/app/ui/battle/battle_ui_pvp.lua @@ -234,9 +234,9 @@ end function BattleBaseUI:enterHideBoardAni(callback) self:clearEnterShowBoardSeq() self.enterShowBoardSeq = self.root:createBindTweenSequence() + self.enterShowBoardSeq:AppendInterval(0.5) local w, h = GFunc.getUIExpandScreenSize() self.enterShowBoardSeq:Append(self:getBoardRootNode():getTransform():DOLocalMoveX(w / 2 + 360, 0.5)) - self.enterShowBoardSeq:AppendInterval(0.5) self.enterShowBoardSeq:AppendCallback(function() if callback then callback()