Implemented new feature for releasing sealed tokens and clearing bless/curse
This commit is contained in:
parent
9bdd39a9f1
commit
b6d74ac205
@ -58,6 +58,7 @@ function onLoad(save_state)
|
|||||||
playAreaAPI = require("core/PlayAreaApi")
|
playAreaAPI = require("core/PlayAreaApi")
|
||||||
deckImporterApi = require("arkhamdb/DeckImporterApi")
|
deckImporterApi = require("arkhamdb/DeckImporterApi")
|
||||||
optionPanelApi = require("core/OptionPanelApi")
|
optionPanelApi = require("core/OptionPanelApi")
|
||||||
|
blessCurseApi = require("chaosbag/BlessCurseManagerApi")
|
||||||
campaignBoxGUID = ""
|
campaignBoxGUID = ""
|
||||||
|
|
||||||
self.createButton({
|
self.createButton({
|
||||||
@ -177,7 +178,11 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-- Creates a campaign token with save data encoded into GM Notes based on the current state of the table
|
-- Creates a campaign token with save data encoded into GM Notes based on the current state of the table
|
||||||
function createCampaignToken(_, _, _)
|
function createCampaignToken(_, playerColor, _)
|
||||||
|
-- clean up chaos tokens
|
||||||
|
blessCurseApi.removeAll(playerColor)
|
||||||
|
chaosBagApi.releaseAllSealedTokens(playerColor)
|
||||||
|
|
||||||
local campaignBoxGUID = ""
|
local campaignBoxGUID = ""
|
||||||
-- find active campaign
|
-- find active campaign
|
||||||
for _, obj in ipairs(getObjectsWithTag("CampaignBox")) do
|
for _, obj in ipairs(getObjectsWithTag("CampaignBox")) do
|
||||||
|
@ -7,6 +7,7 @@ local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
|||||||
local soundCubeApi = require("core/SoundCubeApi")
|
local soundCubeApi = require("core/SoundCubeApi")
|
||||||
local playmatApi = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||||
|
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||||
|
|
||||||
-- these objects will be ignored
|
-- these objects will be ignored
|
||||||
local IGNORE_GUIDS = {
|
local IGNORE_GUIDS = {
|
||||||
@ -173,7 +174,7 @@ function cleanUp(_, color)
|
|||||||
removeLines()
|
removeLines()
|
||||||
discardHands()
|
discardHands()
|
||||||
tokenSpawnTrackerApi.resetAll()
|
tokenSpawnTrackerApi.resetAll()
|
||||||
Global.call("releaseAllSealedTokens", color)
|
chaosBagApi.releaseAllSealedTokens(color)
|
||||||
|
|
||||||
printToAll("Tidying main play area...", "White")
|
printToAll("Tidying main play area...", "White")
|
||||||
startLuaCoroutine(self, "tidyPlayareaCoroutine")
|
startLuaCoroutine(self, "tidyPlayareaCoroutine")
|
||||||
|
@ -23,5 +23,10 @@ do
|
|||||||
return Global.call("findChaosBag")
|
return Global.call("findChaosBag")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user