Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
a7a189bcbb
@ -264,6 +264,7 @@ function BattleController:init(params)
|
|||||||
self.waveRoundCount = {}
|
self.waveRoundCount = {}
|
||||||
self.lastRoundBreakedGridType = {}
|
self.lastRoundBreakedGridType = {}
|
||||||
self.waitingFillCount = 0
|
self.waitingFillCount = 0
|
||||||
|
self.needWaitingBoardOver = nil
|
||||||
|
|
||||||
self.chapterId = self:getChapterId()
|
self.chapterId = self:getChapterId()
|
||||||
self.waveIndex = 0
|
self.waveIndex = 0
|
||||||
@ -530,6 +531,7 @@ function BattleController:enterNextWave()
|
|||||||
self.battleUI:refreshWave(self.waveIndex)
|
self.battleUI:refreshWave(self.waveIndex)
|
||||||
end
|
end
|
||||||
if self.waveIndex == 1 then -- 第一波
|
if self.waveIndex == 1 then -- 第一波
|
||||||
|
self.needWaitingBoardOver = true
|
||||||
self:generateBoard(true)
|
self:generateBoard(true)
|
||||||
else
|
else
|
||||||
-- 上报关卡结束
|
-- 上报关卡结束
|
||||||
@ -541,10 +543,13 @@ function BattleController:enterNextWave()
|
|||||||
|
|
||||||
self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss()
|
self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss()
|
||||||
self:postFightStart()
|
self:postFightStart()
|
||||||
self:enterRoundBegin()
|
if not self.needWaitingBoardOver then
|
||||||
|
self:enterRoundBegin()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:enterRoundBegin()
|
function BattleController:enterRoundBegin()
|
||||||
|
self.needWaitingBoardOver = nil
|
||||||
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1
|
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_BEGIN
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_BEGIN
|
||||||
self:takeGridEffect()
|
self:takeGridEffect()
|
||||||
@ -1036,7 +1041,7 @@ function BattleController:calculateCurElimination(onlyCheck)
|
|||||||
|
|
||||||
local randomPosList, influenceElementTypeMap
|
local randomPosList, influenceElementTypeMap
|
||||||
for i, info in ipairs(self.aniSequence) do
|
for i, info in ipairs(self.aniSequence) do
|
||||||
if info.isSkill then
|
if info.isSkill and skillEntity then
|
||||||
randomPosList, influenceElementTypeMap = self:dealSkillElement(info.timeIdx + skillTime, self.breakedMap, self.sequenceMap, self.aniSequence, self.boomGridIds, onlyCheck)
|
randomPosList, influenceElementTypeMap = self:dealSkillElement(info.timeIdx + skillTime, self.breakedMap, self.sequenceMap, self.aniSequence, self.boomGridIds, onlyCheck)
|
||||||
local aniUnit = self.aniSequence[i]
|
local aniUnit = self.aniSequence[i]
|
||||||
if not BattleConst.NO_EFFECT_GRID_SKILL_TYPE[skillEntity:getSkillType()] then
|
if not BattleConst.NO_EFFECT_GRID_SKILL_TYPE[skillEntity:getSkillType()] then
|
||||||
@ -1334,15 +1339,18 @@ end
|
|||||||
function BattleController:generateBoard(isFirst)
|
function BattleController:generateBoard(isFirst)
|
||||||
local boardList, _, mysteryBoxIndexMap = self:getInitBoard()
|
local boardList, _, mysteryBoxIndexMap = self:getInitBoard()
|
||||||
if self.curBoardIndex and self.curBoardIndex >= #boardList then
|
if self.curBoardIndex and self.curBoardIndex >= #boardList then
|
||||||
|
self.needWaitingBoardOver = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.battleUI then
|
if not self.battleUI then
|
||||||
|
self.needWaitingBoardOver = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self.curBoardIndex = (self.curBoardIndex or 0) + 1
|
self.curBoardIndex = (self.curBoardIndex or 0) + 1
|
||||||
if not boardList[self.curBoardIndex] then -- 容错
|
if not boardList[self.curBoardIndex] then -- 容错
|
||||||
|
self.needWaitingBoardOver = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local board = boardList[self.curBoardIndex].board
|
local board = boardList[self.curBoardIndex].board
|
||||||
@ -1352,7 +1360,9 @@ function BattleController:generateBoard(isFirst)
|
|||||||
end
|
end
|
||||||
self.battleUI:switchBoard(function()
|
self.battleUI:switchBoard(function()
|
||||||
self.battleData:refreshBoard(board, self:getBlockIcon())
|
self.battleData:refreshBoard(board, self:getBlockIcon())
|
||||||
self.battleUI:initGridCell()
|
self.battleUI:initGridCell(function()
|
||||||
|
self.needWaitingBoardOver = false
|
||||||
|
end)
|
||||||
end, function()
|
end, function()
|
||||||
-- self:enterRoundBegin()
|
-- self:enterRoundBegin()
|
||||||
end, isFirst)
|
end, isFirst)
|
||||||
@ -1389,11 +1399,21 @@ function BattleController:popBoardCacheSkill(callback)
|
|||||||
if self.popSkillPosIdList[1] then
|
if self.popSkillPosIdList[1] then
|
||||||
self.popNewSkillId[index] = info
|
self.popNewSkillId[index] = info
|
||||||
self.popNewSkillId[index].posId = table.remove(self.popSkillPosIdList)
|
self.popNewSkillId[index].posId = table.remove(self.popSkillPosIdList)
|
||||||
|
self:setGridSkillId(self.popNewSkillId[index].posId, info.skillId, true)
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.battleUI:cacheSkillAni(self.popNewSkillId, true, callback)
|
|
||||||
|
self.battleUI:cacheSkillAni(self.popNewSkillId, true, function()
|
||||||
|
for index, info in ipairs(self.popNewSkillId) do
|
||||||
|
self.battleData:setGridDirty(info.posId)
|
||||||
|
end
|
||||||
|
|
||||||
|
if callback then
|
||||||
|
callback()
|
||||||
|
end
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
if callback then
|
if callback then
|
||||||
callback()
|
callback()
|
||||||
@ -1436,13 +1456,13 @@ function BattleController:generateSkill(callback)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:setGridSkillId(posId, skillId)
|
function BattleController:setGridSkillId(posId, skillId, noDirty)
|
||||||
local entity = self.battleData:getGridEntity(posId)
|
local entity = self.battleData:getGridEntity(posId)
|
||||||
if entity then
|
if entity then
|
||||||
entity:setSkilId(skillId)
|
entity:setSkilId(skillId, noDirty)
|
||||||
local skillEntity = self.battleData:getSkillEntityBySkillId(skillId)
|
local skillEntity = self.battleData:getSkillEntityBySkillId(skillId)
|
||||||
if skillEntity and entity:getElementType() ~= skillEntity:getPosition() then
|
if skillEntity and entity:getElementType() ~= skillEntity:getPosition() then
|
||||||
entity:setElementType(skillEntity:getPosition())
|
entity:setElementType(skillEntity:getPosition(), noDirty)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -2498,6 +2518,9 @@ function BattleController:_tick(dt)
|
|||||||
if self.isPause then
|
if self.isPause then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if self.needWaitingBoardOver == false then
|
||||||
|
self:enterRoundBegin()
|
||||||
|
end
|
||||||
if self.waitingFillCount <= 0 and self.isWaitingFill and self.isRoundBeginCheck then
|
if self.waitingFillCount <= 0 and self.isWaitingFill and self.isRoundBeginCheck then
|
||||||
self:fillBoard(self.isRoundBeginCheck)
|
self:fillBoard(self.isRoundBeginCheck)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -64,12 +64,11 @@ local function _crossSpreadNotBreak(entity, gridEntities, battleController, only
|
|||||||
for _, posId in ipairs(tempList) do
|
for _, posId in ipairs(tempList) do
|
||||||
local gridEntity = gridEntities[posId]
|
local gridEntity = gridEntities[posId]
|
||||||
if gridEntity:isEmptyIdle() then
|
if gridEntity:isEmptyIdle() then
|
||||||
|
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY, true)
|
||||||
if battleController.battleUI and entity:getEffectSfx() then
|
if battleController.battleUI and entity:getEffectSfx() then
|
||||||
battleController.battleUI:showGridEffectSfx(posId, entity:getEffectSfx(), function()
|
battleController.battleUI:showGridEffectSfx(posId, entity:getEffectSfx(), function()
|
||||||
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY)
|
battleController.battleData:setGridDirty(posId)
|
||||||
end)
|
end)
|
||||||
else
|
|
||||||
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY)
|
|
||||||
end
|
end
|
||||||
succ = true
|
succ = true
|
||||||
break
|
break
|
||||||
|
|||||||
@ -778,7 +778,8 @@ function BattleUI:shakeScreen(shakeType, duration)
|
|||||||
self.shakeTween.timeScale = DataManager.BattleData:getTimeScale()
|
self.shakeTween.timeScale = DataManager.BattleData:getTimeScale()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:initGridCell()
|
function BattleUI:initGridCell(callback)
|
||||||
|
self.onInitGridCellOverCallback = callback
|
||||||
if self.root.gridCells then
|
if self.root.gridCells then
|
||||||
self.gridCells = self.root.gridCells
|
self.gridCells = self.root.gridCells
|
||||||
self.gridInitOver = true
|
self.gridInitOver = true
|
||||||
@ -831,6 +832,12 @@ function BattleUI:onInitGridCellOver()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local callback = self.onInitGridCellOverCallback
|
||||||
|
self.onInitGridCellOverCallback = nil
|
||||||
|
if callback then
|
||||||
|
callback()
|
||||||
|
end
|
||||||
|
|
||||||
---- 检查引导
|
---- 检查引导
|
||||||
ModuleManager.TutorialManager:checkFuncTutorial(GConst.TutorialConst.START_TUTORIAL)
|
ModuleManager.TutorialManager:checkFuncTutorial(GConst.TutorialConst.START_TUTORIAL)
|
||||||
end
|
end
|
||||||
@ -1551,11 +1558,6 @@ function BattleUI:doCachePopAni(skillInfo, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.cacheSkillAniSeq:AppendCallback(function()
|
self.cacheSkillAniSeq:AppendCallback(function()
|
||||||
for index, info in ipairs(skillInfo) do
|
|
||||||
if self.battleController then
|
|
||||||
self.battleController:setGridSkillId(info.posId, info.skillId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
self.boardCacheNode:setVisible(false)
|
self.boardCacheNode:setVisible(false)
|
||||||
self:enableUITouch()
|
self:enableUITouch()
|
||||||
if callback then
|
if callback then
|
||||||
|
|||||||
@ -334,15 +334,23 @@ function BattleData:setInfoBySnapshop(posId, snapInfo)
|
|||||||
entity:setInfoBySnapshop(snapInfo)
|
entity:setInfoBySnapshop(snapInfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleData:setGridType(posId, gridType)
|
function BattleData:setGridType(posId, gridType, noDirty)
|
||||||
local entity = self.gridEntities[posId]
|
local entity = self.gridEntities[posId]
|
||||||
if not entity then
|
if not entity then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
entity:setGridType(gridType)
|
entity:setGridType(gridType, noDirty)
|
||||||
entity:determineIdleStatus()
|
entity:determineIdleStatus()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleData:setGridDirty(posId)
|
||||||
|
local entity = self.gridEntities[posId]
|
||||||
|
if not entity then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
entity:setDirty()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleData:lockAllSkillGrid(lock)
|
function BattleData:lockAllSkillGrid(lock)
|
||||||
if not self.gridEntities then
|
if not self.gridEntities then
|
||||||
return
|
return
|
||||||
|
|||||||
@ -191,20 +191,24 @@ function BattleGridEntity:clearPath()
|
|||||||
self.pathList = {}
|
self.pathList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:setGridType(gridType)
|
function BattleGridEntity:setGridType(gridType, noDirty)
|
||||||
if self.gridType ~= gridType then
|
if self.gridType ~= gridType then
|
||||||
self.gridType = gridType
|
self.gridType = gridType
|
||||||
self.breakCount = 0
|
self.breakCount = 0
|
||||||
self:setDirty()
|
if not noDirty then
|
||||||
|
self:setDirty()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:setElementType(elementType)
|
function BattleGridEntity:setElementType(elementType, noDirty)
|
||||||
self.elementType = elementType
|
self.elementType = elementType
|
||||||
if DataManager.BattleData:getCacheLockedElement(self.elementType) then
|
if DataManager.BattleData:getCacheLockedElement(self.elementType) then
|
||||||
self:setGridType(BattleConst.GRID_TYPE.LOCK)
|
self:setGridType(BattleConst.GRID_TYPE.LOCK)
|
||||||
end
|
end
|
||||||
self:setDirty()
|
if not noDirty then
|
||||||
|
self:setDirty()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getSkillId()
|
function BattleGridEntity:getSkillId()
|
||||||
@ -214,10 +218,12 @@ function BattleGridEntity:getSkillId()
|
|||||||
return self.skillId
|
return self.skillId
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:setSkilId(skillId)
|
function BattleGridEntity:setSkilId(skillId, noDirty)
|
||||||
self.skillId = skillId
|
self.skillId = skillId
|
||||||
self.linkSkillCount = 0
|
self.linkSkillCount = 0
|
||||||
self:setDirty()
|
if not noDirty then
|
||||||
|
self:setDirty()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:canChangeInfo()
|
function BattleGridEntity:canChangeInfo()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user