Merge branch 'new_arena' into arena
This commit is contained in:
commit
2d9c5b02b8
@ -1109,10 +1109,7 @@ function BattleBaseController:onLinkOver()
|
|||||||
self.battleUI:disableUITouch()
|
self.battleUI:disableUITouch()
|
||||||
self.battleUI:eliminationAni(aniSequence, effectGridMap, function()
|
self.battleUI:eliminationAni(aniSequence, effectGridMap, function()
|
||||||
self:enterRefreshBoard(nil, function()
|
self:enterRefreshBoard(nil, function()
|
||||||
self.battleUI:enterHideBoardAni(function()
|
self:onLinkOverDone(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
|
||||||
self:enterBattleStep()
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
end, self.curActionSide)
|
end, self.curActionSide)
|
||||||
|
|
||||||
@ -1123,6 +1120,13 @@ function BattleBaseController:onLinkOver()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleBaseController:onLinkOverDone(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
|
self.battleUI:enterHideBoardAni(function()
|
||||||
|
self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
|
self:enterBattleStep()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
function BattleBaseController:calculateCurElimination(onlyCheck)
|
function BattleBaseController:calculateCurElimination(onlyCheck)
|
||||||
local sequence = self.battleData:getGridSequence()
|
local sequence = self.battleData:getGridSequence()
|
||||||
local skillId = self.battleData:getSequenceHadSkill()
|
local skillId = self.battleData:getSequenceHadSkill()
|
||||||
|
|||||||
@ -118,52 +118,76 @@ function BattleControllerPVP:onLoadComplete(...)
|
|||||||
BattleBaseController.onLoadComplete(self, ...)
|
BattleBaseController.onLoadComplete(self, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerPVP:enterBattleStep()
|
function BattleControllerPVP:onLinkOverDone(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_TEAM_ACTION
|
if linkElementType then
|
||||||
self.battleTeamActionList = table.clearOrCreate(self.battleTeamActionList)
|
self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
|
local instructions = self.instructions
|
||||||
local action = function()
|
local side = self.curActionSide
|
||||||
if self.curActionSide == SIDE_ATK then
|
self.instructions = nil
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ATK_STEP
|
local action = function()
|
||||||
else
|
if side == SIDE_ATK then
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ATK_STEP
|
||||||
|
else
|
||||||
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP
|
||||||
|
end
|
||||||
|
self.instructions = instructions
|
||||||
|
self:exeInstructions(function()
|
||||||
|
self:enterNextTeamAction()
|
||||||
|
end, side)
|
||||||
end
|
end
|
||||||
self:exeInstructions(function()
|
self:addTeamActionList(action, #self.battleTeamActionList + 1)
|
||||||
self:enterNextTeamAction()
|
end
|
||||||
end, self.curActionSide)
|
|
||||||
|
local nextSide = self:getCurActionOtherSide()
|
||||||
|
local sideCount = self:getSideActionCount(nextSide)
|
||||||
|
if sideCount > 0 then
|
||||||
|
self:setCurActionSide(nextSide)
|
||||||
|
self.battleUI:enterShowBoardAni(function()
|
||||||
|
self:enterElimination()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
self.battleUI:enterHideBoardAni(function()
|
||||||
|
self:enterBattleStep()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
self:addTeamActionList(action, 1)
|
|
||||||
self:enterNextTeamAction()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerPVP:enterNextTeamAction()
|
function BattleControllerPVP:enterElimination(needDelay)
|
||||||
self.atkTeam:onActionOver()
|
if self.showSelectSkillSid then
|
||||||
self.defTeam:onActionOver()
|
ModuleManager.BattleManager:unscheduleGlobal(self.showSelectSkillSid)
|
||||||
|
self.showSelectSkillSid = nil
|
||||||
|
end
|
||||||
|
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_TEAM_ACTION_OVER
|
if self.battleData:useAddlvCount() then
|
||||||
self:hideCombo()
|
self:tryShowSelectSkillComp(needDelay)
|
||||||
self:hideCounterAttack()
|
|
||||||
|
|
||||||
if self:checkTeamIsDead(function() self:enterRoundEnd() end) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.battleTeamActionList or not self.battleTeamActionList[1] then
|
self.battleUI:hideAllBoardSfxs()
|
||||||
local nextSide = self:getCurActionOtherSide()
|
|
||||||
local sideCount = self:getSideActionCount(nextSide)
|
-- 检查棋盘
|
||||||
if sideCount > 0 then
|
local find, pathList = self:findAttention()
|
||||||
self:setCurActionSide(nextSide)
|
if not find then -- 如果没找到,就要打乱棋盘
|
||||||
self.battleUI:enterShowBoardAni(function()
|
self:shuffleBoard(function()
|
||||||
self:enterElimination()
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
|
||||||
end)
|
if self:skipEliminationAction() then
|
||||||
else
|
return
|
||||||
self:enterRoundEnd()
|
end
|
||||||
|
self:checkDefBoard()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
self.attentionList = pathList
|
||||||
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
|
||||||
|
if self:skipEliminationAction() then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
return
|
self:checkDefBoard()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local action = table.remove(self.battleTeamActionList, 1)
|
function BattleControllerPVP:enterBattleStep()
|
||||||
action()
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_TEAM_ACTION
|
||||||
|
self:enterNextTeamAction()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerPVP:setCurActionSide(side)
|
function BattleControllerPVP:setCurActionSide(side)
|
||||||
@ -209,19 +233,7 @@ function BattleControllerPVP:onFillBoardOver(...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerPVP:enterElimination(needDelay)
|
function BattleControllerPVP:skipEliminationAction()
|
||||||
if self.showSelectSkillSid then
|
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.showSelectSkillSid)
|
|
||||||
self.showSelectSkillSid = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.battleData:useAddlvCount() then
|
|
||||||
self:tryShowSelectSkillComp(needDelay)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
self.battleUI:hideAllBoardSfxs()
|
|
||||||
|
|
||||||
local curActionUnitComp = self:getCurActionUnitComp()
|
local curActionUnitComp = self:getCurActionUnitComp()
|
||||||
if curActionUnitComp:getIsLimit() then
|
if curActionUnitComp:getIsLimit() then
|
||||||
if curActionUnitComp:getIsFrozen() then
|
if curActionUnitComp:getIsFrozen() then
|
||||||
@ -231,22 +243,10 @@ function BattleControllerPVP:enterElimination(needDelay)
|
|||||||
elseif curActionUnitComp:getIsStun() then
|
elseif curActionUnitComp:getIsStun() then
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLE_DESC_3))
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLE_DESC_3))
|
||||||
end
|
end
|
||||||
self:enterNextTeamAction()
|
self:onLinkOverDone()
|
||||||
return
|
return true
|
||||||
end
|
|
||||||
|
|
||||||
-- 检查棋盘
|
|
||||||
local find, pathList = self:findAttention()
|
|
||||||
if not find then -- 如果没找到,就要打乱棋盘
|
|
||||||
self:shuffleBoard(function()
|
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
|
|
||||||
self:checkDefBoard()
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
self.attentionList = pathList
|
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
|
|
||||||
self:checkDefBoard()
|
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerPVP:checkDefBoard()
|
function BattleControllerPVP:checkDefBoard()
|
||||||
@ -296,7 +296,15 @@ function BattleControllerPVP:enterRoundBegin(...)
|
|||||||
self:battleEnd()
|
self:battleEnd()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
BattleBaseController.enterRoundBegin(self, ...)
|
self:resetSideActionCount()
|
||||||
|
self:setCurActionSide(SIDE_ATK)
|
||||||
|
self.needWaitingBoardOver = nil
|
||||||
|
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1
|
||||||
|
self.battleUI:enterShowBoardAni(function()
|
||||||
|
self:takeGridEffect()
|
||||||
|
self:enterEliminationBegin()
|
||||||
|
end)
|
||||||
|
self.battleTeamActionList = table.clearOrCreate(self.battleTeamActionList)
|
||||||
self:refreshWave()
|
self:refreshWave()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1154,7 +1154,7 @@ function BattleBaseUI:onInitGridCellOver()
|
|||||||
cell:refresh(entity, elementType)
|
cell:refresh(entity, elementType)
|
||||||
end)
|
end)
|
||||||
local pos = entity:getPos()
|
local pos = entity:getPos()
|
||||||
cell:getBaseObject():setParent(self.gridNode, false)
|
cell:getBaseObject():setParent(self.gridNode, true)
|
||||||
cell:getBaseObject():setAnchoredPosition(pos.x, pos.y)
|
cell:getBaseObject():setAnchoredPosition(pos.x, pos.y)
|
||||||
entity:setCell(cell)
|
entity:setCell(cell)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -11,6 +11,7 @@ function BattleUIPVP:initBaseInfo()
|
|||||||
self.boardNode = uiMap["battle_ui_pvp.board_root_node"]
|
self.boardNode = uiMap["battle_ui_pvp.board_root_node"]
|
||||||
self.boardCenterNode = uiMap["battle_ui_pvp.board_root_node.board_center_node"]
|
self.boardCenterNode = uiMap["battle_ui_pvp.board_root_node.board_center_node"]
|
||||||
self.boardNode:setAnchoredPositionX(DEFAULT_X)
|
self.boardNode:setAnchoredPositionX(DEFAULT_X)
|
||||||
|
self.boardNode:setVisible(true)
|
||||||
self.boardMask2D = self.gridNode:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_RECT_MASK_2D)
|
self.boardMask2D = self.gridNode:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_RECT_MASK_2D)
|
||||||
self.boardMask = uiMap["battle_ui_pvp.board_root_node.board_mask"]
|
self.boardMask = uiMap["battle_ui_pvp.board_root_node.board_mask"]
|
||||||
self.boardMask:setVisible(false)
|
self.boardMask:setVisible(false)
|
||||||
@ -27,6 +28,8 @@ function BattleUIPVP:initBaseInfo()
|
|||||||
self.atkBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.grid_node.board_atk"]
|
self.atkBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.grid_node.board_atk"]
|
||||||
self.defBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.grid_node.board_def"]
|
self.defBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.grid_node.board_def"]
|
||||||
self.boardRootNodeMask = self.uiMap["battle_ui_pvp.board_root_node.mask"]
|
self.boardRootNodeMask = self.uiMap["battle_ui_pvp.board_root_node.mask"]
|
||||||
|
self.atkBoardImg:setAnchoredPositionX(0)
|
||||||
|
self.defBoardImg:setAnchoredPositionX(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUIPVP:initBg()
|
function BattleUIPVP:initBg()
|
||||||
@ -165,11 +168,6 @@ function BattleUIPVP:_addListeners()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUIPVP:getBoardRootNode()
|
|
||||||
local uiMap = self.root:genAllChildren()
|
|
||||||
return uiMap["battle_ui_pvp.board_root_node"]
|
|
||||||
end
|
|
||||||
|
|
||||||
function BattleUIPVP:refreshAvatar()
|
function BattleUIPVP:refreshAvatar()
|
||||||
-- 等数据
|
-- 等数据
|
||||||
local defInfo = self.battleController:getControllerParams().defInfo
|
local defInfo = self.battleController:getControllerParams().defInfo
|
||||||
@ -223,37 +221,37 @@ function BattleUIPVP:dealBoardMaskOnShowAni(isOver)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUIPVP:enterShowBoardAni(callback)
|
function BattleUIPVP:enterShowBoardAni(callback)
|
||||||
|
self:showMask(false)
|
||||||
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
||||||
if self.touchMask then
|
if self.touchMask then
|
||||||
self.touchMask:setVisible(not isAtkAction)
|
self.touchMask:setVisible(not isAtkAction)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:dealBoardMaskOnShowAni()
|
self:clearEnterShowBoardSeq()
|
||||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
self.boardNode:setVisible(true)
|
||||||
if entity:getCell() then
|
self.boardNode:setAnchoredPositionX(0)
|
||||||
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
||||||
local parent
|
self.enterShowBoardSeq:AppendCallback(function()
|
||||||
if isAtkAction then
|
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||||
parent = inCurRange and self.atkBoard or self.defBoard
|
if entity:getCell() then
|
||||||
else
|
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
||||||
parent = inCurRange and self.defBoard or self.atkBoard
|
local parent
|
||||||
end
|
if isAtkAction then
|
||||||
if parent then
|
parent = inCurRange and self.atkBoard or self.defBoard
|
||||||
entity:getCell():getBaseObject():setParent(parent, true)
|
else
|
||||||
|
parent = inCurRange and self.defBoard or self.atkBoard
|
||||||
|
end
|
||||||
|
if parent then
|
||||||
|
entity:getCell():getBaseObject():setParent(parent, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
|
|
||||||
self:clearEnterShowBoardSeq()
|
|
||||||
self:getBoardRootNode():setVisible(true)
|
|
||||||
self:getBoardRootNode():setAnchoredPositionX(0)
|
|
||||||
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
|
||||||
self.enterShowBoardSeq:Join(self.defBoardImg:getTransform():DOAnchorPosX(0, 0.5))
|
self.enterShowBoardSeq:Join(self.defBoardImg:getTransform():DOAnchorPosX(0, 0.5))
|
||||||
self.enterShowBoardSeq:Join(self.atkBoardImg:getTransform():DOAnchorPosX(0, 0.5))
|
self.enterShowBoardSeq:Join(self.atkBoardImg:getTransform():DOAnchorPosX(0, 0.5))
|
||||||
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0.9, 0.5))
|
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0.9, 0.5))
|
||||||
self.enterShowBoardSeq:AppendCallback(function()
|
self.enterShowBoardSeq:AppendCallback(function()
|
||||||
self:dealBoardMaskOnShowAni(true)
|
|
||||||
|
|
||||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||||
if entity:getCell() then
|
if entity:getCell() then
|
||||||
entity:getCell():getBaseObject():setParent(self.gridNode, true)
|
entity:getCell():getBaseObject():setParent(self.gridNode, true)
|
||||||
@ -274,33 +272,33 @@ end
|
|||||||
|
|
||||||
function BattleUIPVP:enterHideBoardAni(callback)
|
function BattleUIPVP:enterHideBoardAni(callback)
|
||||||
self:dealBoardMaskOnShowAni()
|
self:dealBoardMaskOnShowAni()
|
||||||
|
|
||||||
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
|
||||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
|
||||||
if entity:getCell() then
|
|
||||||
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
|
||||||
local parent
|
|
||||||
if isAtkAction then
|
|
||||||
parent = inCurRange and self.atkBoard or self.defBoard
|
|
||||||
else
|
|
||||||
parent = inCurRange and self.defBoard or self.atkBoard
|
|
||||||
end
|
|
||||||
if parent then
|
|
||||||
entity:getCell():getBaseObject():setParent(parent, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:clearEnterShowBoardSeq()
|
self:clearEnterShowBoardSeq()
|
||||||
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
||||||
self.enterShowBoardSeq:AppendInterval(0.5)
|
self.enterShowBoardSeq:AppendInterval(0.5)
|
||||||
|
self.enterShowBoardSeq:AppendCallback(function()
|
||||||
|
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
||||||
|
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||||
|
if entity:getCell() then
|
||||||
|
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
||||||
|
local parent
|
||||||
|
if isAtkAction then
|
||||||
|
parent = inCurRange and self.atkBoard or self.defBoard
|
||||||
|
else
|
||||||
|
parent = inCurRange and self.defBoard or self.atkBoard
|
||||||
|
end
|
||||||
|
if parent then
|
||||||
|
entity:getCell():getBaseObject():setParent(parent, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
local w, h = GFunc.getUIExpandScreenSize()
|
local w, h = GFunc.getUIExpandScreenSize()
|
||||||
self.enterShowBoardSeq:Join(self.defBoardImg:getTransform():DOAnchorPosX(w + 360, 0.5))
|
self.enterShowBoardSeq:Join(self.defBoardImg:getTransform():DOAnchorPosX(w + 360, 0.5))
|
||||||
self.enterShowBoardSeq:Join(self.atkBoardImg:getTransform():DOAnchorPosX(-(w + 360), 0.5))
|
self.enterShowBoardSeq:Join(self.atkBoardImg:getTransform():DOAnchorPosX(-(w + 360), 0.5))
|
||||||
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0, 0.5))
|
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0, 0.5))
|
||||||
self.enterShowBoardSeq:AppendCallback(function()
|
self.enterShowBoardSeq:AppendCallback(function()
|
||||||
self:dealBoardMaskOnShowAni(true)
|
self:dealBoardMaskOnShowAni(true)
|
||||||
self:getBoardRootNode():setVisible(false)
|
self.boardNode:setVisible(false)
|
||||||
if callback then
|
if callback then
|
||||||
callback()
|
callback()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user