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

This commit is contained in:
chenxi 2023-04-19 16:27:50 +08:00
commit dbf3ffa581
2 changed files with 83 additions and 2 deletions

View File

@ -310,7 +310,25 @@ function BattleController:enterEliminationBegin()
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_BEGIN
self:onEliminationBegin()
self:popBoardCacheSkill(function()
-- 检查棋盘
local find, pathList = self:findAttention()
if not find then -- 如果没找到,就要打乱棋盘
-- todo
Logger.logHighlight("----- 处于无法消除状态 -----")
else
self.attentionList = pathList
-- ModuleManager.BattleManager:performWithDelayGlobal(function()
-- for _, posId in ipairs(pathList) do
-- local entity = self.battleData:getGridEntity(posId)
-- Logger.logHighlight(entity:getCell() == nil)
-- if entity and entity:getCell() then
-- entity:getCell():showAni()
-- end
-- end
-- end, 2)
self:enterElimination()
end
end)
end
@ -374,7 +392,6 @@ function BattleController:enterDefStepOver()
return
end
---- 临时直接调用
self:enterRefreshBoard()
end
@ -1274,6 +1291,60 @@ function BattleController:snapshotBoard()
return snapshot
end
function BattleController:showAttention()
if not self.attentionList then
return
end
if self.attentionSid then
ModuleManager.BattleManager:unscheduleGlobal(self.attentionSid)
self.attentionSid = nil
end
self.attentionSid = ModuleManager.BattleManager:performWithDelayGlobal(function()
for _, posId in ipairs(self.attentionList) do
local entity = self.battleData:getGridEntity(posId)
if entity and entity:getCell() then
entity:getCell():showAni()
end
end
end, 2)
end
function BattleController:shuffleBoard()
-- local posList = {}
-- local gridEntityList = {}
-- local elementList = {}
-- for posId, entity in pairs(self.battleData:getGridEnties()) do
-- table.insert(posList, posId)
-- table.insert(gridEntityList, entity)
-- if entity:canLink() then
-- table.insert(elementList, entity)
-- end
-- end
-- local needCount = self:getMinEliminationCount()
-- local tempMap = {}
-- while needCount > 0 do
-- local find = false
-- for _, entity1 in ipairs(elementList) do
-- if not tempMap[entity1:getPosId] then
-- tempMap[entity1:getPosId] = true
-- for _, entity2 in ipairs(elementList) do
-- if not tempMap[entity2:getPosId] then
-- if entity2: then
-- -- body
-- end
-- end
-- end
-- end
-- end
-- if not find then
-- break
-- end
-- end
end
function BattleController:findAttention()
local find = false
local posIdMap = {}

View File

@ -114,4 +114,14 @@ function GridCell:resetTranform()
end
function GridCell:showAni()
local uiMap = self:getUIMap()
GFunc.getShakeSeq(uiMap["grid_cell.touch_node.ani_node"], false, 1, true)
end
function GridCell:hideAni()
local uiMap = self:getUIMap()
GFunc.getShakeSeq(uiMap["grid_cell.touch_node.ani_node"], true)
end
return GridCell