Merge pull request #770 from argonui/token-spawning
Reset clue spawning for locations when new scenario starts
This commit is contained in:
commit
a775fb73ce
@ -116,6 +116,9 @@ function fireScenarioChangedEvent()
|
|||||||
-- maybe update the playarea image
|
-- maybe update the playarea image
|
||||||
local playAreaImageSelector = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaImageSelector")
|
local playAreaImageSelector = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaImageSelector")
|
||||||
playAreaImageSelector.call("maybeUpdatePlayAreaImage", currentScenario)
|
playAreaImageSelector.call("maybeUpdatePlayAreaImage", currentScenario)
|
||||||
|
|
||||||
|
-- reset the token spawning for locations
|
||||||
|
tokenSpawnTrackerApi.resetAllLocations()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fires if the scenario title or the difficulty changes
|
-- fires if the scenario title or the difficulty changes
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
do
|
do
|
||||||
local TokenSpawnTracker = {}
|
local TokenSpawnTrackerApi = {}
|
||||||
local guidReferenceApi = require("core/GUIDReferenceApi")
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
local function getSpawnTracker()
|
local function getSpawnTracker()
|
||||||
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenSpawnTracker")
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenSpawnTracker")
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)
|
TokenSpawnTrackerApi.hasSpawnedTokens = function(cardGuid)
|
||||||
return getSpawnTracker().call("hasSpawnedTokens", cardGuid)
|
return getSpawnTracker().call("hasSpawnedTokens", cardGuid)
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.markTokensSpawned = function(cardGuid)
|
TokenSpawnTrackerApi.markTokensSpawned = function(cardGuid)
|
||||||
return getSpawnTracker().call("markTokensSpawned", cardGuid)
|
return getSpawnTracker().call("markTokensSpawned", cardGuid)
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.resetTokensSpawned = function(card)
|
TokenSpawnTrackerApi.resetTokensSpawned = function(card)
|
||||||
return getSpawnTracker().call("resetTokensSpawned", card)
|
return getSpawnTracker().call("resetTokensSpawned", card)
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.resetAllAssetAndEvents = function()
|
TokenSpawnTrackerApi.resetAllAssetAndEvents = function()
|
||||||
return getSpawnTracker().call("resetAllAssetAndEvents")
|
return getSpawnTracker().call("resetAllAssetAndEvents")
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.resetAllLocations = function()
|
TokenSpawnTrackerApi.resetAllLocations = function()
|
||||||
return getSpawnTracker().call("resetAllLocations")
|
return getSpawnTracker().call("resetAllLocations")
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenSpawnTracker.resetAll = function()
|
TokenSpawnTrackerApi.resetAll = function()
|
||||||
return getSpawnTracker().call("resetAll")
|
return getSpawnTracker().call("resetAll")
|
||||||
end
|
end
|
||||||
|
|
||||||
return TokenSpawnTracker
|
return TokenSpawnTrackerApi
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user