指引
This commit is contained in:
parent
cc7f94da7d
commit
a1fecd3263
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
local elementTypeCoefficient = {}
|
self.tutorialTime = 0
|
||||||
local teamEntity = self.battleData:getAtkTeam()
|
if not self.tutorialPath then
|
||||||
local members = teamEntity:getAllMembers()
|
local elementTypeCoefficient = {}
|
||||||
for _, v in pairs(members) do
|
local teamEntity = self.battleData:getAtkTeam()
|
||||||
elementTypeCoefficient[v:getMatchType()] = v:getAtk()
|
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
|
end
|
||||||
local path = BoardHeler:findPvpLinkOptimalSolution(self, 1, GConst.BattleConst.ROW_COUNT, elementTypeCoefficient, self:getMinEliminationCount())
|
if self.tutorialPath and #self.tutorialPath >= self:getMinEliminationCount() then
|
||||||
if path and #path >= self:getMinEliminationCount() then
|
for _, posId in ipairs(self.tutorialPath) do
|
||||||
self.tutorialPath = path
|
|
||||||
for _, posId in ipairs(path) 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
|
-- self.tutorialPath = nil
|
||||||
end
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerStage:clearTutorialPath()
|
||||||
|
self.tutorialPath = nil
|
||||||
end
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
return BattleControllerStage
|
return BattleControllerStage
|
||||||
Loading…
x
Reference in New Issue
Block a user