链接提示
This commit is contained in:
parent
317802ca5f
commit
efa763ef2c
@ -83,6 +83,15 @@ function BattleBaseController:getBattleUIPath()
|
||||
return "app/ui/battle/battle_ui"
|
||||
end
|
||||
|
||||
function BattleBaseController:setCheckTutorial(tutorial)
|
||||
end
|
||||
|
||||
function BattleBaseController:checkTutorialBoard()
|
||||
end
|
||||
|
||||
function BattleBaseController:hideTutorialBoard()
|
||||
end
|
||||
|
||||
---- 障碍格子图片
|
||||
function BattleBaseController:getBlockIcon()
|
||||
local chapterInfo = self:getChapterConfig()[self.chapterId]
|
||||
@ -296,6 +305,7 @@ function BattleBaseController:onDefDead(callback)
|
||||
end
|
||||
|
||||
function BattleBaseController:onLinkChange()
|
||||
self:hideTutorialBoard()
|
||||
self.battleUI:hideAllSfxLine()
|
||||
self.linkChangeNeedFalsePosMap = table.clearOrCreate(self.linkChangeNeedFalsePosMap)
|
||||
for posId, entity in pairs(self.battleData:getGridEnties()) do
|
||||
@ -325,6 +335,11 @@ function BattleBaseController:onLinkChange()
|
||||
end
|
||||
|
||||
local count = #sequence
|
||||
if count > 0 then
|
||||
self:setCheckTutorial(false)
|
||||
else
|
||||
self:setCheckTutorial(true)
|
||||
end
|
||||
|
||||
for index, info in ipairs(sequence) do
|
||||
local entity = self.battleData:getGridEntity(info.posId)
|
||||
@ -545,6 +560,8 @@ function BattleBaseController:init(params, snapshot)
|
||||
self.eliminateTotalCount = 0
|
||||
self.maxLinkCount = 0
|
||||
self.realTime = 0
|
||||
self.tutorialTime = 0
|
||||
self.needCheckTutorial = true
|
||||
self.doubleMystery = 0
|
||||
self.taskProgress = {}
|
||||
self.waveRoundCount = {}
|
||||
@ -1186,6 +1203,7 @@ function BattleBaseController:enterElimination(needDelay)
|
||||
|
||||
self.battleUI:hideAllBoardSfxs()
|
||||
|
||||
self:setCheckTutorial(true)
|
||||
-- 检查棋盘
|
||||
local find, pathList = self:findAttention()
|
||||
if not find then -- 如果没找到,就要打乱棋盘
|
||||
@ -1408,6 +1426,7 @@ function BattleBaseController:onLinkOver()
|
||||
local sequence = self.battleData:getGridSequence()
|
||||
local count = #sequence
|
||||
if count < self:getMinEliminationCount() then
|
||||
self:setCheckTutorial(true)
|
||||
return
|
||||
end
|
||||
|
||||
@ -3259,8 +3278,10 @@ function BattleBaseController:_tick(dt, originDt)
|
||||
self.waveDurationTime = self.waveDurationTime + originDt
|
||||
self.totalDurationTime = self.totalDurationTime + originDt
|
||||
if self.isPause then
|
||||
self:hideTutorialBoard()
|
||||
return
|
||||
end
|
||||
self.tutorialTime = self.tutorialTime + dt
|
||||
if self.needWaitingBoardOver == false then
|
||||
self:enterRoundBegin()
|
||||
end
|
||||
@ -3282,6 +3303,7 @@ function BattleBaseController:_tick(dt, originDt)
|
||||
self:checkSkillSlowDown(dt)
|
||||
self:tick(dt)
|
||||
BattleBoardTouchHelper:tick(dt)
|
||||
self:checkTutorialBoard()
|
||||
end
|
||||
|
||||
function BattleBaseController:adRevive(revive)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
||||
local BoardHeler = require "app/module/battle/helper/board_helper"
|
||||
|
||||
function BattleControllerStage:canRevive()
|
||||
return true
|
||||
@ -134,4 +135,56 @@ function BattleControllerStage:postFightStart()
|
||||
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self:getWaveIndex(), self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId))
|
||||
end
|
||||
|
||||
--@region 消除提示
|
||||
function BattleControllerStage:getAtkMinRow()
|
||||
return GConst.BattleConst.COLUMN_COUNT
|
||||
end
|
||||
|
||||
function BattleControllerStage:setCheckTutorial(tutorial)
|
||||
self.needCheckTutorial = tutorial
|
||||
end
|
||||
|
||||
-- showAttention 类似 但是没有调用 不会重复提示
|
||||
function BattleControllerStage:checkTutorialBoard()
|
||||
if not self.needCheckTutorial then
|
||||
return
|
||||
end
|
||||
if DataManager.TutorialData:getIsInTutorial() then
|
||||
return
|
||||
end
|
||||
local time = math.floor(self.tutorialTime)
|
||||
if time == 0 or time %3 ~= 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()
|
||||
end
|
||||
local path = BoardHeler:findPvpLinkOptimalSolution(self, 1, self:getAtkMinRow(), elementTypeCoefficient, self:getMinEliminationCount())
|
||||
if path and #path >= self:getMinEliminationCount() then
|
||||
self.tutorialPath = path
|
||||
for _, posId in ipairs(path) do
|
||||
local entity = self.battleData:getGridEntity(posId)
|
||||
if entity and entity:getCell() then
|
||||
entity:getCell():showAni()
|
||||
end
|
||||
end
|
||||
end
|
||||
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
|
||||
end
|
||||
--@endregion
|
||||
return BattleControllerStage
|
||||
Loading…
x
Reference in New Issue
Block a user