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

View File

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

View File

@ -26,6 +26,7 @@ end
function BattleSkillSelectUI:_display()
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.bg_1"]:setVisible(true)
self:refreshRogueSkill()
end
@ -43,11 +44,14 @@ function BattleSkillSelectUI:_addListeners()
end)
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)
if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then
self.canvasGroup.alpha = 0.3
self.bg:setVisible(false)
else
self.canvasGroup.alpha = 1
self.bg:setVisible(true)
end
end)
end

View File

@ -309,12 +309,23 @@ function BattleUI:onInitGridCellOver()
end
end
function BattleUI:switchBoard(downCallback, callback)
function BattleUI:switchBoard(downCallback, callback, isFirst)
if self.switchBoardSeq then
self.switchBoardSeq:Kill()
self.switchBoardSeq = nil
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:Append(self.boardNode:getTransform():DOAnchorPos(BOARD_POS_DOWN, 0.5))
self.switchBoardSeq:AppendCallback(function()

View File

@ -213,6 +213,15 @@ function BattleData:removeGridSequence(posId)
return snapshot
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)
if not self.skillInfluenceGrids then
self.skillInfluenceGrids = {}