125 lines
3.6 KiB
Plaintext
125 lines
3.6 KiB
Plaintext
-- Bundled by luabundle {"version":"1.6.0"}
|
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
|
local loadingPlaceholder = {[{}] = true}
|
|
|
|
local register
|
|
local modules = {}
|
|
|
|
local require
|
|
local loaded = {}
|
|
|
|
register = function(name, body)
|
|
if not modules[name] then
|
|
modules[name] = body
|
|
end
|
|
end
|
|
|
|
require = function(name)
|
|
local loadedModule = loaded[name]
|
|
|
|
if loadedModule then
|
|
if loadedModule == loadingPlaceholder then
|
|
return nil
|
|
end
|
|
else
|
|
if not modules[name] then
|
|
if not superRequire then
|
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
|
else
|
|
return superRequire(name)
|
|
end
|
|
end
|
|
|
|
loaded[name] = loadingPlaceholder
|
|
loadedModule = modules[name](require, loaded, register, modules)
|
|
loaded[name] = loadedModule
|
|
end
|
|
|
|
return loadedModule
|
|
end
|
|
|
|
return require, loaded, register, modules
|
|
end)(nil)
|
|
__bundle_register("core/CustomDataHelper", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
-- set true to enable debug logging
|
|
DEBUG = false
|
|
|
|
function log(message)
|
|
if DEBUG then
|
|
print(message)
|
|
end
|
|
end
|
|
|
|
--[[
|
|
Known locations and clues. We check this to determine if we should
|
|
atttempt to spawn clues, first we look for <LOCATION_NAME>_<GUID> and if
|
|
we find nothing we look for <LOCATION_NAME>
|
|
format is [location_guid -> clueCount]
|
|
]]
|
|
LOCATIONS_DATA_JSON = [[
|
|
{
|
|
"San Francisco": {"type": "fixed", "value": 1, "clueSide": "back"},
|
|
" Arkham": {"type": "perPlayer", "value": 1, "clueSide": "back"},
|
|
"Buenos Aires": {"type": "fixed", "value": 2, "clueSide": "back"},
|
|
" London": {"type": "perPlayer", "value": 2, "clueSide": "front"},
|
|
"Rome": {"type": "perPlayer", "value": 3, "clueSide": "front"},
|
|
"Istanbul": {"type": "perPlayer", "value": 4, "clueSide": "front"},
|
|
"Tokyo_123abc": {"type": "perPlayer", "value": 0, "clueSide": "back"},
|
|
"Tokyo_456efg": {"type": "perPlayer", "value": 4, "clueSide": "back"},
|
|
"Tokyo": {"type": "fixed", "value": 2, "clueSide": "back"},
|
|
"Shanghai_123": {"type": "fixed", "value": 12, "clueSide": "front"},
|
|
"Sydney": {"type": "fixed", "value": 0, "clueSide": "front"}
|
|
}
|
|
]]
|
|
|
|
|
|
PLAYER_CARD_DATA_JSON = [[
|
|
{
|
|
"Tool Belt (0)": {
|
|
"tokenType": "resource",
|
|
"tokenCount": 2
|
|
},
|
|
"Tool Belt (3)": {
|
|
"tokenType": "resource",
|
|
"tokenCount": 4
|
|
},
|
|
"Yithian Rifle": {
|
|
"tokenType": "resource",
|
|
"tokenCount": 3
|
|
},
|
|
"xxx": {
|
|
"tokenType": "resource",
|
|
"tokenCount": 3
|
|
}
|
|
}
|
|
]]
|
|
|
|
HIDDEN_CARD_DATA = {
|
|
"Unpleasant Card (Doom)",
|
|
"Unpleasant Card (Gloom)",
|
|
"The Case of the Scarlet DOOOOOM!"
|
|
}
|
|
|
|
LOCATIONS_DATA = JSON.decode(LOCATIONS_DATA_JSON)
|
|
PLAYER_CARD_DATA = JSON.decode(PLAYER_CARD_DATA_JSON)
|
|
|
|
function onload(save_state)
|
|
local playArea = getObjectFromGUID('721ba2')
|
|
playArea.call("updateLocations", {self.getGUID()})
|
|
local playerMatWhite = getObjectFromGUID('8b081b')
|
|
playerMatWhite.call("updatePlayerCards", {self.getGUID()})
|
|
local playerMatOrange = getObjectFromGUID('bd0ff4')
|
|
playerMatOrange.call("updatePlayerCards", {self.getGUID()})
|
|
local playerMatGreen = getObjectFromGUID('383d8b')
|
|
playerMatGreen.call("updatePlayerCards", {self.getGUID()})
|
|
local playerMatRed = getObjectFromGUID('0840d5')
|
|
playerMatRed.call("updatePlayerCards", {self.getGUID()})
|
|
local dataHelper = getObjectFromGUID('708279')
|
|
dataHelper.call("updateHiddenCards", {self.getGUID()})
|
|
end
|
|
end)
|
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
require("core/CustomDataHelper")
|
|
end)
|
|
return __bundle_require("__root") |