Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-19 18:39:52 +08:00
commit afe62c49bc
5 changed files with 51 additions and 18 deletions

View File

@ -68,6 +68,9 @@ function BattleController:findNextDefUnit()
self:enterRefreshBoard() self:enterRefreshBoard()
end end
function BattleController:onDefDead()
end
function BattleController:tick(dt) function BattleController:tick(dt)
end end
@ -295,9 +298,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.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() self:generateBoard(true)
self:generateBoard()
return
end end
self.defTeam:prepare() self.defTeam:prepare()
@ -356,6 +357,7 @@ function BattleController:enterAtkStepOver()
if self.waveIndex >= self.maxWaveIndex then if self.waveIndex >= self.maxWaveIndex then
self:enterRoundEnd() self:enterRoundEnd()
else else
self:onDefDead()
self:enterRefreshBoard() self:enterRefreshBoard()
end end
return return
@ -391,8 +393,11 @@ function BattleController:enterDefStepOver()
if not defTeam or defTeam:getIsDead() then -- 怪物死了, 直接进入刷新逻辑 if not defTeam or defTeam:getIsDead() then -- 怪物死了, 直接进入刷新逻辑
if self.waveIndex >= self.maxWaveIndex then if self.waveIndex >= self.maxWaveIndex then
self:enterRoundEnd() self:enterRoundEnd()
return else
self:onDefDead()
self:enterRefreshBoard()
end end
return
end end
self:enterRefreshBoard() self:enterRefreshBoard()
@ -424,11 +429,15 @@ function BattleController:enterRoundEnd()
self:onRoundEnd() self:onRoundEnd()
end end
function BattleController:onRoundEnd() function BattleController:onRoundEnd(toNextWave)
if self.battleData:useAddlvCount() then if self.battleData:useAddlvCount() then
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList()) ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
else else
self:enterRoundBegin() if toNextWave then
self:enterNextWave()
else
self:enterRoundBegin()
end
end end
end end
@ -547,7 +556,7 @@ function BattleController:onTouchEvent(eventType, posId)
return return
end end
local snapshot = self.battleData:removeGridSequence(sequence[1].posId) local snapshot = self.battleData:getFirstSequenceSnapshot()
if snapshot then -- 如果有快照,则恢复一次 if snapshot then -- 如果有快照,则恢复一次
for posId, info in pairs(snapshot) do for posId, info in pairs(snapshot) do
local entity = self.battleData:getGridEntity(posId) local entity = self.battleData:getGridEntity(posId)
@ -869,7 +878,7 @@ function BattleController:exeInstructions(callback)
end end
end end
function BattleController:generateBoard() function BattleController:generateBoard(isFirst)
local boardList, _ = self:getInitBoard() local boardList, _ = self:getInitBoard()
if self.curBoardIndex and self.curBoardIndex >= #boardList then if self.curBoardIndex and self.curBoardIndex >= #boardList then
return return
@ -885,8 +894,8 @@ function BattleController:generateBoard()
self.battleData:refreshBoard(board) self.battleData:refreshBoard(board)
self.battleUI:initGridCell() self.battleUI:initGridCell()
end, function() end, function()
self:enterRoundBegin() -- self:enterRoundBegin()
end) end, isFirst)
end end
function BattleController:putBoardCacheSkill(callback) function BattleController:putBoardCacheSkill(callback)

View File

@ -49,13 +49,11 @@ function BattleControllerStage:_stageGenerateNextMonster()
self.atkTeam:playRunAction() self.atkTeam:playRunAction()
monsterComp:playEnterBattlefield(true, function() monsterComp:playEnterBattlefield(true, function()
self.atkTeam:stopRunAction() self.atkTeam:stopRunAction()
self:enterNextWave() self:onRoundEnd(true)
self:onRoundEnd()
end) end)
else else
monsterComp:playEnterBattlefield(false, function() monsterComp:playEnterBattlefield(false, function()
self:enterNextWave() self:onRoundEnd(true)
self:onRoundEnd()
end) end)
end end
end) end)
@ -108,9 +106,11 @@ function BattleControllerStage:getNotInvolvedSkills()
end end
function BattleControllerStage:findNextDefUnit() function BattleControllerStage:findNextDefUnit()
self.defTeam:getMainUnit():playDead(function() self:_stageGenerateNextMonster()
self:_stageGenerateNextMonster() end
end)
function BattleControllerStage:onDefDead()
self.defTeam:getMainUnit():playDead()
end end
function BattleControllerStage:controllBattleEnd() function BattleControllerStage:controllBattleEnd()

View File

@ -26,6 +26,7 @@ end
function BattleSkillSelectUI:_display() function BattleSkillSelectUI:_display()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
uiMap["battle_skill_select_ui.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3)) uiMap["battle_skill_select_ui.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3))
uiMap["battle_skill_select_ui.bg_1"]:setVisible(true)
self:refreshRogueSkill() self:refreshRogueSkill()
end end
@ -43,11 +44,14 @@ function BattleSkillSelectUI:_addListeners()
end) end)
self.canvasGroup = uiMap["battle_skill_select_ui.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) self.canvasGroup = uiMap["battle_skill_select_ui.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
self.bg = uiMap["battle_skill_select_ui.bg_1"]
uiMap["battle_skill_select_ui.look_btn"]:addTouchListener(function(eventType, x, y) uiMap["battle_skill_select_ui.look_btn"]:addTouchListener(function(eventType, x, y)
if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then
self.canvasGroup.alpha = 0.3 self.canvasGroup.alpha = 0.3
self.bg:setVisible(false)
else else
self.canvasGroup.alpha = 1 self.canvasGroup.alpha = 1
self.bg:setVisible(true)
end end
end) end)
end end

View File

@ -309,12 +309,23 @@ function BattleUI:onInitGridCellOver()
end end
end end
function BattleUI:switchBoard(downCallback, callback) function BattleUI:switchBoard(downCallback, callback, isFirst)
if self.switchBoardSeq then if self.switchBoardSeq then
self.switchBoardSeq:Kill() self.switchBoardSeq:Kill()
self.switchBoardSeq = nil self.switchBoardSeq = nil
end end
if isFirst then
if downCallback then
downCallback()
end
if callback then
callback()
end
self.boardNode:setAnchoredPositionY(BOARD_POS_UP.y)
return
end
self.switchBoardSeq = self.root:createBindTweenSequence() self.switchBoardSeq = self.root:createBindTweenSequence()
self.switchBoardSeq:Append(self.boardNode:getTransform():DOAnchorPos(BOARD_POS_DOWN, 0.5)) self.switchBoardSeq:Append(self.boardNode:getTransform():DOAnchorPos(BOARD_POS_DOWN, 0.5))
self.switchBoardSeq:AppendCallback(function() self.switchBoardSeq:AppendCallback(function()

View File

@ -213,6 +213,15 @@ function BattleData:removeGridSequence(posId)
return snapshot return snapshot
end end
function BattleData:getFirstSequenceSnapshot(posId)
if not self.gridSequence[1] then
return
end
local snapshot = self.gridSequence[1].snapshot
return snapshot
end
function BattleData:cacheSkillInfluenceGrids(grids) function BattleData:cacheSkillInfluenceGrids(grids)
if not self.skillInfluenceGrids then if not self.skillInfluenceGrids then
self.skillInfluenceGrids = {} self.skillInfluenceGrids = {}