diff --git a/objects/OfficialStandaloneChallengeScenarios.0ef5c8/StandaloneScenarios.77a5f9.json b/objects/OfficialStandaloneChallengeScenarios.0ef5c8/StandaloneScenarios.77a5f9.json index ef57e9be..fba77cf7 100644 --- a/objects/OfficialStandaloneChallengeScenarios.0ef5c8/StandaloneScenarios.77a5f9.json +++ b/objects/OfficialStandaloneChallengeScenarios.0ef5c8/StandaloneScenarios.77a5f9.json @@ -21,7 +21,8 @@ "TheBlobthatAteEverything.4dee5a", "CurseoftheRougarou.db7039", "GuardiansoftheAbyss.ee987d", - "WaroftheOuterGods.fc7674" + "WaroftheOuterGods.fc7674", + "FortuneandFolly.0dce91" ], "ContainedObjects_path": "StandaloneScenarios.77a5f9", "CustomMesh": { diff --git a/src/core/DataHelper.ttslua b/src/core/DataHelper.ttslua index 22f926dc..fc2dff78 100644 --- a/src/core/DataHelper.ttslua +++ b/src/core/DataHelper.ttslua @@ -7,14 +7,11 @@ function log(message) end end ---[[ -Known locations and clues. We check this to determine if we should -atttempt to spawn clues, first we look for _ and if -we find nothing we look for -format is [location_guid -> clueCount] -]] -LOCATIONS_DATA_JSON = [[ -{ +--[[ Known locations and clues. We check this to determine if we should atttempt to spawn clues, +first we look for _ and if we find nothing we look for +format is [location_guid -> clueCount] ]] +LOCATIONS_DATA = JSON.decode( +[[{ "Study": {"type": "perPlayer", "value": 2, "clueSide": "back"}, "Study_670914": {"type": "perPlayer", "value": 1, "clueSide": "back"}, "Attic_377b20": {"type": "perPlayer", "value": 1, "clueSide": "back"}, @@ -712,15 +709,28 @@ LOCATIONS_DATA_JSON = [[ "Ye Olde Magick Shoppe": {"type": "perPlayer", "value": 1, "clueSide": "back"}, "Corrigan Industries": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Counting Room": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Guard Room": {"type": "perPlayer", "value": 2, "clueSide": "back"}, + "Relic Room": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Security Office_b2d198": {"type": "perPlayer", "value": 2, "clueSide": "back"}, + "Owner's Office": {"type": "perPlayer", "value": 3, "clueSide": "back"}, + "High Roller's Table_226c6a": {"type": "perPlayer", "value": 2, "clueSide": "back"}, + "High Roller's Table_804dbc": {"type": "perPlayer", "value": 2, "clueSide": "front"}, + "Casino Lounge_169f16": {"type": "perPlayer", "value": 2, "clueSide": "back"}, + "Casino Lounge_4af4eb": {"type": "perPlayer", "value": 2, "clueSide": "front"}, + "Roulette Wheel": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Slot Machines": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Poker Table": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "Baccarat Table": {"type": "perPlayer", "value": 1, "clueSide": "back"}, + "XXXX": {"type": "fixed", "value": 2, "clueSide": "back"}, "xxx": {"type": "perPlayer", "value": 2, "clueSide": "back"} -} -]] ---[[ -Player cards with token counts and types -]] -PLAYER_CARD_DATA_JSON = [[ -{ +}]] +) + +-- Player cards with token counts and types +PLAYER_CARD_DATA = JSON.decode( + [[{ "xxx": { "tokenType": "resource", "tokenCount": 3 @@ -730,8 +740,8 @@ PLAYER_CARD_DATA_JSON = [[ "tokenType": "resource", "tokenCount": 3 } -} -]] +}]] +) -- Encounter Cards with Hidden. HIDDEN_CARD_DATA = { @@ -766,88 +776,84 @@ HIDDEN_CARD_DATA = { "Whispering Chaos (West)" } -LOCATIONS_DATA = JSON.decode(LOCATIONS_DATA_JSON) -PLAYER_CARD_DATA = JSON.decode(PLAYER_CARD_DATA_JSON) - PLAYER_CARD_TOKEN_OFFSETS = { [1] = { - { 0, 3, -0.2 }, + { 0, 3, -0.2 } }, [2] = { - { 0.4, 3, -0.2 }, - { -0.4, 3, -0.2 }, + { 0.4, 3, -0.2 }, + { -0.4, 3, -0.2 } }, [3] = { - { 0, 3, -0.9 }, - { 0.4, 3, -0.2 }, - { -0.4, 3, -0.2 }, + { 0, 3, -0.9 }, + { 0.4, 3, -0.2 }, + { -0.4, 3, -0.2 } }, [4] = { - { 0.4, 3, -0.9 }, - { -0.4, 3, -0.9 }, - { 0.4, 3, -0.2 }, - { -0.4, 3, -0.2 } + { 0.4, 3, -0.9 }, + { -0.4, 3, -0.9 }, + { 0.4, 3, -0.2 }, + { -0.4, 3, -0.2 } }, [5] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.4, 3, -0.2 }, - { -0.4, 3, -0.2 } + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.4, 3, -0.2 }, + { -0.4, 3, -0.2 } }, [6] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.7, 3, -0.2 }, - { 0, 3, -0.2 }, - { -0.7, 3, -0.2 }, + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.7, 3, -0.2 }, + { 0, 3, -0.2 }, + { -0.7, 3, -0.2 } }, [7] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.7, 3, -0.2 }, - { 0, 3, -0.2 }, - { -0.7, 3, -0.2 }, - { 0, 3, 0.5 }, + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.7, 3, -0.2 }, + { 0, 3, -0.2 }, + { -0.7, 3, -0.2 }, + { 0, 3, 0.5 } }, [8] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.7, 3, -0.2 }, - { 0, 3, -0.2 }, - { -0.7, 3, -0.2 }, - { -0.35, 3, 0.5 }, - { 0.35, 3, 0.5 }, + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.7, 3, -0.2 }, + { 0, 3, -0.2 }, + { -0.7, 3, -0.2 }, + { -0.35, 3, 0.5 }, + { 0.35, 3, 0.5 } }, [9] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.7, 3, -0.2 }, - { 0, 3, -0.2 }, - { -0.7, 3, -0.2 }, - { 0.7, 3, 0.5 }, - { 0, 3, 0.5 }, - { -0.7, 3, 0.5 }, + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.7, 3, -0.2 }, + { 0, 3, -0.2 }, + { -0.7, 3, -0.2 }, + { 0.7, 3, 0.5 }, + { 0, 3, 0.5 }, + { -0.7, 3, 0.5 } }, [12] = { - { 0.7, 3, -0.9 }, - { 0, 3, -0.9 }, - { -0.7, 3, -0.9 }, - { 0.7, 3, -0.2 }, - { 0, 3, -0.2 }, - { -0.7, 3, -0.2 }, - { 0.7, 3, 0.5 }, - { 0, 3, 0.5 }, - { -0.7, 3, 0.5 }, - { 0.7, 3, 1.2 }, - { 0, 3, 1.2 }, - { -0.7, 3, 1.2 }, + { 0.7, 3, -0.9 }, + { 0, 3, -0.9 }, + { -0.7, 3, -0.9 }, + { 0.7, 3, -0.2 }, + { 0, 3, -0.2 }, + { -0.7, 3, -0.2 }, + { 0.7, 3, 0.5 }, + { 0, 3, 0.5 }, + { -0.7, 3, 0.5 }, + { 0.7, 3, 1.2 }, + { 0, 3, 1.2 }, + { -0.7, 3, 1.2 } } - } modeData = { @@ -863,8 +869,8 @@ modeData = { hard = { parent = 'Core Set', append = { 'elder' }, message = 'An additional token for the preparation of this scenario has been added to the bag.' }, expert = { parent = 'Core Set', append = { 'elder' }, message = 'An additional token for the preparation of this scenario has been added to the bag.' } }, - -----------------The Dunwich Legacy + -----------------The Dunwich Legacy ['The Dunwich Legacy'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'red', 'blue' } }, @@ -889,8 +895,8 @@ modeData = { ['Lost in Time and Space'] = { standalone = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - -----------------The Path to Carcosa + -----------------The Path to Carcosa ['The Path to Carcosa'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'skull', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'skull', 'red', 'blue' } }, @@ -918,8 +924,8 @@ modeData = { ['Dim Carcosa'] = { standalone = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'skull', 'red', 'blue' } } }, - -----------------The Forgotten Age + -----------------The Forgotten Age ['The Forgotten Age'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm2', 'm3', 'skull', 'skull', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', '0', 'm1', 'm2', 'm2', 'm3', 'm5', 'skull', 'skull', 'elder', 'red', 'blue' } }, @@ -949,7 +955,6 @@ modeData = { }, -----------------The Circle Undone - ['The Circle Undone'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm2', 'm3', 'skull', 'skull', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'red', 'blue' } }, @@ -978,9 +983,7 @@ modeData = { standalone = { token = { 'p1', '0', '0', 'm1','m1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - -----------------The Dream-Eaters - ['TDE_A'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm2', 'm2', 'cultist', 'tablet', 'tablet', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'cultist', 'tablet', 'tablet', 'red', 'blue' } }, @@ -1012,7 +1015,6 @@ modeData = { standalone = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'skull', 'cultist', 'elder', 'elder', 'red', 'blue' } } }, - -----------------The Innsmouth Conspiracy ['The Innsmouth Conspiracy'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'cultist', 'tablet', 'tablet', 'elder', 'elder', 'red', 'blue' } }, @@ -1031,7 +1033,6 @@ modeData = { hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'm4', 'm5', 'frost', 'frost', 'skull', 'skull', 'cultist', 'tablet', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm2', 'm2', 'm3', 'm4', 'm4', 'm5', 'm7', 'frost', 'frost', 'frost', 'skull', 'skull', 'cultist', 'tablet', 'red', 'blue' } } }, - ['City of the Elder Things'] = { easy = { token = { 'p1', 'p1', 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'frost', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, @@ -1073,48 +1074,46 @@ modeData = { hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'm5', 'm6', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - ['Meowlathotep'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, hard = { token = { '0', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm4', 'm5', 'm6', 'm8', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - ['WotOG'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'skull', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'skull', 'red', 'blue' } }, hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'm5', 'm6', 'skull', 'skull', 'skull', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'skull', 'skull', 'skull', 'red', 'blue' } } }, - ['Bad Blood'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'm5', 'm6', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - ['Machinations'] = { easy = { token = { 'p1', 'p1', 'p1', '0', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, hard = { token = { '0', '0', 'm1', 'm1', 'm1', 'm2', 'm3', 'm4', 'm6', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'elder', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm8', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'elder', 'red', 'blue' } } }, - ['Red Tide'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'm5', 'm6', 'skull', 'skull', 'cultist', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'skull', 'skull', 'cultist', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, + ['FaF'] = { + normal = { token = { 'p1', '0', '0', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, + hard = { token = { '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm6', 'm7', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, + }, --fan-made ['Carnevale of Spiders'] = { normal = { token = { 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm3', 'm4', 'm6', 'skull', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, hard = { token = { 'p1', '0', '0', '0', 'm1', 'm1', 'm3', 'm4', 'm5', 'm6', 'm7', 'skull', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } } }, - ['The Nephew Calls'] = { easy = { token = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, normal = { token = { 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue' } }, @@ -1329,41 +1328,42 @@ modeData = { normal = { token = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'tablet', 'red', 'blue' } }, hard = { token = { '0', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'tablet', 'red', 'blue' } }, expert = { token = { '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm4', 'm5', 'm6', 'm8', 'skull', 'skull', 'cultist', 'tablet', 'red', 'blue' } } - }, - + } } function onSave() local globalState = JSON.encode(SPAWNED_PLAYER_CARD_GUIDS) log('saving global state: ' .. globalState) - self.script_state = globalState + return globalState end -function onload(save_state) +function onLoad(save_state) if save_state ~= '' then - log('loading global state: ' .. save_state) - SPAWNED_PLAYER_CARD_GUIDS = JSON.decode(save_state) + log('loading global state: ' .. save_state) + SPAWNED_PLAYER_CARD_GUIDS = JSON.decode(save_state) else - SPAWNED_PLAYER_CARD_GUIDS = {} + SPAWNED_PLAYER_CARD_GUIDS = {} end end function getSpawnedPlayerCardGuid(params) local guid = params[1] if SPAWNED_PLAYER_CARD_GUIDS == nil then - return nil + return nil + else + return SPAWNED_PLAYER_CARD_GUIDS[guid] end - return SPAWNED_PLAYER_CARD_GUIDS[guid] end function setSpawnedPlayerCardGuid(params) local guid = params[1] local value = params[2] if SPAWNED_PLAYER_CARD_GUIDS ~= nil then - SPAWNED_PLAYER_CARD_GUIDS[guid] = value - return true + SPAWNED_PLAYER_CARD_GUIDS[guid] = value + return true + else + return false end - return false end function checkHiddenCard(name) @@ -1376,9 +1376,9 @@ function checkHiddenCard(name) end function updateHiddenCards(args) - local custom_data_helper = getObjectFromGUID(args[1]) - local data_hiddenCards = custom_data_helper.getTable("HIDDEN_CARD_DATA") - for k, v in ipairs(data_hiddenCards) do - table.insert(HIDDEN_CARD_DATA, v) - end + local custom_data_helper = getObjectFromGUID(args[1]) + local data_hiddenCards = custom_data_helper.getTable("HIDDEN_CARD_DATA") + for k, v in ipairs(data_hiddenCards) do + table.insert(HIDDEN_CARD_DATA, v) + end end