链接提示
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
|
||||||
@ -16,28 +17,28 @@ function BattleControllerStage:canGetDoubleRewards()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getBoardConfig()
|
function BattleControllerStage:getBoardConfig()
|
||||||
return ConfigManager:getConfig("chapter_board")
|
return ConfigManager:getConfig("chapter_board")
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getChapterConfig()
|
function BattleControllerStage:getChapterConfig()
|
||||||
return ConfigManager:getConfig("chapter")
|
return ConfigManager:getConfig("chapter")
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getChapterId()
|
function BattleControllerStage:getChapterId()
|
||||||
return DataManager.ChapterData:getChapterId()
|
return DataManager.ChapterData:getChapterId()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getInitBoard()
|
function BattleControllerStage:getInitBoard()
|
||||||
if not self.boradList then
|
if not self.boradList then
|
||||||
self.boradList = {}
|
self.boradList = {}
|
||||||
self.fixedRandomGrid = {}
|
self.fixedRandomGrid = {}
|
||||||
self.mysteryBoxIndexMap = {}
|
self.mysteryBoxIndexMap = {}
|
||||||
|
|
||||||
local config = self:getChapterConfig()[self.chapterId]
|
local config = self:getChapterConfig()[self.chapterId]
|
||||||
local boardCfg = self:getBoardConfig()
|
local boardCfg = self:getBoardConfig()
|
||||||
for idx, boardId in ipairs(config.board) do
|
for idx, boardId in ipairs(config.board) do
|
||||||
local cfg = boardCfg[boardId]
|
local cfg = boardCfg[boardId]
|
||||||
if cfg then
|
if cfg then
|
||||||
local tab = {
|
local tab = {
|
||||||
board = GFunc.getTable(cfg.board),
|
board = GFunc.getTable(cfg.board),
|
||||||
mysteryBoard = GFunc.getTable(cfg.mystery_box_board),
|
mysteryBoard = GFunc.getTable(cfg.mystery_box_board),
|
||||||
@ -46,92 +47,144 @@ function BattleControllerStage:getInitBoard()
|
|||||||
if config.mystery_box and config.mystery_box_reward and config.mystery_box[idx] and math.random(1, GConst.BattleConst.DEFAULT_FACTOR) <= config.mystery_box[idx] then
|
if config.mystery_box and config.mystery_box_reward and config.mystery_box[idx] and math.random(1, GConst.BattleConst.DEFAULT_FACTOR) <= config.mystery_box[idx] then
|
||||||
self.mysteryBoxIndexMap[idx] = GFunc.randomDrop(config.mystery_box_reward)
|
self.mysteryBoxIndexMap[idx] = GFunc.randomDrop(config.mystery_box_reward)
|
||||||
end
|
end
|
||||||
table.insert(self.boradList, tab)
|
table.insert(self.boradList, tab)
|
||||||
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
|
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if config.mystery_box and config.mystery_box_reward then
|
-- if config.mystery_box and config.mystery_box_reward then
|
||||||
-- for i, index in ipairs(config.mystery_box) do
|
-- for i, index in ipairs(config.mystery_box) do
|
||||||
-- if not DataManager.ChapterData:getChapterMysteryBoxIsGot(self.chapterId, i) then
|
-- if not DataManager.ChapterData:getChapterMysteryBoxIsGot(self.chapterId, i) then
|
||||||
-- self.mysteryBoxIndexMap[index] = config.mystery_box_reward[i]
|
-- self.mysteryBoxIndexMap[index] = config.mystery_box_reward[i]
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getFixedRogueSkill()
|
function BattleControllerStage:getFixedRogueSkill()
|
||||||
if not self.fixedRogueSkill then
|
if not self.fixedRogueSkill then
|
||||||
local config = ConfigManager:getConfig("chapter")[self.chapterId]
|
local config = ConfigManager:getConfig("chapter")[self.chapterId]
|
||||||
if not DataManager.ChapterData:getChapterPassed(self.chapterId) and config.involved_skill then
|
if not DataManager.ChapterData:getChapterPassed(self.chapterId) and config.involved_skill then
|
||||||
self.fixedRogueSkill = GFunc.getTable(config.involved_skill)
|
self.fixedRogueSkill = GFunc.getTable(config.involved_skill)
|
||||||
else
|
else
|
||||||
self.fixedRogueSkill = {}
|
self.fixedRogueSkill = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.fixedRogueSkill
|
return self.fixedRogueSkill
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:controllBattleEnd()
|
function BattleControllerStage:controllBattleEnd()
|
||||||
self.combatReport = {
|
self.combatReport = {
|
||||||
battleType = GConst.BattleConst.BATTLE_TYPE.STAGE,
|
battleType = GConst.BattleConst.BATTLE_TYPE.STAGE,
|
||||||
wave = self:getWaveIndex(),
|
wave = self:getWaveIndex(),
|
||||||
victory = self.victory,
|
victory = self.victory,
|
||||||
}
|
}
|
||||||
local atkReport = {}
|
local atkReport = {}
|
||||||
local teamEntity = self.battleData:getAtkTeam()
|
local teamEntity = self.battleData:getAtkTeam()
|
||||||
local members = teamEntity:getAllMembers()
|
local members = teamEntity:getAllMembers()
|
||||||
for k, v in pairs(members) do
|
for k, v in pairs(members) do
|
||||||
local report = {
|
local report = {
|
||||||
heroId = v:getId(),
|
heroId = v:getId(),
|
||||||
dmg = v:getDamageCount(),
|
dmg = v:getDamageCount(),
|
||||||
}
|
}
|
||||||
table.insert(atkReport, report)
|
table.insert(atkReport, report)
|
||||||
end
|
end
|
||||||
self.combatReport.atkReport = atkReport
|
self.combatReport.atkReport = atkReport
|
||||||
if not self.victory then
|
if not self.victory then
|
||||||
self.combatReport.wave = self.combatReport.wave - 1
|
self.combatReport.wave = self.combatReport.wave - 1
|
||||||
end
|
end
|
||||||
BIReport:postFightHeroReport(self.combatReport.battleType, atkReport)
|
BIReport:postFightHeroReport(self.combatReport.battleType, atkReport)
|
||||||
ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress, self.doubleMystery)
|
ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress, self.doubleMystery)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:postWaveOver(atkDead, isQuit)
|
function BattleControllerStage:postWaveOver(atkDead, isQuit)
|
||||||
local deathType = BIReport.FIGHT_DEATH_TYPE.SURVIVE
|
local deathType = BIReport.FIGHT_DEATH_TYPE.SURVIVE
|
||||||
local waveEndType = BIReport.FIGHT_WAVE_END_TYPE.WIN
|
local waveEndType = BIReport.FIGHT_WAVE_END_TYPE.WIN
|
||||||
if atkDead then
|
if atkDead then
|
||||||
if self.isBossWave then
|
if self.isBossWave then
|
||||||
deathType = BIReport.FIGHT_DEATH_TYPE.BOSS_FAIL
|
deathType = BIReport.FIGHT_DEATH_TYPE.BOSS_FAIL
|
||||||
else
|
else
|
||||||
deathType = BIReport.FIGHT_DEATH_TYPE.NORMAL_FAIL
|
deathType = BIReport.FIGHT_DEATH_TYPE.NORMAL_FAIL
|
||||||
end
|
end
|
||||||
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.FAIL
|
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.FAIL
|
||||||
end
|
end
|
||||||
|
|
||||||
if isQuit then
|
if isQuit then
|
||||||
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
|
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
|
||||||
end
|
end
|
||||||
|
|
||||||
local duration = self.waveDurationTime
|
local duration = self.waveDurationTime
|
||||||
local totalTime = self.totalDurationTime
|
local totalTime = self.totalDurationTime
|
||||||
local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId)
|
local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId)
|
||||||
local isFirstWin = false
|
local isFirstWin = false
|
||||||
if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then
|
if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then
|
||||||
isFirstWin = true
|
isFirstWin = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
|
local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
|
||||||
|
|
||||||
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
|
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerStage:postFightStart()
|
function BattleControllerStage:postFightStart()
|
||||||
local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
|
local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
|
||||||
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