优化逻辑
This commit is contained in:
parent
f5ed280271
commit
213e82f2c1
@ -2102,34 +2102,38 @@ function BattleBaseController:fillThisPos(posId, columnCount, gridMap, reverse)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleBaseController:judgeGridEdgeCanFall(posId, fallPosId, reverse)
|
function BattleBaseController:judgeGridEdgeCanFall(posId, fallPosId, reverse)
|
||||||
|
local direction = ModuleManager.BattleManager:getPosDirection(posId, fallPosId)
|
||||||
|
local reverseDirection = ModuleManager.BattleManager:getReverseDirection(direction)
|
||||||
local fallDownPosId
|
local fallDownPosId
|
||||||
if reverse then
|
if reverseDirection then
|
||||||
--竖向
|
if reverse then
|
||||||
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
--竖向
|
||||||
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
|
||||||
if fallDownPosId then
|
|
||||||
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
|
||||||
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
|
||||||
else
|
fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
||||||
--竖向
|
if fallDownPosId then
|
||||||
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
||||||
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
else
|
||||||
if fallDownPosId then
|
--竖向
|
||||||
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
||||||
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN)
|
||||||
|
if fallDownPosId then
|
||||||
|
local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.UP)
|
||||||
|
if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user