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