bug修复
This commit is contained in:
parent
0be49bdc32
commit
a4951d9f89
@ -526,6 +526,10 @@ function BattleController:onTouchEvent(eventType, posId, isVirtual)
|
|||||||
if eventType == ELIMINATION_TOUCH_EVENT.DOWN then
|
if eventType == ELIMINATION_TOUCH_EVENT.DOWN then
|
||||||
self:onLinkStart(entity, posId, isVirtual)
|
self:onLinkStart(entity, posId, isVirtual)
|
||||||
elseif eventType == ELIMINATION_TOUCH_EVENT.ENTER then
|
elseif eventType == ELIMINATION_TOUCH_EVENT.ENTER then
|
||||||
|
if self.battleData:getIsVirtual() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
self:onLinkEnter(entity, posId, isVirtual)
|
self:onLinkEnter(entity, posId, isVirtual)
|
||||||
elseif eventType == ELIMINATION_TOUCH_EVENT.EXIT then
|
elseif eventType == ELIMINATION_TOUCH_EVENT.EXIT then
|
||||||
|
|
||||||
@ -557,7 +561,7 @@ function BattleController:onLinkStart(entity, posId, isVirtual)
|
|||||||
if #self.battleData:getGridSequence() > 0 then
|
if #self.battleData:getGridSequence() > 0 then
|
||||||
self.battleData:clearGridSequence()
|
self.battleData:clearGridSequence()
|
||||||
end
|
end
|
||||||
self.battleData:insertGridSequence(posId, self:snapshotBoard())
|
self.battleData:insertGridSequence(posId, self:snapshotBoard(), isVirtual)
|
||||||
local skillEntity = self.battleData:getSkillEntityBySkillId(entity:getSkillId())
|
local skillEntity = self.battleData:getSkillEntityBySkillId(entity:getSkillId())
|
||||||
local maskElementType = entity:getElementType(skillEntity)
|
local maskElementType = entity:getElementType(skillEntity)
|
||||||
self.battleUI:showBoardMask(maskElementType)
|
self.battleUI:showBoardMask(maskElementType)
|
||||||
@ -633,7 +637,7 @@ function BattleController:onLinkEnter(entity, posId, isVirtual)
|
|||||||
local maskElementType = elementType or lastElementType
|
local maskElementType = elementType or lastElementType
|
||||||
self.battleUI:showBoardMask(maskElementType)
|
self.battleUI:showBoardMask(maskElementType)
|
||||||
|
|
||||||
self.battleData:insertGridSequence(posId, self:snapshotBoard())
|
self.battleData:insertGridSequence(posId, self:snapshotBoard(), isVirtual)
|
||||||
if lastEntity:getNeedChangePos() and not entity:getNeedChangePos() then -- 需要移动到队列末尾
|
if lastEntity:getNeedChangePos() and not entity:getNeedChangePos() then -- 需要移动到队列末尾
|
||||||
local lastSkillId = lastEntity:getSkillId()
|
local lastSkillId = lastEntity:getSkillId()
|
||||||
local skillId = entity:getSkillId()
|
local skillId = entity:getSkillId()
|
||||||
|
|||||||
@ -180,6 +180,10 @@ function BattleData:alreadyInsertSequence(posId)
|
|||||||
return self.gridSequenceMap[posId] == true
|
return self.gridSequenceMap[posId] == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleData:getIsVirtual()
|
||||||
|
return self.isVirtual
|
||||||
|
end
|
||||||
|
|
||||||
function BattleData:getSequenceHadSkill()
|
function BattleData:getSequenceHadSkill()
|
||||||
for _, info in ipairs(self:getGridSequence()) do
|
for _, info in ipairs(self:getGridSequence()) do
|
||||||
local entity = self.gridEntities[info.posId]
|
local entity = self.gridEntities[info.posId]
|
||||||
@ -190,12 +194,13 @@ function BattleData:getSequenceHadSkill()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleData:insertGridSequence(posId, snapshot)
|
function BattleData:insertGridSequence(posId, snapshot, isVirtual)
|
||||||
if self:alreadyInsertSequence(posId) then
|
if self:alreadyInsertSequence(posId) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
self.gridSequenceMap[posId] = true
|
self.gridSequenceMap[posId] = true
|
||||||
|
self.isVirtual = isVirtual
|
||||||
table.insert(self.gridSequence, {posId = posId, snapshot = snapshot})
|
table.insert(self.gridSequence, {posId = posId, snapshot = snapshot})
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -248,6 +253,7 @@ end
|
|||||||
function BattleData:clearGridSequence()
|
function BattleData:clearGridSequence()
|
||||||
self.gridSequence = {} -- 格子队列
|
self.gridSequence = {} -- 格子队列
|
||||||
self.gridSequenceMap = {} -- 格子队列对应的map,方面查找
|
self.gridSequenceMap = {} -- 格子队列对应的map,方面查找
|
||||||
|
self.isVirtual = nil
|
||||||
self:clearSkillInfluenceGrids()
|
self:clearSkillInfluenceGrids()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user