add tag to cards that seal

This commit is contained in:
Chr1Z93 2023-06-27 12:10:32 +02:00
parent 57cdd5ef71
commit 9fa5c45452
2 changed files with 4 additions and 8 deletions

View File

@ -649,11 +649,8 @@ end
-- returns all sealed tokens on cards to the chaos bag
function releaseAllSealedTokens(playerColor)
local chaosbag = findChaosBag()
for _, obj in ipairs(getObjects()) do
local sealedTokens = obj.getTable("sealedTokens")
if sealedTokens ~= nil and #sealedTokens > 0 then
obj.call("releaseAllTokens", playerColor)
end
for _, obj in ipairs(getObjectsWithTag("CardThatSeals")) do
obj.call("releaseAllTokens", playerColor)
end
end

View File

@ -70,18 +70,17 @@ Thus it should be implemented like this:
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
local tokenArrangerApi = require("accessories/TokenArrangerApi")
local sealedTokens = {}
local ID_URL_MAP = {}
local tokensInBag = {}
-- this is intentionally global so that it can be accessed for clean up
sealedTokens = {}
function onSave() return JSON.encode(sealedTokens) end
function onLoad(savedData)
sealedTokens = JSON.decode(savedData) or {}
ID_URL_MAP = Global.getTable("ID_URL_MAP")
generateContextMenu()
self.addTag("CardThatSeals")
end
-- builds the context menu