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
end
-- 清除引导路径
self:clearTutorialPath()
self.atkTeam:onRoundEnd()
self.defTeam:onRoundEnd()
local unitEntity = self.defTeam:getMainUnit().unitEntity

View File

@ -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