reset clue spawning for locations when new scenario starts

This commit is contained in:
Chr1Z93 2024-07-13 14:05:16 +02:00
parent 843d6d4e10
commit e3b9526448
2 changed files with 11 additions and 8 deletions

View File

@ -116,6 +116,9 @@ function fireScenarioChangedEvent()
-- maybe update the playarea image
local playAreaImageSelector = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaImageSelector")
playAreaImageSelector.call("maybeUpdatePlayAreaImage", currentScenario)
-- reset the token spawning for locations
tokenSpawnTrackerApi.resetAllLocations()
end
-- fires if the scenario title or the difficulty changes

View File

@ -1,34 +1,34 @@
do
local TokenSpawnTracker = {}
local TokenSpawnTrackerApi = {}
local guidReferenceApi = require("core/GUIDReferenceApi")
local function getSpawnTracker()
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenSpawnTracker")
end
TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)
TokenSpawnTrackerApi.hasSpawnedTokens = function(cardGuid)
return getSpawnTracker().call("hasSpawnedTokens", cardGuid)
end
TokenSpawnTracker.markTokensSpawned = function(cardGuid)
TokenSpawnTrackerApi.markTokensSpawned = function(cardGuid)
return getSpawnTracker().call("markTokensSpawned", cardGuid)
end
TokenSpawnTracker.resetTokensSpawned = function(card)
TokenSpawnTrackerApi.resetTokensSpawned = function(card)
return getSpawnTracker().call("resetTokensSpawned", card)
end
TokenSpawnTracker.resetAllAssetAndEvents = function()
TokenSpawnTrackerApi.resetAllAssetAndEvents = function()
return getSpawnTracker().call("resetAllAssetAndEvents")
end
TokenSpawnTracker.resetAllLocations = function()
TokenSpawnTrackerApi.resetAllLocations = function()
return getSpawnTracker().call("resetAllLocations")
end
TokenSpawnTracker.resetAll = function()
TokenSpawnTrackerApi.resetAll = function()
return getSpawnTracker().call("resetAll")
end
return TokenSpawnTracker
return TokenSpawnTrackerApi
end