This commit is contained in:
puxuan 2025-11-11 15:54:19 +08:00
parent cc7f94da7d
commit a1fecd3263
2 changed files with 27 additions and 19 deletions

View File

@ -1359,6 +1359,8 @@ function BattleBaseController:enterRoundEnd()
return return
end end
-- 清除引导路径
self:clearTutorialPath()
self.atkTeam:onRoundEnd() self.atkTeam:onRoundEnd()
self.defTeam:onRoundEnd() self.defTeam:onRoundEnd()
local unitEntity = self.defTeam:getMainUnit().unitEntity local unitEntity = self.defTeam:getMainUnit().unitEntity

View File

@ -149,19 +149,21 @@ function BattleControllerStage:checkTutorialBoard()
return return
end end
local time = math.floor(self.tutorialTime) local time = math.floor(self.tutorialTime)
if time == 0 or time %3 ~= 0 then if time == 0 or time %5 ~= 0 then
return return
end end
self.tutorialTime = 0
if not self.tutorialPath then
local elementTypeCoefficient = {} local elementTypeCoefficient = {}
local teamEntity = self.battleData:getAtkTeam() local teamEntity = self.battleData:getAtkTeam()
local members = teamEntity:getAllMembers() local members = teamEntity:getAllMembers()
for _, v in pairs(members) do for _, v in pairs(members) do
elementTypeCoefficient[v:getMatchType()] = v:getAtk() elementTypeCoefficient[v:getMatchType()] = v:getAtk()
end end
local path = BoardHeler:findPvpLinkOptimalSolution(self, 1, GConst.BattleConst.ROW_COUNT, elementTypeCoefficient, self:getMinEliminationCount()) self.tutorialPath = BoardHeler:findPvpLinkOptimalSolution(self, 1, GConst.BattleConst.ROW_COUNT, elementTypeCoefficient, self:getMinEliminationCount())
if path and #path >= self:getMinEliminationCount() then end
self.tutorialPath = path if self.tutorialPath and #self.tutorialPath >= self:getMinEliminationCount() then
for _, posId in ipairs(path) do for _, posId in ipairs(self.tutorialPath) do
local entity = self.battleData:getGridEntity(posId) local entity = self.battleData:getGridEntity(posId)
if entity and entity:getCell() then if entity and entity:getCell() then
entity:getCell():showAni() entity:getCell():showAni()
@ -172,15 +174,19 @@ end
function BattleControllerStage:hideTutorialBoard() function BattleControllerStage:hideTutorialBoard()
self.tutorialTime = 0 self.tutorialTime = 0
if self.tutorialPath then -- if self.tutorialPath then
for _, posId in ipairs(self.tutorialPath) do -- for _, posId in ipairs(self.tutorialPath) do
local entity = self.battleData:getGridEntity(posId) -- local entity = self.battleData:getGridEntity(posId)
if entity and entity:getCell() then -- if entity and entity:getCell() then
entity:getCell():hideAni() -- entity:getCell():hideAni()
end -- end
end -- end
-- self.tutorialPath = nil
-- end
end
function BattleControllerStage:clearTutorialPath()
self.tutorialPath = nil self.tutorialPath = nil
end
end end
--@endregion --@endregion
return BattleControllerStage return BattleControllerStage