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