This commit is contained in:
puxuan 2025-10-22 10:13:37 +08:00
parent 8263a37038
commit 71bb3ff422
2 changed files with 28 additions and 9 deletions

View File

@ -3269,9 +3269,6 @@ function BattleBaseController:adRevive(revive)
self:onBattleEnd(not revive) self:onBattleEnd(not revive)
else else
self.atkTeam:revive() self.atkTeam:revive()
-- local unitEntity = self.defTeam:getMainUnit().unitEntity
-- self:refreshBossSkill(unitEntity)
-- self:enterNextTeamAction()
self:enterRoundEnd() self:enterRoundEnd()
end end
end end

View File

@ -63,6 +63,7 @@ function BattleBoardTouchHelper:onLinkStart(entity, posId, isVirtual)
self.battleData:insertGridSequence(posId, self.battleController:snapshotBoard(), isVirtual) self.battleData:insertGridSequence(posId, self.battleController:snapshotBoard(), isVirtual)
local skillEntity = self.battleController:getSkillEntityBySkillId(entity:getSkillId()) local skillEntity = self.battleController:getSkillEntityBySkillId(entity:getSkillId())
local maskElementType = entity:getElementType(skillEntity, true) local maskElementType = entity:getElementType(skillEntity, true)
self.battleController.currLinkElementType = maskElementType
self.battleUI:showBoardMask(maskElementType, skillEntity and entity:getPosId()) self.battleUI:showBoardMask(maskElementType, skillEntity and entity:getPosId())
self.battleController:findSkillInfluenceGrids() self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange() self.battleController:onLinkChange()
@ -118,18 +119,19 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
local lastElementType = lastEntity:getElementType(lastSkillEntity, true) local lastElementType = lastEntity:getElementType(lastSkillEntity, true)
local hadSkillId, skillPosId = self.battleData:getSequenceHadSkill() local hadSkillId, skillPosId = self.battleData:getSequenceHadSkill()
-- 已经有技能
if skillEntity and hadSkillId then if skillEntity and hadSkillId then
return return
end end
if not elementType or not lastElementType then if not elementType or not self.battleController.currLinkElementType then
else else
if lastElementType ~= elementType then if self.battleController.currLinkElementType ~= elementType then
return return
end end
end end
local maskElementType = elementType or lastElementType local maskElementType = elementType or self.battleController.currLinkElementType
if not skillPosId then if not skillPosId then
if skillId then if skillId then
skillPosId = posId skillPosId = posId
@ -145,12 +147,15 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
skillPosId = posId skillPosId = posId
end end
local newElementType = elementType or lastElementType local newElementType = elementType or self.battleController.currLinkElementType
if newElementType then if newElementType then
entity:setElementType(newElementType) entity:setElementType(newElementType)
lastEntity:setElementType(newElementType) lastEntity:setElementType(newElementType)
end end
self.battleUI:showBoardMask(maskElementType, skillPosId) self.battleUI:showBoardMask(maskElementType, skillPosId)
if not self.battleController.currLinkElementType then
self.battleController.currLinkElementType = newElementType
end
entity:addLinkSkillCount() entity:addLinkSkillCount()
@ -244,10 +249,27 @@ function BattleBoardTouchHelper:clearSequenceByPosId(posId)
end end
local gridEntity = self.battleData:getGridEntity(posId) local gridEntity = self.battleData:getGridEntity(posId)
local skillEntity = self.battleController:getSkillEntityBySkillId(gridEntity:getSkillId()) local skillEntity = self.battleController:getSkillEntityBySkillId(gridEntity:getSkillId())
local maskElementType = gridEntity:getElementType(skillEntity, true) -- local maskElementType = gridEntity:getElementType(skillEntity, true)
-- 计算当前颜色
local sequence = self.battleData:getGridSequence()
local currElementType
if #sequence > 1 then
for i = #sequence - 1, 1, -1 do
local entityTmp = self.battleData:getGridEntity(sequence[i].posId)
local skillId = entityTmp:getSkillId()
if not skillId then
local maskElementType = entityTmp:getElementType(nil, true)
if maskElementType then
currElementType = maskElementType
break
end
end
end
end
local _, skillPosId = self.battleData:getSequenceHadSkill() local _, skillPosId = self.battleData:getSequenceHadSkill()
self.battleUI:showBoardMask(maskElementType, skillPosId) self.battleController.currLinkElementType = currElementType
self.battleUI:showBoardMask(self.battleController.currLinkElementType, skillPosId)
self.battleController:findSkillInfluenceGrids() self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange() self.battleController:onLinkChange()