add tag to cards that seal
This commit is contained in:
parent
57cdd5ef71
commit
9fa5c45452
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user