续关记录能量

This commit is contained in:
xiekaidong 2023-08-01 18:02:57 +08:00
parent c21607c52e
commit a94b0b1a23

View File

@ -74,6 +74,11 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController)
battleBaseController.snapShotInfo.atkSkillMap[tostring(skillId)] = info
end
battleBaseController.snapShotInfo.atkSkillEnergy = table.clearOrCreate(battleBaseController.snapShotInfo.atkSkillEnergy)
for elementType, skillEntity in pairs(battleBaseController.battleData:getSkillEntities(SIDE_ATK)) do
battleBaseController.snapShotInfo.atkSkillEnergy[tostring(elementType)] = skillEntity:getEnergy()
end
-- BattleBaseData
battleBaseController.snapShotInfo.battledataShopInfo = battleBaseController.battleData:getSnapshoptInfo()
@ -213,11 +218,22 @@ function BattleSnapshotHelper:dealSnapshotBattleExtraInfo(battleBaseController,
end
end
end
end
local atkSkillEnergy = snapshot.atkSkillEnergy
if atkSkillEnergy then
local skillMap = battleBaseController.battleData:getSkillEntities(SIDE_ATK)
for matchTypeStr, count in pairs(atkSkillEnergy) do
local matchType = tonumber(matchTypeStr)
if matchType and skillMap[matchType] then
skillMap[matchType]:addEnergy(count)
end
end
end
if battleBaseController.battleUI then
battleBaseController.battleUI:refreshSkill(nil, nil, SIDE_ATK)
end
end
-- buff
local atkBuff = snapshot.atkBuff