From a1fecd3263df9dd3a7ef06d0a1781a62c9665370 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Tue, 11 Nov 2025 15:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/battle_base_controller.lua | 2 + .../controller/battle_controller_stage.lua | 44 +++++++++++-------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 05516e43..8bab766d 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -1359,6 +1359,8 @@ function BattleBaseController:enterRoundEnd() return end + -- 清除引导路径 + self:clearTutorialPath() self.atkTeam:onRoundEnd() self.defTeam:onRoundEnd() local unitEntity = self.defTeam:getMainUnit().unitEntity diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index 1b196693..7684329a 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -149,19 +149,21 @@ function BattleControllerStage:checkTutorialBoard() return end local time = math.floor(self.tutorialTime) - if time == 0 or time %3 ~= 0 then + if time == 0 or time %5 ~= 0 then return end - local elementTypeCoefficient = {} - local teamEntity = self.battleData:getAtkTeam() - local members = teamEntity:getAllMembers() - for _, v in pairs(members) do - elementTypeCoefficient[v:getMatchType()] = v:getAtk() + self.tutorialTime = 0 + if not self.tutorialPath then + local elementTypeCoefficient = {} + local teamEntity = self.battleData:getAtkTeam() + local members = teamEntity:getAllMembers() + for _, v in pairs(members) do + elementTypeCoefficient[v:getMatchType()] = v:getAtk() + end + self.tutorialPath = BoardHeler:findPvpLinkOptimalSolution(self, 1, GConst.BattleConst.ROW_COUNT, elementTypeCoefficient, self:getMinEliminationCount()) end - local path = BoardHeler:findPvpLinkOptimalSolution(self, 1, GConst.BattleConst.ROW_COUNT, elementTypeCoefficient, self:getMinEliminationCount()) - if path and #path >= self:getMinEliminationCount() then - self.tutorialPath = path - for _, posId in ipairs(path) do + if self.tutorialPath and #self.tutorialPath >= self:getMinEliminationCount() then + for _, posId in ipairs(self.tutorialPath) do local entity = self.battleData:getGridEntity(posId) if entity and entity:getCell() then entity:getCell():showAni() @@ -172,15 +174,19 @@ end function BattleControllerStage:hideTutorialBoard() self.tutorialTime = 0 - if self.tutorialPath then - for _, posId in ipairs(self.tutorialPath) do - local entity = self.battleData:getGridEntity(posId) - if entity and entity:getCell() then - entity:getCell():hideAni() - end - end - self.tutorialPath = nil - end + -- if self.tutorialPath then + -- for _, posId in ipairs(self.tutorialPath) do + -- local entity = self.battleData:getGridEntity(posId) + -- if entity and entity:getCell() then + -- entity:getCell():hideAni() + -- end + -- end + -- self.tutorialPath = nil + -- end +end + +function BattleControllerStage:clearTutorialPath() + self.tutorialPath = nil end --@endregion return BattleControllerStage \ No newline at end of file