diff --git a/src/chaosbag/BlessCurseManager.ttslua b/src/chaosbag/BlessCurseManager.ttslua index 7add1972..a11910a6 100644 --- a/src/chaosbag/BlessCurseManager.ttslua +++ b/src/chaosbag/BlessCurseManager.ttslua @@ -134,8 +134,8 @@ function doRemove(color) broadcastToColor("Removed " .. count.Bless .. " Bless and " .. count.Curse .. " Curse tokens from the chaos bag.", color, "White") - broadcastToColor("Removed " .. removeType("Bless") .. " Bless and " .. - removeType("Curse") .. " Curse tokens from play.", color, "White") + broadcastToColor("Removed " .. removeTakenTokens("Bless") .. " Bless and " .. + removeTakenTokens("Curse") .. " Curse tokens from play.", color, "White") doReset(color) end @@ -150,7 +150,7 @@ function doReset(color) end -- removing tokens that were 'taken' -function removeType(type) +function removeTakenTokens(type) local count = 0 for _, guid in ipairs(tokensTaken[type]) do local token = getObjectFromGUID(guid) @@ -268,10 +268,10 @@ function releasedToken(param) end if not updating then updating = true - Wait.time(function() + Wait.frames(function() broadcastCount(param.type) updating = false - end, 0.1) + end, 1) end end diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index 9d3b7586..aab8aebb 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -69,7 +69,7 @@ local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") local tokenArrangerApi = require("accessories/TokenArrangerApi") local sealedTokens = {} local ID_URL_MAP = {} -tokensInBag = {} +local tokensInBag = {} function onSave() return JSON.encode(sealedTokens) end @@ -189,6 +189,7 @@ function releaseMultipleTokens(playerColor) printToColor("Not enough " .. name .. " tokens sealed.", playerColor) end end + -- releases all sealed tokens function releaseAllTokens(playerColor) if not Global.call("canTouchChaosTokens") then return end