diff --git a/Arkham SCE.json b/Arkham SCE.json index 52f5ce5..cdabcf1 100644 --- a/Arkham SCE.json +++ b/Arkham SCE.json @@ -14,7 +14,7 @@ }, "Rotation": { "x": 64.34, - "y": 90.33, + "y": 90, "z": 0 }, "Zoomed": false @@ -223,22 +223,22 @@ { "Name": "header_cover", "Type": 0, - "URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977312342/0D22712378B1F9A5A1FC7DA40C355943C878DDC0/" + "URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753624/53E7443E2A9957BC5CA4D73B67D5C1C30971C9F9/" }, { "Name": "header_acolyte", "Type": 0, - "URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977311773/B8B2021D42CFB084AFDCCA42EE6B9A57F3E30AC6/" + "URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753484/961371448C1CB9F93D574E0F78CF51A88D0D34F6/" }, { - "Name": "header_ruins", + "Name": "header_compass", "Type": 0, - "URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977312917/E24A34736C912186C7AC58270E3819B6A44B3EE8/" + "URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889786684/52E2A801060A523AF5DD956C72A41889B5A1D2C9/" }, { "Name": "header_olive", "Type": 0, - "URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977377198/4E88B41107A29D027D86E6B80D47B03617335990/" + "URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753733/F67B7B37FF7AA253B6D697E577DF54A3E76030C2/" }, { "Name": "option_on", @@ -345,6 +345,11 @@ "Type": 0, "URL": "https://i.imgur.com/AFuB9II.png" }, + { + "Name": "Inv-Kohaku", + "Type": 0, + "URL": "http://cloud-3.steamusercontent.com/ugc/2279451480492739312/E59E79D4CFCFE60190BFD69B7FFBF1601DA3FAA5/" + }, { "Name": "TitleGradient", "Type": 0, @@ -371,7 +376,7 @@ "URL": "http://cloud-3.steamusercontent.com/ugc/2115061298538827369/A20C2ECB8ECDC1B0AD8B2B38F68CA1C1F5E07D37/" } ], - "Date": "Sat Nov 18 18:06:45 CST 2023", + "Date": "Thu Jan 25 01:22:12 UTC 2024", "DecalPallet": [ { "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1474319121424323663/BC5570ECF747F1B30224461B576E8B0FE7FA5F33/", @@ -385,7 +390,7 @@ } ], "Decals": [], - "EpochTime": 1700352405, + "EpochTime": 1706145732, "GameComplexity": "", "GameMode": "Arkham Horror LCG - Super Complete Edition", "GameType": "", @@ -444,8 +449,8 @@ "LutIndex": 0, "ReflectionIntensity": 1 }, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/Global\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal soundCubeApi = require(\"core/SoundCubeApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n---------------------------------------------------------\n-- general setup\n---------------------------------------------------------\n\nENCOUNTER_DECK_POS = { -3.93, 1, 5.76 }\nENCOUNTER_DECK_DISCARD_POSITION = { -3.85, 1, 10.38 }\n\n-- GUIDs that will not be interactable (e.g. parts of the table)\nlocal NOT_INTERACTABLE = {\n \"6161b4\", -- Decoration-Map\n \"721ba2\", -- PlayArea\n \"9f334f\", -- MythosArea\n \"463022\", -- Panel behind tentacle stand\n \"f182ee\", -- InvestigatorCount\n \"7bff34\", -- Tentacle stand\n \"8646eb\", -- horizontal border left\n \"75937e\", -- horizontal border right\n \"612072\", -- vertical border left\n \"975c39\", -- vertical border right\n}\n\n-- global variable for access\nchaosTokens = {}\nlocal chaosTokensLastMat = nil\n\nlocal bagSearchers = {}\nlocal MAT_COLORS = { \"White\", \"Orange\", \"Green\", \"Red\" }\nlocal hideTitleSplashWaitFunctionId = nil\n\n-- online functionality related variables\nlocal MOD_VERSION = \"3.4.0\"\nlocal SOURCE_REPO = 'https://raw.githubusercontent.com/chr1z93/loadable-objects/main'\nlocal library, requestObj, modMeta\nlocal acknowledgedUpgradeVersions = {}\nlocal contentToShow = \"campaigns\"\nlocal currentListItem = 1\nlocal xmlVisibility = {\n downloadWindow = false,\n optionPanel = false,\n playareaGallery = false,\n updateNotification = false\n}\nlocal tabIdTable = {\n tab1 = \"campaigns\",\n tab2 = \"scenarios\",\n tab3 = \"fanmadeCampaigns\",\n tab4 = \"fanmadeScenarios\",\n tab5 = \"fanmadePlayerCards\"\n}\n\n-- optionPanel data\noptionPanel = {}\nlocal LANGUAGES = {\n { code = \"zh_CN\", name = \"简体中文\" },\n { code = \"zh_TW\", name = \"繁體中文\" },\n { code = \"de\", name = \"Deutsch\" },\n { code = \"en\", name = \"English\" },\n { code = \"es\", name = \"Español\" },\n { code = \"fr\", name = \"Français\" },\n { code = \"it\", name = \"Italiano\" }\n}\nlocal RESOURCE_OPTIONS = {\n \"enabled\",\n \"custom\",\n \"disabled\"\n}\n\n---------------------------------------------------------\n-- data for tokens\n---------------------------------------------------------\n\nTOKEN_DATA = {\n damage = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357115146/903D11AAE7BD5C254C8DC136E9202EE516289DEA/\", scale = {0.17, 0.17, 0.17}},\n horror = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357163535/6D9E0756503664D65BDB384656AC6D4BD713F5FC/\", scale = {0.17, 0.17, 0.17}},\n resource = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/\", scale = {0.17, 0.17, 0.17}},\n doom = {image = \"https://i.imgur.com/EoL7yaZ.png\", scale = {0.17, 0.17, 0.17}},\n clue = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357164917/1D06F1DC4D6888B6F57124BD2AFE20D0B0DA15A8/\", scale = {0.15, 0.15, 0.15}}\n}\n\nID_URL_MAP = {\n ['blue'] = {name = \"Elder Sign\", url = 'https://i.imgur.com/nEmqjmj.png'},\n ['p1'] = {name = \"+1\", url = 'https://i.imgur.com/uIx8jbY.png'},\n ['0'] = {name = \"0\", url = 'https://i.imgur.com/btEtVfd.png'},\n ['m1'] = {name = \"-1\", url = 'https://i.imgur.com/w3XbrCC.png'},\n ['m2'] = {name = \"-2\", url = 'https://i.imgur.com/bfTg2hb.png'},\n ['m3'] = {name = \"-3\", url = 'https://i.imgur.com/yfs8gHq.png'},\n ['m4'] = {name = \"-4\", url = 'https://i.imgur.com/qrgGQRD.png'},\n ['m5'] = {name = \"-5\", url = 'https://i.imgur.com/3Ym1IeG.png'},\n ['m6'] = {name = \"-6\", url = 'https://i.imgur.com/c9qdSzS.png'},\n ['m7'] = {name = \"-7\", url = 'https://i.imgur.com/4WRD42n.png'},\n ['m8'] = {name = \"-8\", url = 'https://i.imgur.com/9t3rPTQ.png'},\n ['skull'] = {name = \"Skull\", url = 'https://i.imgur.com/stbBxtx.png'},\n ['cultist'] = {name = \"Cultist\", url = 'https://i.imgur.com/VzhJJaH.png'},\n ['tablet'] = {name = \"Tablet\", url = 'https://i.imgur.com/1plY463.png'},\n ['elder'] = {name = \"Elder Thing\", url = 'https://i.imgur.com/ttnspKt.png'},\n ['red'] = {name = \"Auto-fail\", url = 'https://i.imgur.com/lns4fhz.png'},\n ['bless'] = {name = \"Bless\", url = 'http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/'},\n ['curse'] = {name = \"Curse\", url = 'http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/'},\n\t['frost'] = {name = \"Frost\", url = 'http://cloud-3.steamusercontent.com/ugc/1858293462583104677/195F93C063A8881B805CE2FD4767A9718B27B6AE/'}\n}\n\n---------------------------------------------------------\n-- data for chaos token stat tracker\n---------------------------------------------------------\n\nlocal tokenDrawingStats = {\n [\"Overall\"] = {},\n [\"8b081b\"] = {},\n [\"bd0ff4\"] = {},\n [\"383d8b\"] = {},\n [\"0840d5\"] = {}\n}\n\n---------------------------------------------------------\n-- general code\n---------------------------------------------------------\n\n-- saving state of optionPanel to restore later\nfunction onSave()\n return JSON.encode({\n optionPanel = optionPanel,\n acknowledgedUpgradeVersions = acknowledgedUpgradeVersions\n })\nend\n\nfunction onLoad(savedData)\n if savedData then\n loadedData = JSON.decode(savedData)\n optionPanel = loadedData.optionPanel\n acknowledgedUpgradeVersions = loadedData.acknowledgedUpgradeVersions\n updateOptionPanelState()\n else\n print(\"Saved state could not be found!\")\n end\n\n for _, guid in ipairs(NOT_INTERACTABLE) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.interactable = false end\n end\n\n resetChaosTokenStatTracker()\n getModVersion()\n math.randomseed(os.time())\n\n -- initialization of loadable objects library (delay to let Navigation Overlay build)\n Wait.time(function()\n WebRequest.get(SOURCE_REPO .. '/library.json', libraryDownloadCallback)\n end, 1)\nend\n\n-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag\n-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the\n-- chaos bag during search operations to avoid this.\nfunction onObjectSearchStart(object, playerColor)\n chaosbag = findChaosBag()\n if object == chaosbag then\n bagSearchers[playerColor] = true\n end\nend\n\n-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag\n-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the\n-- chaos bag during search operations to avoid this.\nfunction onObjectSearchEnd(object, playerColor)\n chaosbag = findChaosBag()\n if object == chaosbag then\n bagSearchers[playerColor] = nil\n end\nend\n\n-- Pass object enter container events to the PlayArea to clear vector lines from dragged cards.\n-- This requires the try method as cards won't exist any more after they enter a deck, so the lines\n-- can't be cleared.\nfunction tryObjectEnterContainer(container, object)\n playAreaApi.tryObjectEnterContainer(container, object)\n return true\nend\n\n-- TTS event for objects that enter zones\n-- used to detect the \"token discard zones\" beneath the hand zones\nfunction onObjectEnterZone(zone, enteringObj)\n if zone.getName() ~= \"TokenDiscardZone\" then return end\n if tokenChecker.isChaosToken(enteringObj) then return end\n \n if enteringObj.type == \"Tile\" and enteringObj.getMemo() and enteringObj.getLock() == false then\n local matcolor = playmatApi.getMatColorByPosition(enteringObj.getPosition())\n local trash = guidReferenceApi.getObjectByOwnerAndType(matcolor, \"Trash\")\n trash.putObject(enteringObj)\n end\nend\n\n---------------------------------------------------------\n-- chaos token drawing\n---------------------------------------------------------\n\n-- checks scripting zone for chaos bag (also called by a lot of objects!)\nfunction findChaosBag()\n local chaosbag_zone = getObjectFromGUID(\"83ef06\")\n\n -- error handling: scripting zone not found\n if chaosbag_zone == nil then\n printToAll(\"Zone for chaos bag detection couldn't be found.\", \"Red\")\n return\n end\n\n for _, item in ipairs(chaosbag_zone.getObjects()) do\n if item.getDescription() == \"Chaos Bag\" then\n return item\n end\n end\n\n -- error handling: chaos bag not found\n printToAll(\"Chaos bag couldn't be found.\", \"Red\")\nend\n\nfunction returnChaosTokens()\n for _, token in pairs(chaosTokens) do\n if token ~= nil then chaosbag.putObject(token) end\n end\n chaosTokens = {}\nend\n\n-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n-- contents of the bag should check this method before doing so.\n-- This method will broadcast a message to all players if the bag is being searched.\n---@return Boolean. True if the bag is manipulated, false if it should be blocked.\nfunction canTouchChaosTokens()\n for color, searching in pairs(bagSearchers) do\n if searching then\n broadcastToAll(\"Someone is searching the chaos bag, can't touch the tokens.\", \"Red\")\n return false\n end\n end\n return true\nend\n\n-- called by playermats (by the \"Draw chaos token\" button)\nfunction drawChaosToken(params)\n if not canTouchChaosTokens() then return end\n\n local mat = params[1]\n local tokenOffset = params[2]\n local isRightClick = params[3]\n chaosbag = findChaosBag()\n\n -- return token(s) on other playmat first\n if chaosTokensLastMat ~= nil and chaosTokensLastMat ~= mat and #chaosTokens ~= 0 then\n returnChaosTokens()\n chaosTokensLastMat = nil\n return\n end\n\n chaosTokensLastMat = mat\n\n -- if we have left clicked and have no tokens OR if we have right clicked\n if isRightClick or #chaosTokens == 0 then\n if #chaosbag.getObjects() == 0 then return end\n chaosbag.shuffle()\n\n -- add the token to the list, compute new position based on list length\n tokenOffset[1] = tokenOffset[1] + (0.17 * #chaosTokens)\n local token = chaosbag.takeObject({\n index = 0,\n position = mat.positionToWorld(tokenOffset),\n rotation = mat.getRotation()\n })\n\n -- get data for token description\n local name = token.getName()\n local tokenData = mythosAreaApi.returnTokenData().tokenData or {}\n local specificData = tokenData[name] or {}\n token.setDescription(specificData.description or \"\")\n\n -- track the chaos token (for stat tracker and future returning)\n trackChaosToken(name, mat.getGUID())\n chaosTokens[#chaosTokens + 1] = token\n return\n else\n returnChaosTokens()\n end\nend\n\n---------------------------------------------------------\n-- token spawning\n---------------------------------------------------------\n\n-- DEPRECATED. Use TokenManager instead.\n-- Spawns a single token.\n---@param params Table. Array with arguments to the method. 1 = position, 2 = type, 3 = rotation\nfunction spawnToken(params)\n return tokenManager.spawnToken(params[1], params[2], params[3])\nend\n\n---------------------------------------------------------\n-- chaos token stat tracker\n---------------------------------------------------------\n\nfunction trackChaosToken(tokenName, matGUID)\n tokenDrawingStats[\"Overall\"][tokenName] = (tokenDrawingStats[\"Overall\"][tokenName] or 0) + 1\n tokenDrawingStats[matGUID][tokenName] = (tokenDrawingStats[matGUID][tokenName] or 0) + 1\nend\n\n-- Left-click: print stats, Right-click: reset stats\nfunction handleStatTrackerClick(_, _, isRightClick)\n if isRightClick then\n resetChaosTokenStatTracker()\n else\n local squidKing = \"Nobody\"\n local maxSquid = 0\n local foundAnyStats = false\n\n for key, personalStats in pairs(tokenDrawingStats) do\n local playerColor, playerName\n\n if key == \"Overall\" then\n playerColor = \"White\"\n playerName = \"Overall\"\n else\n -- get mat color\n local matColor = playmatApi.getMatColorByPosition(getObjectFromGUID(key).getPosition())\n playerColor = playmatApi.getPlayerColor(matColor)\n playerName = Player[playerColor].steam_name or playerColor\n\n local playerSquidCount = personalStats[\"Auto-fail\"]\n if playerSquidCount \u003e maxSquid then\n squidKing = playerName\n maxSquid = playerSquidCount\n end\n end\n\n -- get the total count of drawn tokens for the player\n local totalCount = 0\n for tokenName, value in pairs(personalStats) do\n totalCount = totalCount + value\n end\n\n -- only print the personal stats if any tokens were drawn\n if totalCount \u003e 0 then\n foundAnyStats = true\n printToAll(\"------------------------------\")\n printToAll(playerName .. \" Stats\", playerColor)\n\n for tokenName, value in pairs(personalStats) do\n if value ~= 0 then\n printToAll(tokenName .. ': ' .. tostring(value))\n end\n end\n printToAll('Total: ' .. tostring(totalCount))\n end\n end\n\n -- detect if any player drew tokens\n if foundAnyStats then\n printToAll(\"------------------------------\")\n printToAll(squidKing .. \" is an auto-fail magnet.\", { 255, 0, 0 })\n else\n printToAll(\"No tokens have been drawn yet.\", \"Yellow\")\n end\n end\nend\n\n-- resets the count for each token to 0\nfunction resetChaosTokenStatTracker()\n for key, _ in pairs(tokenDrawingStats) do\n tokenDrawingStats[key] = {}\n for _, token in pairs(ID_URL_MAP) do\n tokenDrawingStats[key][token.name] = 0\n end\n end\nend\n\n---------------------------------------------------------\n-- Difficulty selector script\n---------------------------------------------------------\n\n-- called for button creation on the difficulty selectors\n---@param object object Usually \"self\"\n---@param key string Name of the scenario\nfunction createSetupButtons(args)\n local data = getDataValue('modeData', args.key)\n if data ~= nil then\n local buttonParameters = {}\n buttonParameters.function_owner = args.object\n buttonParameters.position = { 0, 0.1, -0.15 }\n buttonParameters.scale = { 0.47, 1, 0.47 }\n buttonParameters.height = 200\n buttonParameters.width = 1150\n buttonParameters.color = { 0.87, 0.8, 0.7 }\n\n if data.easy ~= nil then\n buttonParameters.label = \"Easy\"\n buttonParameters.click_function = \"easyClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.normal ~= nil then\n buttonParameters.label = \"Standard\"\n buttonParameters.click_function = \"normalClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.hard ~= nil then\n buttonParameters.label = \"Hard\"\n buttonParameters.click_function = \"hardClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.expert ~= nil then\n buttonParameters.label = \"Expert\"\n buttonParameters.click_function = \"expertClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.standalone ~= nil then\n buttonParameters.label = \"Standalone\"\n buttonParameters.click_function = \"standaloneClick\"\n args.object.createButton(buttonParameters)\n end\n end\nend\n\n-- called for adding chaos tokens\n---@param object object Usually \"self\"\n---@param key string Name of the scenario\n---@param mode string difficulty (e.g. \"hard\" or \"expert\")\nfunction fillContainer(args)\n local data = getDataValue('modeData', args.key)\n if data == nil then return end\n\n local value = data[args.mode]\n if value == nil or value.token == nil then return end\n\n local tokenList = {}\n\n for _, tokenId in ipairs(value.token) do\n table.insert(tokenList, tokenId)\n end\n\n if value.append ~= nil then\n for _, tokenId in ipairs(value.append) do\n table.insert(tokenList, tokenId)\n end\n end\n\n -- randomly choose tokens for specific Carcosa scenarios in standalone\n if value.random then\n local n = #value.random\n if n \u003e 0 then\n for _, tokenId in ipairs(value.random[math.random(1, n)]) do\n table.insert(tokenList, tokenId)\n end\n end\n end\n\n setChaosBagState(tokenList)\n\n if value.message then\n broadcastToAll(value.message)\n end\n\n if value.warning then\n broadcastToAll(value.warning, { 1, 0.5, 0.5 })\n end\nend\n\nfunction getDataValue(storage, key)\n local DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n local data = DATA_HELPER.getTable(storage)\n if data ~= nil then\n local value = data[key]\n if value ~= nil then\n local res = {}\n for m, v in pairs(value) do\n res[m] = v\n if res[m].parent ~= nil then\n local parentData = getDataValue(storage, res[m].parent)\n if parentData ~= nil and parentData[m] ~= nil and parentData[m].token ~= nil then\n res[m].token = parentData[m].token\n end\n res[m].parent = nil\n end\n end\n return res\n end\n end\nend\n\nfunction createChaosTokenNameLookupTable()\n local namesToIds = {}\n for k, v in pairs(ID_URL_MAP) do\n namesToIds[v.name] = k\n end\n return namesToIds\nend\n\n-- returns a Table List of chaos token ids in the current chaos bag\n---@api chaosbag/ChaosBagApi\nfunction getChaosBagState()\n local tokens = {}\n local invertedTable = createChaosTokenNameLookupTable()\n local chaosbag = findChaosBag()\n\n for _, v in ipairs(chaosbag.getObjects()) do\n local id = invertedTable[v.name]\n if id then\n table.insert(tokens, id)\n else\n printToAll(v.name .. \" token not recognized. Will not be recorded.\", \"Yellow\")\n end\n end\n\n return tokens\nend\n\n-- respawns the chaos bag with a new state of tokens\n---@param tokenList Table List of chaos token ids\n---@api chaosbag/ChaosBagApi\nfunction setChaosBagState(tokenList)\n if not canTouchChaosTokens() then return end\n\n local chaosbag = findChaosBag()\n local chaosbagData = chaosbag.getData()\n local reserveData = getObjectFromGUID(\"106418\").getData()\n local tokenCache = {}\n local containedObjects = {}\n\n -- create a temporary copy of the data for each chaos token\n for _, objData in ipairs(reserveData.ContainedObjects) do\n tokenCache[objData.Nickname] = objData\n end\n\n -- iterate over tokenlist and insert specified tokens into new table\n for _, tokenId in ipairs(tokenList) do\n local tokenName = ID_URL_MAP[tokenId].name\n table.insert(containedObjects, tokenCache[tokenName])\n end\n\n -- overwrite chaos bag content and respawn it\n chaosbagData.ContainedObjects = containedObjects\n chaosbag.destruct()\n spawnObjectData({ data = chaosbagData })\n\n -- remove tokens that are still in play\n for _, token in pairs(chaosTokens) do\n if token ~= nil then token.destruct() end\n end\n chaosTokens = {}\n chaosTokensLastMat = nil\n\n -- reset bless / curse manager\n blessCurseManagerApi.removeTakenTokensAndReset()\n\n printToAll(\"Chaos bag set to chosen difficulty.\", \"Green\")\nend\n\n-- spawns the specified chaos token and puts it into the chaos bag\n---@param id String ID of the chaos token\nfunction spawnChaosToken(id)\n if not canTouchChaosTokens() then return end\n\n id = id:lower()\n local chaosbag = findChaosBag()\n local url = ID_URL_MAP[id].url or \"\"\n\n if url ~= \"\" then\n return spawnObject({\n type = 'Custom_Tile',\n position = { 0.49, 3, 0 },\n scale = { 0.81, 1.0, 0.81 },\n rotation = { 0, 270, 0 },\n callback_function = function(obj)\n obj.setName(ID_URL_MAP[id].name)\n chaosbag.putObject(obj)\n tokenArrangerApi.layout()\n end\n }).setCustomObject({\n type = 2,\n image = url,\n thickness = 0.1\n })\n end\nend\n\n-- removes the specified chaos token from the chaos bag\n---@param id String ID of the chaos token\nfunction removeChaosToken(id)\n if not canTouchChaosTokens() then return end\n\n local tokens = {}\n local chaosbag = findChaosBag()\n local name = ID_URL_MAP[id].name\n\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == name then table.insert(tokens, v.guid) end\n end\n\n -- error handling: no matching token found\n if #tokens == 0 then\n printToAll(\"No \" .. name .. \" tokens in the chaos bag.\", \"Yellow\")\n return\n end\n\n chaosbag.takeObject({\n guid = tokens[1],\n smooth = false,\n callback_function = function(obj)\n obj.destruct()\n tokenArrangerApi.layout()\n end\n })\n printToAll(\"Removing \" .. name .. \" token (in bag: \" .. #tokens - 1 .. \")\", \"White\")\nend\n\n-- empty the chaos bag\nfunction emptyChaosBag()\n if not canTouchChaosTokens() then return end\n\n local chaosbag = findChaosBag()\n for _, object in ipairs(chaosbag.getObjects()) do\n chaosbag.takeObject({ callback_function = function(item) item.destruct() end })\n end\nend\n\n-- returns all sealed tokens on cards to the chaos bag\nfunction releaseAllSealedTokens(playerColor)\n local chaosbag = findChaosBag()\n for _, obj in ipairs(getObjectsWithTag(\"CardThatSeals\")) do\n obj.call(\"releaseAllTokens\", playerColor)\n end\nend\n\n---------------------------------------------------------\n-- Content Importing and XML functions\n---------------------------------------------------------\n\n-- forwards the requested content type to the update function and sets highlight to clicked tab\n---@param tabId String Id of the clicked tab\nfunction onClick_tab(_, _, tabId)\n for listId, listContent in pairs(tabIdTable) do\n if listId == tabId then\n UI.setClass(listId, 'downloadTab activeTab')\n contentToShow = listContent\n else\n UI.setClass(listId, 'downloadTab')\n end\n end\n currentListItem = 1\n updateDownloadItemList()\nend\n\n-- click function for the items in the download window\n-- updates backgroundcolor for row panel and fontcolor for list item\nfunction onClick_select(_, _, identificationKey)\n UI.setAttribute(\"panel\" .. currentListItem, \"color\", \"clear\")\n UI.setAttribute(contentToShow .. \"_\" .. currentListItem, \"color\", \"white\")\n \n -- parses the identification key (contentToShow_currentListItem)\n if identificationKey then\n contentToShow = nil\n currentListItem = nil\n for str in string.gmatch(identificationKey, \"([^_]+)\") do\n if not contentToShow then\n -- grab the first part to know the content type\n contentToShow = str\n else\n -- get the index\n currentListItem = tonumber(str)\n break\n end\n end\n end\n\n UI.setAttribute(\"panel\" .. currentListItem, \"color\", \"grey\")\n UI.setAttribute(contentToShow .. \"_\" .. currentListItem, \"color\", \"black\")\n updatePreviewWindow()\nend\n\n-- click function for the download button in the preview window\nfunction onClick_download(player)\n local params = library[contentToShow][currentListItem]\n params.player = player\n placeholder_download(params)\nend\n\n-- the download button on the placeholder objects calls this to directly initiate a download\n---@param param Table contains url and guid of replacement object\nfunction placeholder_download(params)\n local url = SOURCE_REPO .. '/' .. params.url\n requestObj = WebRequest.get(url, function (request) contentDownloadCallback(request, params) end)\n startLuaCoroutine(Global, 'downloadCoroutine')\nend\n\nfunction downloadCoroutine()\n -- show progress bar\n UI.setAttribute('download_progress', 'active', true)\n\n -- update progress bar\n while requestObj do\n UI.setAttribute('download_progress', 'percentage', requestObj.download_progress * 100)\n coroutine.yield(0)\n end\n UI.setAttribute('download_progress', 'percentage', 100)\n\n -- wait 30 frames\n for i = 1, 30 do\n coroutine.yield(0)\n end\n\n -- hide progress bar\n UI.setAttribute('download_progress', 'active', false)\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\n return 1\nend\n\n-- spawns a bag that contains every object from the library\nfunction onClick_downloadAll()\n broadcastToAll(\"Download initiated - this will take a few minutes!\")\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\n\n startLuaCoroutine(Global, \"coroutineDownloadAll\")\nend\n\nfunction coroutineDownloadAll()\n local JSON = [[\n {\n \"Name\": \"Bag\",\n \"Transform\": {\n \"posX\": -39.5,\n \"posY\": 2,\n \"posZ\": -87,\n \"rotX\": 0,\n \"rotY\": 270,\n \"rotZ\": 0,\n \"scaleX\": 1.0,\n \"scaleY\": 1.0,\n \"scaleZ\": 1.0\n },\n \"Nickname\": \"All Downloadable Content\",\n \"Bag\": {\n \"Order\": 0\n },\n \"ContainedObjects\": [\n ]]\n \n local contained = \"\"\n local downloadedItems = 0\n local skippedItems = 0\n\n -- loop through the library to add content\n for contentType, objectList in pairs(library) do\n broadcastToAll(\"Downloading \" .. contentType .. \"...\")\n for _, params in ipairs(objectList) do\n local request = WebRequest.get(SOURCE_REPO .. '/' .. params.url)\n local start = os.time()\n while true do\n if request.is_done then\n contained = contained .. request.text .. \",\"\n downloadedItems = downloadedItems + 1\n break\n -- time-out if item can't be loaded in 5s\n elseif request.is_error or (os.time() - start) \u003e 5 then\n skippedItems = skippedItems + 1\n break\n end\n coroutine.yield(0)\n end\n end\n end\n\n JSON = JSON .. contained .. \"]}\"\n spawnObjectJSON({json = JSON})\n\n broadcastToAll(downloadedItems .. \" objects downloaded.\", \"Green\")\n broadcastToAll(skippedItems .. \" objects had a time-out / error.\", \"Orange\")\n return 1\nend\n\n-- spawns a placeholder box for the selected object\nfunction onClick_spawnPlaceholder()\n -- get object references\n local item = library[contentToShow][currentListItem]\n local dummy = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlaceholderBoxDummy\")\n \n -- error handling\n if not item.boxsize or item.boxsize == \"\" or not item.boxart or item.boxart == \"\" then\n print(\"Error loading object.\")\n return\n end\n\n -- get data for placeholder\n local spawnPos = {-39.5, 2, -87}\n\n local meshTable = {\n big = \"https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_MSH.obj\",\n small = \"https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj\",\n wide = \"http://pastebin.com/raw.php?i=uWAmuNZ2\"\n }\n\n local scaleTable = {\n big = {1.00, 0.14, 1.00},\n small = {2.21, 0.46, 2.42},\n wide = {2.00, 0.11, 1.69}\n }\n\n local placeholder = spawnObject({\n type = \"Custom_Model\",\n position = spawnPos,\n rotation = {0, 270, 0},\n scale = scaleTable[item.boxsize],\n })\n \n placeholder.setCustomObject({\n mesh = meshTable[item.boxsize],\n diffuse = item.boxart,\n material = 3\n })\n\n placeholder.setColorTint({1, 1, 1, 71/255})\n placeholder.setName(item.name)\n placeholder.setDescription(\"by \" .. (item.author or \"Unknown\"))\n placeholder.setGMNotes(item.url)\n placeholder.setLuaScript(dummy.getLuaScript())\n Player.getPlayers()[1].pingTable(spawnPos)\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\nend\n\n-- toggles the visibility of the respective UI\n---@param player LuaPlayer Player that triggered this\n---@param title String Name of the UI to toggle\nfunction onClick_toggleUi(player, title)\n if title == \"Navigation Overlay\" then\n navigationOverlayApi.cycleVisibility(player.color)\n return\n -- hide the playareaGallery if visible\n elseif title == \"downloadWindow\" and xmlVisibility.playareaGallery then\n onClick_toggleUi(_, \"playareaGallery\")\n -- hide the downloadWindow if visible\n elseif title == \"playareaGallery\" and xmlVisibility.downloadWindow then\n onClick_toggleUi(_, \"downloadWindow\")\n end\n\n if xmlVisibility[title] then\n -- small delay to allow button click sounds to play\n Wait.time(function() UI.hide(title) end, 0.1)\n else\n UI.show(title)\n end\n xmlVisibility[title] = not xmlVisibility[title]\nend\n\n-- forwards the call to the onClick function\nfunction togglePlayareaGallery()\n onClick_toggleUi(_, \"playareaGallery\")\nend\n\n-- updates the preview window\nfunction updatePreviewWindow()\n local item = library[contentToShow][currentListItem]\n local tempImage = \"http://cloud-3.steamusercontent.com/ugc/2115061845788345842/2CD6ABC551555CCF58F9D0DDB7620197BA398B06/\"\n\n -- set default image if not defined\n if item.boxsize == nil or item.boxsize == \"\" or item.boxart == nil or item.boxart == \"\" then\n item.boxsize = \"big\"\n item.boxart = \"http://cloud-3.steamusercontent.com/ugc/762723517667628371/18438B0A0045038A7099648AA3346DFCAA267C66/\"\n end\n\n UI.setValue(\"previewTitle\", item.name)\n UI.setValue(\"previewAuthor\", \"by \" .. (item.author or \"- Author not found -\"))\n UI.setValue(\"previewDescription\", item.description or \"- Description not found -\")\n\n -- update mask according to size (hardcoded values to align image in mask)\n local maskData = {}\n if item.boxsize == \"big\" then\n maskData = {\n image = \"box-cover-mask-big\",\n width = \"870\",\n height = \"435\",\n offsetXY = \"154 60\"\n }\n elseif item.boxsize == \"small\" then\n maskData = {\n image = \"box-cover-mask-small\",\n width = \"792\",\n height = \"594\",\n offsetXY = \"135 13\"\n }\n elseif item.boxsize == \"wide\" then\n maskData = {\n image = \"box-cover-mask-wide\",\n width = \"756\",\n height = \"630\",\n offsetXY = \"-190 -70\"\n }\n end\n\n -- loading empty image as placeholder until real image is loaded\n UI.setAttribute(\"previewArtImage\", \"image\", tempImage)\n \n -- insert the image itself\n UI.setAttribute(\"previewArtImage\", \"image\", item.boxart)\n UI.setAttributes(\"previewArtMask\", maskData)\nend\n\n-- formats the json response from the webrequest into a key-value lua table\n-- strips the prefix from the community content items\nfunction formatLibrary(json_response)\n library = {}\n library[\"campaigns\"] = json_response.campaigns\n library[\"scenarios\"] = json_response.scenarios\n library[\"extras\"] = json_response.extras\n library[\"fanmadeCampaigns\"] = {}\n library[\"fanmadeScenarios\"] = {}\n library[\"fanmadePlayerCards\"] = {}\n\n for _, item in ipairs(json_response.community) do\n local identifier = nil\n for str in string.gmatch(item.name, \"([^:]+)\") do\n if not identifier then\n -- grab the first part to know the content type\n identifier = str\n else\n -- update the name without the content type\n item.name = str\n break\n end\n end\n\n if identifier == \"Fan Investigators\" then\n table.insert(library[\"fanmadePlayerCards\"], item)\n elseif identifier == \"Fan Campaign\" then\n table.insert(library[\"fanmadeCampaigns\"], item)\n elseif identifier == \"Fan Scenario\" then\n table.insert(library[\"fanmadeScenarios\"], item)\n end\n end\nend\n\n-- updates the window content to the requested content\nfunction updateDownloadItemList()\n if not library then return end\n\n -- addition of list items according to library file\n local globalXml = UI.getXmlTable()\n local contentList = getXmlTableElementById(globalXml, 'contentList')\n\n contentList.children = {}\n for i, v in ipairs(library[contentToShow]) do\n table.insert(contentList.children,\n {\n tag = \"Panel\",\n attributes = { id = \"panel\" .. i },\n children = {\n tag = 'Text',\n value = v.name,\n attributes = {\n id = contentToShow .. \"_\" .. i,\n onClick = 'onClick_select',\n alignment = 'MiddleLeft'\n }\n }\n })\n end\n\n contentList.attributes.height = #contentList.children * 27\n UI.setXmlTable(globalXml)\n\n -- select the first item\n Wait.time(onClick_select, 0.2)\nend\n\n-- called after the webrequest of downloading an item\n-- deletes the placeholder and spawns the downloaded item\nfunction contentDownloadCallback(request, params)\n requestObj = nil\n\n -- error handling\n if request.is_error or request.response_code ~= 200 then\n print('Error: ' .. request.error)\n return\n end\n\n -- initiate content spawning\n local spawnTable = { json = request.text }\n if params.replace then\n local replacedObject = getObjectFromGUID(params.replace)\n if replacedObject then\n spawnTable.position = replacedObject.getPosition()\n spawnTable.rotation = replacedObject.getRotation()\n spawnTable.scale = replacedObject.getScale()\n destroyObject(replacedObject)\n end\n end\n\n -- if position is undefined, get empty position\n if not spawnTable.position then\n spawnTable.rotation = { 0, 270, 0}\n\n local pos = getValidSpawnPosition()\n if pos then\n spawnTable.position = pos\n else\n broadcastToAll(\"Please make space in the area below the tentacle stand in the upper middle of the table and try again.\", \"Red\")\n return\n end\n end\n\n -- if spawned from menu, move the camera and/or ping the table\n if params.name then\n spawnTable[\"callback_function\"] = function(obj)\n Wait.time(function()\n -- move camera\n if params.player then\n params.player.lookAt({\n position = obj.getPosition(),\n pitch = 65,\n yaw = 90,\n distance = 65\n })\n end\n \n -- ping object\n local pingPlayer = params.player or Player.getPlayers()[1]\n pingPlayer.pingTable(obj.getPosition())\n end, 0.1)\n end\n end\n\n if pcall(function() spawnObjectJSON(spawnTable) end) then\n print('Object loaded.')\n else\n print('Error loading object.')\n end\nend\n\n-- gets the first empty position to spawn a custom content object safely\nfunction getValidSpawnPosition()\n local potentialSpawnPositionX = { 65, 50, 35 }\n local potentialSpawnPositionY = 1.5\n local potentialSpawnPositionZ = { 35, 21, 7, -7, -21, -35 }\n\n for i, posX in ipairs(potentialSpawnPositionX) do\n for j, posZ in ipairs(potentialSpawnPositionZ) do\n local pos = {\n x = posX,\n y = potentialSpawnPositionY,\n z = posZ,\n }\n if checkPositionForContentSpawn(pos) then\n return pos\n end\n end\n end\n return nil\nend\n\n-- checks whether something is in the specified position\n-- returns true if empty\nfunction checkPositionForContentSpawn(checkPos)\n local search = Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0.1,\n type = 3,\n size = { 0.1, 0.1, 0.1 },\n origin = checkPos\n })\n -- first hit is the table surface, additional hits means something is there\n return #search == 1\nend\n\n-- downloading of the library file\nfunction libraryDownloadCallback(request)\n if request.is_error or request.response_code ~= 200 then\n print('error: ' .. request.error)\n return\n end\n\n local json_response = nil\n if pcall(function () json_response = JSON.decode(request.text) end) then\n formatLibrary(json_response)\n updateDownloadItemList()\n else\n print('error parsing downloaded library')\n end\nend\n\n-- loops through an XML table and returns the specified object\n---@param ui Table XmlTable (get this via getXmlTable)\n---@param id String Id of the object to return\nfunction getXmlTableElementById(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = getXmlTableElementById(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n---------------------------------------------------------\n-- Option Panel related functionality\n---------------------------------------------------------\n\n-- called by toggling an option\nfunction onClick_toggleOption(_, id)\n local state = self.UI.getAttribute(id, \"isOn\")\n\n -- flip state (and handle stupid \"False\" value)\n if state == \"False\" then\n state = true\n else\n state = false\n end\n\n self.UI.setAttribute(id, \"isOn\", state)\n applyOptionPanelChange(id, state)\nend\n\n-- called by the language selection dropdown\nfunction languageSelected(_, selectedIndex, id)\n optionPanel[id] = LANGUAGES[tonumber(selectedIndex) + 1].code\nend\n\n-- returns the ID (position in the table) for a provided language code\nfunction returnLanguageId(code)\n for index, tbl in ipairs(LANGUAGES) do\n if tbl.code == code then\n return index\n end\n end\nend\n\n-- called by the resource counter selection dropdown\nfunction resourceCounterSelected(_, selectedIndex, id)\n optionPanel[id] = RESOURCE_OPTIONS[tonumber(selectedIndex) + 1]\nend\n\n-- returns the ID for the provided option name\nfunction returnResourceCounterId(name)\n for index, optionName in ipairs(RESOURCE_OPTIONS) do\n if optionName == name then\n return index\n end\n end\nend\n\n-- sets the option panel to the correct state (corresponding to 'optionPanel')\nfunction updateOptionPanelState()\n for id, optionValue in pairs(optionPanel) do\n if id == \"cardLanguage\" and type(optionValue) == \"string\" then\n local dropdownId = returnLanguageId(optionValue) - 1\n UI.setAttribute(id, \"value\", dropdownId)\n elseif id == \"useResourceCounters\" and type(optionValue) == \"string\" then\n local dropdownId = returnResourceCounterId(optionValue) - 1\n UI.setAttribute(id, \"value\", dropdownId)\n elseif (type(optionValue) == \"boolean\" and optionValue)\n or (type(optionValue) == \"string\" and optionValue)\n or (type(optionValue) == \"table\" and #optionValue ~= 0) then\n UI.setAttribute(id, \"isOn\", true)\n else\n UI.setAttribute(id, \"isOn\", \"False\")\n end\n end\nend\n\n-- handles the applying of option selections and calls the respective functions based\n---@param id String ID of the option that was selected or deselected\n---@param state Boolean State of the option (true = enabled)\nfunction applyOptionPanelChange(id, state)\n -- option: Snap tags\n if id == \"useSnapTags\" then\n playmatApi.setLimitSnapsByType(state, \"All\")\n optionPanel[id] = state\n\n -- option: Draw 1 button\n elseif id == \"showDrawButton\" then\n playmatApi.showDrawButton(state, \"All\")\n optionPanel[id] = state\n\n -- option: Clickable clue counters\n elseif id == \"useClueClickers\" then\n playmatApi.clickableClues(state, \"All\")\n optionPanel[id] = state\n\n -- update master clue counter\n local counter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MasterClueCounter\")\n counter.setVar(\"useClickableCounters\", state)\n\n -- option: Play area snap tags\n elseif id == \"playAreaSnapTags\" then\n playAreaApi.setLimitSnapsByType(state)\n optionPanel[id] = state\n\n -- option: Show Title on placing scenarios\n elseif id == \"showTitleSplash\" then\n optionPanel[id] = state\n\n -- option: Show clean up helper\n elseif id == \"showCleanUpHelper\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Clean Up Helper\", {-66, 1.6, 46})\n\n -- option: Show hand helper for each player\n elseif id == \"showHandHelper\" then\n for i, color in ipairs(MAT_COLORS) do\n local pos = playmatApi.transformLocalPosition({0.05, 0, -1.182}, color)\n local rot = playmatApi.returnRotation(color)\n optionPanel[id][i] = spawnOrRemoveHelper(state, \"Hand Helper\", pos, rot)\n end\n\n -- option: Show search assistant for each player\n elseif id == \"showSearchAssistant\" then\n for i, color in ipairs(MAT_COLORS) do\n local pos = playmatApi.transformLocalPosition({-0.3, 0, -1.182}, color)\n local rot = playmatApi.returnRotation(color)\n optionPanel[id][i] = spawnOrRemoveHelper(state, \"Search Assistant\", pos, rot)\n end\n\n -- option: Show attachment helper\n elseif id == \"showAttachmentHelper\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Attachment Helper\", {-62, 1.4, 0})\n\n -- option: Show CYOA campaign guides\n elseif id == \"showCYOA\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"CYOA Campaign Guides\", {39, 1.3, -20})\n\n -- option: Show displacement tool\n elseif id == \"showDisplacementTool\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Displacement Tool\", {-57, 1.6, 46})\n end\nend\n\n-- handler for spawn / remove functions of helper objects\n---@param state Boolean Contains the state of the option: true = spawn it, false = remove it\n---@param name String Name of the helper object\n---@param position Vector Position of the object (where it will spawn)\n---@param rotation Vector Rotation of the object for spawning (default: {0, 270, 0})\n---@return. GUID of the spawnedObj (or nil if object was removed)\nfunction spawnOrRemoveHelper(state, name, position, rotation)\n if (type(state) == \"table\" and #state == 0) then\n return removeHelperObject(name)\n elseif state then\n Player.getPlayers()[1].pingTable(position)\n return spawnHelperObject(name, position, rotation).getGUID()\n else\n return removeHelperObject(name)\n end\nend\n\n-- copies the specified tool (by name) from the option panel source bag\n---@param name String Name of the object that should be copied\n---@param position Table Desired position of the object\n---@param rotation Table Desired rotation of the object (defaults to object's rotation)\nfunction spawnHelperObject(name, position, rotation)\n local sourceBag = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\",\"OptionPanelSource\")\n\n -- error handling for missing sourceBag\n if not sourceBag then\n broadcastToAll(\"Option panel source bag could not be found!\", \"Red\")\n return\n end\n\n local spawnTable = { position = position }\n\n -- only overrride rotation if there is one provided (object's rotation used instead)\n if rotation then\n spawnTable.rotation = rotation\n end\n\n for _, obj in ipairs(sourceBag.getData().ContainedObjects) do\n if obj[\"Nickname\"] == name then\n spawnTable.data = obj\n spawnTable.callback_function = function(spawnedObj)\n Wait.time(function() spawnedObj.setLock(true) end, 2)\n end\n return spawnObjectData(spawnTable)\n end\n end\nend\n\n-- removes the specified tool (by name)\n---@param name String Object that should be removed\nfunction removeHelperObject(name)\n -- links objects name to the respective option name (to grab the GUID for removal)\n local referenceTable = {\n [\"Clean Up Helper\"] = \"showCleanUpHelper\",\n [\"Hand Helper\"] = \"showHandHelper\",\n [\"Search Assistant\"] = \"showSearchAssistant\",\n [\"Displacement Tool\"] = \"showDisplacementTool\",\n [\"Attachment Helper\"] = \"showAttachmentHelper\",\n [\"CYOA Campaign Guides\"] = \"showCYOA\"\n }\n\n local data = optionPanel[referenceTable[name]]\n\n -- if there is a GUID stored, remove that object\n if type(data) == \"string\" then\n local obj = getObjectFromGUID(data)\n if obj then obj.destruct() end\n\n -- if it is a table (e.g. for the \"Hand Helper\", remove all of them)\n elseif type(data) == \"table\" then\n for _, guid in pairs(data) do\n local obj = getObjectFromGUID(guid)\n if obj then obj.destruct() end\n end\n end\nend\n\n-- loads saved options\nfunction loadSettings(newOptions)\n optionPanel = newOptions\n updateOptionPanelState()\n for id, state in pairs(optionPanel) do\n applyOptionPanelChange(id, state)\n end\nend\n\n-- loads the default options\nfunction onClick_defaultSettings()\n for id, _ in pairs(optionPanel) do\n local state = false\n -- override for settings that are enabled by default\n if id == \"useSnapTags\" or id == \"showTitleSplash\" then\n state = true\n end\n applyOptionPanelChange(id, state)\n end\n\n -- clean reset of variables\n optionPanel = {\n cardLanguage = \"en\",\n playAreaSnapTags = true,\n showAttachmentHelper = false,\n showCleanUpHelper = false,\n showCYOA = false,\n showDisplacementTool = false,\n showDrawButton = false,\n showHandHelper = {},\n showSearchAssistant = {},\n showTitleSplash = true,\n useClueClickers = false,\n useResourceCounters = \"disabled\",\n useSnapTags = true\n }\n\n -- update UI\n updateOptionPanelState()\nend\n\n-- splash scenario title on setup\nfunction titleSplash(scenarioName)\n if optionPanel['showTitleSplash'] then\n -- if there's any ongoing title being displayed, hide it and cancel the waiting function\n if hideTitleSplashWaitFunctionId then\n Wait.stop(hideTitleSplashWaitFunctionId)\n hideTitleSplashWaitFunctionId = nil\n UI.setAttribute('title_splash', 'active', false)\n end\n\n -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen)\n -- wait timer to hide the scenario name\n UI.setValue('title_splash_text', scenarioName)\n UI.show('title_splash')\n hideTitleSplashWaitFunctionId = Wait.time(function()\n UI.hide('title_splash')\n hideTitleSplashWaitFunctionId = nil\n end, 4)\n\n soundCubeApi.playSoundByName(\"Deep Bell\")\n end\nend\n\n---------------------------------------------------------\n-- Update notification related functionality\n---------------------------------------------------------\n\n-- grabs the latest mod version and release notes from GitHub (called onLoad())\nfunction getModVersion()\n WebRequest.get(SOURCE_REPO .. '/modversion.json', compareVersion)\nend\n\n-- compares the modversion with GitHub and possibly shows the update notification\nfunction compareVersion(request)\n if request.is_error then\n log(request.error)\n return\n end\n\n -- global variable to make it accessible for other functions\n modMeta = JSON.decode(request.text)\n\n -- stop here if on latest or newer version\n if convertVersionToNumber(MOD_VERSION) \u003e= convertVersionToNumber(modMeta[\"latestVersion\"]) then return end\n\n -- stop here if \"don't show again\" was clicked for this version before\n if acknowledgedUpgradeVersions[modMeta[\"latestVersion\"]] then return end\n\n updateNotificationLoading()\n\n -- delay to avoid lagging during onLoad()\n Wait.time(function() UI.show(\"FinnIcon\") end, 1)\nend\n\n-- converts a version number to a string\n---@param version String Version number, separated by dots (e.g. 3.3.1)\nfunction convertVersionToNumber(version)\n local major, minor, patch = string.match(version, \"(%d+)%.(%d+)%.(%d+)\")\n return major * 100 + minor * 10 + patch\nend\n\n-- updates the XML update notification based on the mod metadata\nfunction updateNotificationLoading()\n -- grab data\n local highlights = modMeta[\"releaseHighlights\"]\n\n -- concatenate the release highlights\n local highlightText = \"• \" .. highlights[1]\n for i, entry in pairs(highlights) do\n if i ~= 1 then\n highlightText = highlightText .. \"\\n• \" .. entry\n end\n end\n\n -- update the XML UI\n UI.setValue(\"notificationHeader\", \"New version available: \" .. modMeta[\"latestVersion\"])\n UI.setValue(\"releaseHighlightText\", highlightText)\n UI.setAttribute(\"highlightRow\", \"preferredHeight\", 20*#highlights)\n UI.setAttribute(\"updateNotification\", \"height\", 20*#highlights + 125)\nend\n\n-- close / don't show again buttons on the update notification\nfunction onClick_notification(_, parameter)\n if parameter == \"dontShowAgain\" then\n -- this variable tracks if \"don't show again\" was pressed for a version\n acknowledgedUpgradeVersions[modMeta[\"latestVersion\"]] = true\n end\n UI.hide(\"FinnIcon\")\n UI.hide(\"updateNotification\")\n xmlVisibility[\"updateNotification\"] = false\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/SoundCubeApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SoundCubeApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- this table links the name of a trigger effect to its index\n local soundIndices = {\n [\"Vacuum\"] = 0,\n [\"Deep Bell\"] = 1,\n [\"Dark Souls\"] = 2\n }\n\n local function playTriggerEffect(index)\n local SoundCube = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"SoundCube\")\n SoundCube.AssetBundle.playTriggerEffect(index)\n end\n\n -- plays the by name requested sound\n ---@param soundName String Name of the sound to play\n SoundCubeApi.playSoundByName = function(soundName)\n playTriggerEffect(soundIndices[soundName])\n end\n\n return SoundCubeApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/Global\")\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", - "LuaScriptState": "{\"acknowledgedUpgradeVersions\":[],\"optionPanel\":{\"cardLanguage\":\"en\",\"playAreaSnapTags\":true,\"showAttachmentHelper\":false,\"showCleanUpHelper\":false,\"showCYOA\":false,\"showDisplacementTool\":false,\"showDrawButton\":false,\"showHandHelper\":[],\"showSearchAssistant\":[],\"showTitleSplash\":true,\"useClueClickers\":false,\"useResourceCounters\":\"disabled\",\"useSnapTags\":true}}", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/SoundCubeApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SoundCubeApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- this table links the name of a trigger effect to its index\n local soundIndices = {\n [\"Vacuum\"] = 0,\n [\"Deep Bell\"] = 1,\n [\"Dark Souls\"] = 2\n }\n\n local function playTriggerEffect(index)\n local SoundCube = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"SoundCube\")\n SoundCube.AssetBundle.playTriggerEffect(index)\n end\n\n -- plays the by name requested sound\n ---@param soundName String Name of the sound to play\n SoundCubeApi.playSoundByName = function(soundName)\n playTriggerEffect(soundIndices[soundName])\n end\n\n return SoundCubeApi\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/Global\")\nend)\n__bundle_register(\"core/Global\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal soundCubeApi = require(\"core/SoundCubeApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n---------------------------------------------------------\n-- general setup\n---------------------------------------------------------\n\nENCOUNTER_DECK_POS = { -3.93, 1, 5.76 }\nENCOUNTER_DECK_DISCARD_POSITION = { -3.85, 1, 10.38 }\n\n-- GUIDs that will not be interactable (e.g. parts of the table)\nlocal NOT_INTERACTABLE = {\n \"6161b4\", -- Decoration-Map\n \"9f334f\", -- MythosArea\n \"463022\", -- Panel behind tentacle stand\n \"f182ee\", -- InvestigatorCount\n \"7bff34\", -- Tentacle stand\n \"8646eb\", -- horizontal border left\n \"75937e\", -- horizontal border right\n \"612072\", -- vertical border left\n \"975c39\", -- vertical border right\n}\n\nlocal chaosTokens = {}\nlocal chaosTokensLastMatGUID = nil\n\n-- chaos token stat tracking\nlocal tokenDrawingStats = { [\"Overall\"] = {} }\n\nlocal bagSearchers = {}\nlocal MAT_COLORS = { \"White\", \"Orange\", \"Green\", \"Red\" }\nlocal hideTitleSplashWaitFunctionId = nil\n\n-- online functionality related variables\nlocal MOD_VERSION = \"3.5.0\"\nlocal SOURCE_REPO = 'https://raw.githubusercontent.com/chr1z93/loadable-objects/main'\nlocal library, requestObj, modMeta\nlocal acknowledgedUpgradeVersions = {}\nlocal contentToShow = \"campaigns\"\nlocal currentListItem = 1\nlocal xmlVisibility = {\n downloadWindow = false,\n optionPanel = false,\n playAreaGallery = false,\n updateNotification = false\n}\nlocal tabIdTable = {\n tab1 = \"campaigns\",\n tab2 = \"scenarios\",\n tab3 = \"fanmadeCampaigns\",\n tab4 = \"fanmadeScenarios\",\n tab5 = \"fanmadePlayerCards\"\n}\n\n-- optionPanel data\noptionPanel = {}\nlocal LANGUAGES = {\n { code = \"zh_CN\", name = \"简体中文\" },\n { code = \"zh_TW\", name = \"繁體中文\" },\n { code = \"de\", name = \"Deutsch\" },\n { code = \"en\", name = \"English\" },\n { code = \"es\", name = \"Español\" },\n { code = \"fr\", name = \"Français\" },\n { code = \"it\", name = \"Italiano\" }\n}\nlocal RESOURCE_OPTIONS = {\n \"enabled\",\n \"custom\",\n \"disabled\"\n}\n\n---------------------------------------------------------\n-- data for tokens\n---------------------------------------------------------\n\nTOKEN_DATA = {\n damage = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357115146/903D11AAE7BD5C254C8DC136E9202EE516289DEA/\", scale = {0.17, 0.17, 0.17}},\n horror = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357163535/6D9E0756503664D65BDB384656AC6D4BD713F5FC/\", scale = {0.17, 0.17, 0.17}},\n resource = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/\", scale = {0.17, 0.17, 0.17}},\n doom = {image = \"https://i.imgur.com/EoL7yaZ.png\", scale = {0.17, 0.17, 0.17}},\n clue = {image = \"http://cloud-3.steamusercontent.com/ugc/1758068501357164917/1D06F1DC4D6888B6F57124BD2AFE20D0B0DA15A8/\", scale = {0.15, 0.15, 0.15}}\n}\n\nID_URL_MAP = {\n ['blue'] = {name = \"Elder Sign\", url = 'https://i.imgur.com/nEmqjmj.png'},\n ['p1'] = {name = \"+1\", url = 'https://i.imgur.com/uIx8jbY.png'},\n ['0'] = {name = \"0\", url = 'https://i.imgur.com/btEtVfd.png'},\n ['m1'] = {name = \"-1\", url = 'https://i.imgur.com/w3XbrCC.png'},\n ['m2'] = {name = \"-2\", url = 'https://i.imgur.com/bfTg2hb.png'},\n ['m3'] = {name = \"-3\", url = 'https://i.imgur.com/yfs8gHq.png'},\n ['m4'] = {name = \"-4\", url = 'https://i.imgur.com/qrgGQRD.png'},\n ['m5'] = {name = \"-5\", url = 'https://i.imgur.com/3Ym1IeG.png'},\n ['m6'] = {name = \"-6\", url = 'https://i.imgur.com/c9qdSzS.png'},\n ['m7'] = {name = \"-7\", url = 'https://i.imgur.com/4WRD42n.png'},\n ['m8'] = {name = \"-8\", url = 'https://i.imgur.com/9t3rPTQ.png'},\n ['skull'] = {name = \"Skull\", url = 'https://i.imgur.com/stbBxtx.png'},\n ['cultist'] = {name = \"Cultist\", url = 'https://i.imgur.com/VzhJJaH.png'},\n ['tablet'] = {name = \"Tablet\", url = 'https://i.imgur.com/1plY463.png'},\n ['elder'] = {name = \"Elder Thing\", url = 'https://i.imgur.com/ttnspKt.png'},\n ['red'] = {name = \"Auto-fail\", url = 'https://i.imgur.com/lns4fhz.png'},\n ['bless'] = {name = \"Bless\", url = 'http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/'},\n ['curse'] = {name = \"Curse\", url = 'http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/'},\n\t['frost'] = {name = \"Frost\", url = 'http://cloud-3.steamusercontent.com/ugc/1858293462583104677/195F93C063A8881B805CE2FD4767A9718B27B6AE/'}\n}\n\n---------------------------------------------------------\n-- general code\n---------------------------------------------------------\n\n-- saving state of optionPanel to restore later\nfunction onSave()\n local chaosTokensGUID = {}\n for _, obj in ipairs(chaosTokens) do\n if obj ~= nil then\n table.insert(chaosTokensGUID, obj.getGUID())\n end\n end\n\n return JSON.encode({\n optionPanel = optionPanel,\n acknowledgedUpgradeVersions = acknowledgedUpgradeVersions,\n chaosTokensLastMatGUID = chaosTokensLastMatGUID,\n chaosTokensGUID = chaosTokensGUID\n })\nend\n\nfunction onLoad(savedData)\n if savedData then\n loadedData = JSON.decode(savedData)\n optionPanel = loadedData.optionPanel\n acknowledgedUpgradeVersions = loadedData.acknowledgedUpgradeVersions\n updateOptionPanelState()\n\n -- restore saved state for drawn chaos tokens\n for _, guid in ipairs(loadedData.chaosTokensGUID or {}) do\n table.insert(chaosTokens, getObjectFromGUID(guid))\n end\n chaosTokensLastMatGUID = loadedData.chaosTokensLastMatGUID\n else\n print(\"Saved state could not be found!\")\n end\n\n for _, guid in ipairs(NOT_INTERACTABLE) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.interactable = false end\n end\n\n getModVersion()\n math.randomseed(os.time())\n\n -- initialization of loadable objects library (delay to let Navigation Overlay build)\n Wait.time(function()\n WebRequest.get(SOURCE_REPO .. '/library.json', libraryDownloadCallback)\n end, 1)\nend\n\n-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag\n-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the\n-- chaos bag during search operations to avoid this.\nfunction onObjectSearchStart(object, playerColor)\n local chaosBag = findChaosBag()\n if object == chaosBag then\n bagSearchers[playerColor] = true\n end\nend\n\n-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag\n-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the\n-- chaos bag during search operations to avoid this.\nfunction onObjectSearchEnd(object, playerColor)\n local chaosBag = findChaosBag()\n if object == chaosBag then\n bagSearchers[playerColor] = nil\n end\nend\n\n-- Pass object enter container events to the PlayArea to clear vector lines from dragged cards.\n-- This requires the try method as cards won't exist any more after they enter a deck, so the lines\n-- can't be cleared.\nfunction tryObjectEnterContainer(container, object)\n playAreaApi.tryObjectEnterContainer(container, object)\n return true\nend\n\n-- TTS event for objects that enter zones\n-- used to detect the \"token discard zones\" beneath the hand zones\nfunction onObjectEnterZone(zone, enteringObj)\n if zone.getName() ~= \"TokenDiscardZone\" then return end\n if tokenChecker.isChaosToken(enteringObj) then return end\n \n if enteringObj.type == \"Tile\" and enteringObj.getMemo() and enteringObj.getLock() == false then\n local matcolor = playmatApi.getMatColorByPosition(enteringObj.getPosition())\n local trash = guidReferenceApi.getObjectByOwnerAndType(matcolor, \"Trash\")\n trash.putObject(enteringObj)\n end\nend\n\n-- handle card drawing via number typing for multihanded gameplay\n-- (and additionally allow Norman Withers to draw multiple cards via number)\nfunction onObjectNumberTyped(hoveredObject, playerColor, number)\n -- only continue for decks or cards\n if hoveredObject.type ~= \"Deck\" and hoveredObject.type ~= \"Card\" then return end\n \n -- check whether the hovered object is part of a players draw objects\n for _, color in ipairs(playmatApi.getUsedMatColors()) do\n local deckAreaObjects = playmatApi.getDeckAreaObjects(color)\n if deckAreaObjects.topCard == hoveredObject or deckAreaObjects.draw == hoveredObject then\n playmatApi.drawCardsWithReshuffle(color, number)\n return true\n end\n end\nend\n\n---------------------------------------------------------\n-- chaos token drawing\n---------------------------------------------------------\n\n-- checks scripting zone for chaos bag (also called by a lot of objects!)\nfunction findChaosBag()\n local chaosBagZone = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"ChaosBagZone\")\n\n -- error handling: scripting zone not found\n if chaosBagZone == nil then\n printToAll(\"Zone for chaos bag detection couldn't be found.\", \"Red\")\n return\n end\n\n for _, item in ipairs(chaosBagZone.getObjects()) do\n if item.getDescription() == \"Chaos Bag\" then\n return item\n end\n end\n\n -- error handling: chaos bag not found\n printToAll(\"Chaos bag couldn't be found.\", \"Red\")\nend\n\nfunction returnChaosTokens()\n local chaosBag = findChaosBag()\n for _, token in pairs(chaosTokens) do\n if token ~= nil then chaosBag.putObject(token) end\n end\n chaosTokens = {}\nend\n\n-- returns a single chaos token to the bag and calls respective functions\nfunction returnChaosTokenToBag(token)\n local name = token.getName()\n local guid = token.getGUID()\n local chaosBag = findChaosBag()\n chaosBag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n-- contents of the bag should check this method before doing so.\n-- This method will broadcast a message to all players if the bag is being searched.\n---@return Boolean. True if the bag is manipulated, false if it should be blocked.\nfunction canTouchChaosTokens()\n for color, searching in pairs(bagSearchers) do\n if searching then\n broadcastToAll(\"Someone is searching the chaos bag, can't touch the tokens.\", \"Red\")\n return false\n end\n end\n return true\nend\n\n-- called by playermats (by the \"Draw chaos token\" button)\nfunction drawChaosToken(params)\n if not canTouchChaosTokens() then return end\n\n local tokenOffset = {-1.55, 0.25, -0.58}\n local matGUID = params.mat.getGUID()\n\n -- return token(s) on other playmat first\n if chaosTokensLastMatGUID ~= nil and chaosTokensLastMatGUID ~= matGUID and #chaosTokens ~= 0 then\n returnChaosTokens()\n chaosTokensLastMatGUID = nil\n return\n end\n\n chaosTokensLastMatGUID = matGUID\n\n -- if we have left clicked and have no tokens OR if we have right clicked\n if params.drawAdditional or #chaosTokens == 0 then\n local chaosBag = findChaosBag()\n if #chaosBag.getObjects() == 0 then return end\n chaosBag.shuffle()\n\n -- add the token to the list, compute new position based on list length\n tokenOffset[1] = tokenOffset[1] + (0.17 * #chaosTokens)\n local token = chaosBag.takeObject({\n index = 0,\n position = params.mat.positionToWorld(tokenOffset),\n rotation = params.mat.getRotation()\n })\n\n -- get data for token description\n local name = token.getName()\n local tokenData = mythosAreaApi.returnTokenData().tokenData or {}\n local specificData = tokenData[name] or {}\n token.setDescription(specificData.description or \"\")\n\n -- track the chaos token (for stat tracker and future returning)\n trackChaosToken(name, matGUID)\n chaosTokens[#chaosTokens + 1] = token\n else\n returnChaosTokens()\n end\nend\n\n---------------------------------------------------------\n-- token spawning\n---------------------------------------------------------\n\n-- DEPRECATED. Use TokenManager instead.\n-- Spawns a single token.\n---@param params Table. Array with arguments to the method. 1 = position, 2 = type, 3 = rotation\nfunction spawnToken(params)\n return tokenManager.spawnToken(params[1], params[2], params[3])\nend\n\n---------------------------------------------------------\n-- chaos token stat tracker\n---------------------------------------------------------\n\nfunction trackChaosToken(tokenName, matGUID)\n -- initialize tables\n if not tokenDrawingStats[matGUID] then tokenDrawingStats[matGUID] = {} end\n\n -- increase stats by 1\n tokenDrawingStats[\"Overall\"][tokenName] = (tokenDrawingStats[\"Overall\"][tokenName] or 0) + 1\n tokenDrawingStats[matGUID][tokenName] = (tokenDrawingStats[matGUID][tokenName] or 0) + 1\nend\n\n-- Left-click: print stats, Right-click: reset stats\nfunction handleStatTrackerClick(_, _, isRightClick)\n if isRightClick then\n resetChaosTokenStatTracker()\n else\n local squidKing = \"Nobody\"\n local maxSquid = 0\n local foundAnyStats = false\n\n for key, personalStats in pairs(tokenDrawingStats) do\n local playerColor, playerName\n\n if key == \"Overall\" then\n playerColor = \"White\"\n playerName = \"Overall\"\n else\n -- get mat color\n local matColor = playmatApi.getMatColorByPosition(getObjectFromGUID(key).getPosition())\n playerColor = playmatApi.getPlayerColor(matColor)\n playerName = Player[playerColor].steam_name or playerColor\n\n local playerSquidCount = personalStats[\"Auto-fail\"] or 0\n if playerSquidCount \u003e maxSquid then\n squidKing = playerName\n maxSquid = playerSquidCount\n end\n end\n\n -- get the total count of drawn tokens for the player\n local totalCount = 0\n for tokenName, value in pairs(personalStats) do\n totalCount = totalCount + value\n end\n\n -- only print the personal stats if any tokens were drawn\n if totalCount \u003e 0 then\n foundAnyStats = true\n printToAll(\"------------------------------\")\n printToAll(playerName .. \" Stats\", playerColor)\n\n for tokenName, value in pairs(personalStats) do\n if value ~= 0 then\n printToAll(tokenName .. ': ' .. tostring(value))\n end\n end\n printToAll('Total: ' .. tostring(totalCount))\n end\n end\n\n -- detect if any player drew tokens\n if foundAnyStats then\n printToAll(\"------------------------------\")\n printToAll(squidKing .. \" is an auto-fail magnet.\", { 255, 0, 0 })\n else\n printToAll(\"No tokens have been drawn yet.\", \"Yellow\")\n end\n end\nend\n\n-- resets the count for each token to 0\nfunction resetChaosTokenStatTracker()\n tokenDrawingStats = { [\"Overall\"] = {} }\nend\n\n---------------------------------------------------------\n-- Difficulty selector script\n---------------------------------------------------------\n\n-- called for button creation on the difficulty selectors\n---@param args Table Parameters for this function:\n-- object TTSObject Usually \"self\"\n-- key String Name of the scenario\nfunction createSetupButtons(args)\n local data = getDataValue('modeData', args.key)\n if data ~= nil then\n local buttonParameters = {}\n buttonParameters.function_owner = args.object\n buttonParameters.position = { 0, 0.1, -0.15 }\n buttonParameters.scale = { 0.47, 1, 0.47 }\n buttonParameters.height = 200\n buttonParameters.width = 1150\n buttonParameters.color = { 0.87, 0.8, 0.7 }\n\n if data.easy ~= nil then\n buttonParameters.label = \"Easy\"\n buttonParameters.click_function = \"easyClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.normal ~= nil then\n buttonParameters.label = \"Standard\"\n buttonParameters.click_function = \"normalClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.hard ~= nil then\n buttonParameters.label = \"Hard\"\n buttonParameters.click_function = \"hardClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.expert ~= nil then\n buttonParameters.label = \"Expert\"\n buttonParameters.click_function = \"expertClick\"\n args.object.createButton(buttonParameters)\n buttonParameters.position[3] = buttonParameters.position[3] + 0.20\n end\n\n if data.standalone ~= nil then\n buttonParameters.label = \"Standalone\"\n buttonParameters.click_function = \"standaloneClick\"\n args.object.createButton(buttonParameters)\n end\n end\nend\n\n-- called for adding chaos tokens\n---@param args Table Parameters for this function:\n-- object object Usually \"self\"\n-- key string Name of the scenario\n-- mode string difficulty (e.g. \"hard\" or \"expert\")\nfunction fillContainer(args)\n local data = getDataValue('modeData', args.key)\n if data == nil then return end\n\n local value = data[args.mode]\n if value == nil or value.token == nil then return end\n\n local tokenList = {}\n\n for _, tokenId in ipairs(value.token) do\n table.insert(tokenList, tokenId)\n end\n\n if value.append ~= nil then\n for _, tokenId in ipairs(value.append) do\n table.insert(tokenList, tokenId)\n end\n end\n\n -- randomly choose tokens for specific Carcosa scenarios in standalone\n if value.random then\n local n = #value.random\n if n \u003e 0 then\n for _, tokenId in ipairs(value.random[math.random(1, n)]) do\n table.insert(tokenList, tokenId)\n end\n end\n end\n\n setChaosBagState(tokenList)\n\n if value.message then\n broadcastToAll(value.message)\n end\n\n if value.warning then\n broadcastToAll(value.warning, { 1, 0.5, 0.5 })\n end\nend\n\nfunction getDataValue(storage, key)\n local DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n local data = DATA_HELPER.getTable(storage)\n if data ~= nil then\n local value = data[key]\n if value ~= nil then\n local res = {}\n for m, v in pairs(value) do\n res[m] = v\n if res[m].parent ~= nil then\n local parentData = getDataValue(storage, res[m].parent)\n if parentData ~= nil and parentData[m] ~= nil and parentData[m].token ~= nil then\n res[m].token = parentData[m].token\n end\n res[m].parent = nil\n end\n end\n return res\n end\n end\nend\n\nfunction createChaosTokenNameLookupTable()\n local namesToIds = {}\n for k, v in pairs(ID_URL_MAP) do\n namesToIds[v.name] = k\n end\n return namesToIds\nend\n\n-- returns the currently drawn chaos tokens\n---@api ChaosBagApi\nfunction getChaosTokensinPlay()\n return chaosTokens\nend\n\n-- returns a Table List of chaos token ids in the current chaos bag\n---@api ChaosBag / ChaosBagApi\nfunction getChaosBagState()\n local tokens = {}\n local invertedTable = createChaosTokenNameLookupTable()\n local chaosBag = findChaosBag()\n\n for _, v in ipairs(chaosBag.getObjects()) do\n local id = invertedTable[v.name]\n if id then\n table.insert(tokens, id)\n else\n printToAll(v.name .. \" token not recognized. Will not be recorded.\", \"Yellow\")\n end\n end\n\n return tokens\nend\n\n-- respawns the chaos bag with a new state of tokens\n---@param tokenList Table List of chaos token ids\n---@api ChaosBag / ChaosBagApi\nfunction setChaosBagState(tokenList)\n if not canTouchChaosTokens() then return end\n\n local chaosBag = findChaosBag()\n local chaosBagData = chaosBag.getData()\n local reserveData = getObjectFromGUID(\"106418\").getData()\n local tokenCache = {}\n local containedObjects = {}\n\n -- create a temporary copy of the data for each chaos token\n for _, objData in ipairs(reserveData.ContainedObjects) do\n tokenCache[objData.Nickname] = objData\n end\n\n -- iterate over tokenlist and insert specified tokens into new table\n for _, tokenId in ipairs(tokenList) do\n local tokenName = ID_URL_MAP[tokenId].name\n table.insert(containedObjects, tokenCache[tokenName])\n end\n\n -- overwrite chaos bag content and respawn it\n chaosBagData.ContainedObjects = containedObjects\n chaosBag.destruct()\n spawnObjectData({ data = chaosBagData })\n\n -- remove tokens that are still in play\n for _, token in pairs(chaosTokens) do\n if token ~= nil then token.destruct() end\n end\n chaosTokens = {}\n chaosTokensLastMatGUID = nil\n\n -- reset bless / curse manager\n blessCurseManagerApi.removeTakenTokensAndReset()\n\n printToAll(\"Chaos bag set to chosen difficulty.\", \"Green\")\nend\n\n-- spawns the specified chaos token and puts it into the chaos bag\n---@param id String ID of the chaos token\nfunction spawnChaosToken(id)\n if not canTouchChaosTokens() then return end\n\n id = id:lower()\n local chaosBag = findChaosBag()\n local url = ID_URL_MAP[id].url or \"\"\n\n if url ~= \"\" then\n return spawnObject({\n type = 'Custom_Tile',\n position = { 0.49, 3, 0 },\n scale = { 0.81, 1.0, 0.81 },\n rotation = { 0, 270, 0 },\n callback_function = function(obj)\n obj.setName(ID_URL_MAP[id].name)\n chaosBag.putObject(obj)\n tokenArrangerApi.layout()\n end\n }).setCustomObject({\n type = 2,\n image = url,\n thickness = 0.1\n })\n end\nend\n\n-- removes the specified chaos token from the chaos bag\n---@param id String ID of the chaos token\nfunction removeChaosToken(id)\n if not canTouchChaosTokens() then return end\n\n local tokens = {}\n local chaosBag = findChaosBag()\n local name = ID_URL_MAP[id].name\n\n for _, v in ipairs(chaosBag.getObjects()) do\n if v.name == name then table.insert(tokens, v.guid) end\n end\n\n -- error handling: no matching token found\n if #tokens == 0 then\n printToAll(\"No \" .. name .. \" tokens in the chaos bag.\", \"Yellow\")\n return\n end\n\n chaosBag.takeObject({\n guid = tokens[1],\n smooth = false,\n callback_function = function(obj)\n obj.destruct()\n tokenArrangerApi.layout()\n end\n })\n printToAll(\"Removing \" .. name .. \" token (in bag: \" .. #tokens - 1 .. \")\", \"White\")\nend\n\n-- empty the chaos bag\nfunction emptyChaosBag()\n if not canTouchChaosTokens() then return end\n\n local chaosBag = findChaosBag()\n for _, object in ipairs(chaosBag.getObjects()) do\n chaosBag.takeObject({ callback_function = function(item) item.destruct() end })\n end\nend\n\n-- returns all sealed tokens on cards to the chaos bag\nfunction releaseAllSealedTokens(playerColor)\n local chaosBag = findChaosBag()\n for _, obj in ipairs(getObjectsWithTag(\"CardThatSeals\")) do\n obj.call(\"releaseAllTokens\", playerColor)\n end\nend\n\n---------------------------------------------------------\n-- Content Importing and XML functions\n---------------------------------------------------------\n\n-- forwards the requested content type to the update function and sets highlight to clicked tab\n---@param tabId String Id of the clicked tab\nfunction onClick_tab(_, _, tabId)\n for listId, listContent in pairs(tabIdTable) do\n if listId == tabId then\n UI.setClass(listId, 'downloadTab activeTab')\n contentToShow = listContent\n else\n UI.setClass(listId, 'downloadTab')\n end\n end\n currentListItem = 1\n updateDownloadItemList()\nend\n\n-- click function for the items in the download window\n-- updates backgroundcolor for row panel and fontcolor for list item\nfunction onClick_select(_, _, identificationKey)\n UI.setAttribute(\"panel\" .. currentListItem, \"color\", \"clear\")\n UI.setAttribute(contentToShow .. \"_\" .. currentListItem, \"color\", \"white\")\n \n -- parses the identification key (contentToShow_currentListItem)\n if identificationKey then\n contentToShow = nil\n currentListItem = nil\n for str in string.gmatch(identificationKey, \"([^_]+)\") do\n if not contentToShow then\n -- grab the first part to know the content type\n contentToShow = str\n else\n -- get the index\n currentListItem = tonumber(str)\n break\n end\n end\n end\n\n UI.setAttribute(\"panel\" .. currentListItem, \"color\", \"grey\")\n UI.setAttribute(contentToShow .. \"_\" .. currentListItem, \"color\", \"black\")\n updatePreviewWindow()\nend\n\n-- click function for the \"Custom URL\" button in the playarea image gallery\nfunction onClick_customUrl(player)\n onClick_toggleUi(_, \"playareaGallery\")\n Wait.time(function()\n player.showInputDialog(\"Enter a custom URL for the playarea image\", \"\", function(newURL)\n playAreaApi.updateSurface(newURL)\n end)\n end, 0.15)\nend\n\n-- click function for the download button in the preview window\nfunction onClick_download(player)\n local params = library[contentToShow][currentListItem]\n params.player = player\n placeholder_download(params)\nend\n\n-- the download button on the placeholder objects calls this to directly initiate a download\n---@param params Table contains url and guid of replacement object\nfunction placeholder_download(params)\n local url = SOURCE_REPO .. '/' .. params.url\n requestObj = WebRequest.get(url, function (request) contentDownloadCallback(request, params) end)\n startLuaCoroutine(Global, 'downloadCoroutine')\nend\n\nfunction downloadCoroutine()\n -- show progress bar\n UI.setAttribute('download_progress', 'active', true)\n\n -- update progress bar\n while requestObj do\n UI.setAttribute('download_progress', 'percentage', requestObj.download_progress * 100)\n coroutine.yield(0)\n end\n UI.setAttribute('download_progress', 'percentage', 100)\n\n -- wait 30 frames\n for i = 1, 30 do\n coroutine.yield(0)\n end\n\n -- hide progress bar\n UI.setAttribute('download_progress', 'active', false)\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\n return 1\nend\n\n-- spawns a bag that contains every object from the library\nfunction onClick_downloadAll()\n broadcastToAll(\"Download initiated - this will take a few minutes!\")\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\n\n startLuaCoroutine(Global, \"coroutineDownloadAll\")\nend\n\nfunction coroutineDownloadAll()\n local JSON = [[\n {\n \"Name\": \"Bag\",\n \"Transform\": {\n \"posX\": {{POSX}},\n \"posY\": 2,\n \"posZ\": -95,\n \"rotX\": 0,\n \"rotY\": 270,\n \"rotZ\": 0,\n \"scaleX\": 1.0,\n \"scaleY\": 1.0,\n \"scaleZ\": 1.0\n },\n \"Nickname\": \"{{NICKNAME}}\",\n \"Bag\": {\n \"Order\": 0\n },\n \"ContainedObjects\": [\n ]]\n\n local posx = -45.0\n local downloadedItems = 0\n local skippedItems = 0\n\n -- loop through the library to add content\n for contentType, objectList in pairs(library) do\n broadcastToAll(\"Downloading \" .. contentType .. \"...\")\n local contained = \"\"\n for _, params in ipairs(objectList) do\n local request = WebRequest.get(SOURCE_REPO .. '/' .. params.url)\n local start = os.time()\n while true do\n if request.is_done then\n contained = contained .. request.text .. \",\"\n downloadedItems = downloadedItems + 1\n break\n -- time-out if item can't be loaded in 5s\n elseif request.is_error or (os.time() - start) \u003e 5 then\n skippedItems = skippedItems + 1\n break\n end\n coroutine.yield(0)\n end\n end\n local JSONCopy = JSON\n JSONCopy = JSONCopy .. contained .. \"]}\"\n JSONCopy = JSONCopy:gsub(\"{{POSX}}\", posx)\n JSONCopy = JSONCopy:gsub(\"{{NICKNAME}}\", contentType)\n spawnObjectJSON({json = JSONCopy})\n posx = posx + 3\n end\n\n broadcastToAll(downloadedItems .. \" objects downloaded.\", \"Green\")\n broadcastToAll(skippedItems .. \" objects had a time-out / error.\", \"Orange\")\n return 1\nend\n\n-- spawns a placeholder box for the selected object\nfunction onClick_spawnPlaceholder()\n -- get object references\n local item = library[contentToShow][currentListItem]\n local dummy = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlaceholderBoxDummy\")\n \n -- error handling\n if not item.boxsize or item.boxsize == \"\" or not item.boxart or item.boxart == \"\" then\n print(\"Error loading object.\")\n return\n end\n\n -- get data for placeholder\n local spawnPos = {-39.5, 2, -87}\n\n local meshTable = {\n big = \"https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_MSH.obj\",\n small = \"https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj\",\n wide = \"http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/\"\n }\n\n local scaleTable = {\n big = {1.00, 0.14, 1.00},\n small = {2.21, 0.46, 2.42},\n wide = {2.00, 0.11, 1.69}\n }\n\n local placeholder = spawnObject({\n type = \"Custom_Model\",\n position = spawnPos,\n rotation = {0, 270, 0},\n scale = scaleTable[item.boxsize],\n })\n \n placeholder.setCustomObject({\n mesh = meshTable[item.boxsize],\n diffuse = item.boxart,\n material = 3\n })\n\n placeholder.setColorTint({1, 1, 1, 71/255})\n placeholder.setName(item.name)\n placeholder.setDescription(\"by \" .. (item.author or \"Unknown\"))\n placeholder.setGMNotes(item.url)\n placeholder.setLuaScript(dummy.getLuaScript())\n Player.getPlayers()[1].pingTable(spawnPos)\n\n -- hide download window\n if xmlVisibility.downloadWindow then\n xmlVisibility.downloadWindow = false\n UI.hide('downloadWindow')\n end\nend\n\n-- toggles the visibility of the respective UI\n---@param player LuaPlayer Player that triggered this\n---@param title String Name of the UI to toggle\nfunction onClick_toggleUi(player, title)\n if title == \"Navigation Overlay\" then\n navigationOverlayApi.cycleVisibility(player.color)\n return\n -- hide the playareaGallery if visible\n elseif title == \"downloadWindow\" and xmlVisibility.playAreaGallery then\n onClick_toggleUi(_, \"playAreaGallery\")\n -- hide the downloadWindow if visible\n elseif title == \"playAreaGallery\" and xmlVisibility.downloadWindow then\n onClick_toggleUi(_, \"downloadWindow\")\n end\n\n if xmlVisibility[title] then\n -- small delay to allow button click sounds to play\n Wait.time(function() UI.hide(title) end, 0.1)\n else\n UI.show(title)\n end\n xmlVisibility[title] = not xmlVisibility[title]\nend\n\n-- forwards the call to the onClick function\nfunction togglePlayAreaGallery()\n onClick_toggleUi(_, \"playAreaGallery\")\nend\n\n-- updates the preview window\nfunction updatePreviewWindow()\n local item = library[contentToShow][currentListItem]\n local tempImage = \"http://cloud-3.steamusercontent.com/ugc/2115061845788345842/2CD6ABC551555CCF58F9D0DDB7620197BA398B06/\"\n\n -- set default image if not defined\n if item.boxsize == nil or item.boxsize == \"\" or item.boxart == nil or item.boxart == \"\" then\n item.boxsize = \"big\"\n item.boxart = \"http://cloud-3.steamusercontent.com/ugc/762723517667628371/18438B0A0045038A7099648AA3346DFCAA267C66/\"\n end\n\n UI.setValue(\"previewTitle\", item.name)\n UI.setValue(\"previewAuthor\", \"by \" .. (item.author or \"- Author not found -\"))\n UI.setValue(\"previewDescription\", item.description or \"- Description not found -\")\n\n -- update mask according to size (hardcoded values to align image in mask)\n local maskData = {}\n if item.boxsize == \"big\" then\n maskData = {\n image = \"box-cover-mask-big\",\n width = \"870\",\n height = \"435\",\n offsetXY = \"154 60\"\n }\n elseif item.boxsize == \"small\" then\n maskData = {\n image = \"box-cover-mask-small\",\n width = \"792\",\n height = \"594\",\n offsetXY = \"135 13\"\n }\n elseif item.boxsize == \"wide\" then\n maskData = {\n image = \"box-cover-mask-wide\",\n width = \"756\",\n height = \"630\",\n offsetXY = \"-190 -70\"\n }\n end\n\n -- loading empty image as placeholder until real image is loaded\n UI.setAttribute(\"previewArtImage\", \"image\", tempImage)\n \n -- insert the image itself\n UI.setAttribute(\"previewArtImage\", \"image\", item.boxart)\n UI.setAttributes(\"previewArtMask\", maskData)\nend\n\n-- formats the json response from the webrequest into a key-value lua table\n-- strips the prefix from the community content items\nfunction formatLibrary(json_response)\n library = {}\n library[\"campaigns\"] = json_response.campaigns\n library[\"scenarios\"] = json_response.scenarios\n library[\"extras\"] = json_response.extras\n library[\"fanmadeCampaigns\"] = {}\n library[\"fanmadeScenarios\"] = {}\n library[\"fanmadePlayerCards\"] = {}\n\n for _, item in ipairs(json_response.community) do\n local identifier = nil\n for str in string.gmatch(item.name, \"([^:]+)\") do\n if not identifier then\n -- grab the first part to know the content type\n identifier = str\n else\n -- update the name without the content type\n item.name = str\n break\n end\n end\n\n if identifier == \"Fan Investigators\" then\n table.insert(library[\"fanmadePlayerCards\"], item)\n elseif identifier == \"Fan Campaign\" then\n table.insert(library[\"fanmadeCampaigns\"], item)\n elseif identifier == \"Fan Scenario\" then\n table.insert(library[\"fanmadeScenarios\"], item)\n end\n end\nend\n\n-- updates the window content to the requested content\nfunction updateDownloadItemList()\n if not library then return end\n\n -- addition of list items according to library file\n local globalXml = UI.getXmlTable()\n local contentList = getXmlTableElementById(globalXml, 'contentList')\n\n contentList.children = {}\n for i, v in ipairs(library[contentToShow]) do\n table.insert(contentList.children,\n {\n tag = \"Panel\",\n attributes = { id = \"panel\" .. i },\n children = {\n tag = 'Text',\n value = v.name,\n attributes = {\n id = contentToShow .. \"_\" .. i,\n onClick = 'onClick_select',\n alignment = 'MiddleLeft'\n }\n }\n })\n end\n\n contentList.attributes.height = #contentList.children * 27\n UI.setXmlTable(globalXml)\n\n -- select the first item\n Wait.time(onClick_select, 0.2)\nend\n\n-- called after the webrequest of downloading an item\n-- deletes the placeholder and spawns the downloaded item\nfunction contentDownloadCallback(request, params)\n requestObj = nil\n\n -- error handling\n if request.is_error or request.response_code ~= 200 then\n print('Error: ' .. request.error)\n return\n end\n\n -- initiate content spawning\n local spawnTable = { json = request.text }\n if params.replace then\n local replacedObject = getObjectFromGUID(params.replace)\n if replacedObject then\n spawnTable.position = replacedObject.getPosition()\n spawnTable.rotation = replacedObject.getRotation()\n spawnTable.scale = replacedObject.getScale()\n destroyObject(replacedObject)\n end\n end\n\n -- if position is undefined, get empty position\n if not spawnTable.position then\n spawnTable.rotation = { 0, 270, 0}\n\n local pos = getValidSpawnPosition()\n if pos then\n spawnTable.position = pos\n else\n broadcastToAll(\"Please make space in the area below the tentacle stand in the upper middle of the table and try again.\", \"Red\")\n return\n end\n end\n\n -- if spawned from menu, move the camera and/or ping the table\n if params.name then\n spawnTable[\"callback_function\"] = function(obj)\n Wait.time(function()\n -- move camera\n if params.player then\n params.player.lookAt({\n position = obj.getPosition(),\n pitch = 65,\n yaw = 90,\n distance = 65\n })\n end\n \n -- ping object\n local pingPlayer = params.player or Player.getPlayers()[1]\n pingPlayer.pingTable(obj.getPosition())\n end, 0.1)\n end\n end\n\n if pcall(function() spawnObjectJSON(spawnTable) end) then\n print('Object loaded.')\n else\n print('Error loading object.')\n end\nend\n\n-- gets the first empty position to spawn a custom content object safely\nfunction getValidSpawnPosition()\n local potentialSpawnPositionX = { 65, 50, 35 }\n local potentialSpawnPositionY = 1.5\n local potentialSpawnPositionZ = { 35, 21, 7, -7, -21, -35 }\n\n for i, posX in ipairs(potentialSpawnPositionX) do\n for j, posZ in ipairs(potentialSpawnPositionZ) do\n local pos = {\n x = posX,\n y = potentialSpawnPositionY,\n z = posZ,\n }\n if checkPositionForContentSpawn(pos) then\n return pos\n end\n end\n end\n return nil\nend\n\n-- checks whether something is in the specified position\n-- returns true if empty\nfunction checkPositionForContentSpawn(checkPos)\n local searchResult = searchLib.atPosition(checkPos)\n\n -- first hit is the table surface, additional hits means something is there\n return #searchResult == 1\nend\n\n-- downloading of the library file\nfunction libraryDownloadCallback(request)\n if request.is_error or request.response_code ~= 200 then\n print('error: ' .. request.error)\n return\n end\n\n local json_response = nil\n if pcall(function () json_response = JSON.decode(request.text) end) then\n formatLibrary(json_response)\n updateDownloadItemList()\n else\n print('error parsing downloaded library')\n end\nend\n\n-- loops through an XML table and returns the specified object\n---@param ui Table XmlTable (get this via getXmlTable)\n---@param id String Id of the object to return\nfunction getXmlTableElementById(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = getXmlTableElementById(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n---------------------------------------------------------\n-- Option Panel related functionality\n---------------------------------------------------------\n\n-- called by toggling an option\nfunction onClick_toggleOption(_, id)\n local state = self.UI.getAttribute(id, \"isOn\")\n\n -- flip state (and handle stupid \"False\" value)\n if state == \"False\" then\n state = true\n else\n state = false\n end\n\n self.UI.setAttribute(id, \"isOn\", state)\n applyOptionPanelChange(id, state)\nend\n\n-- color selection for playArea\nfunction onClick_playAreaConnectionColor(player, _, id)\n player.showColorDialog(optionPanel[id], function(color)\n applyOptionPanelChange(id, color)\n end)\nend\n\n-- called by the language selection dropdown\nfunction languageSelected(_, selectedIndex, id)\n optionPanel[id] = LANGUAGES[tonumber(selectedIndex) + 1].code\nend\n\n-- returns the ID (position in the table) for a provided language code\nfunction returnLanguageId(code)\n for index, tbl in ipairs(LANGUAGES) do\n if tbl.code == code then\n return index\n end\n end\nend\n\n-- called by the resource counter selection dropdown\nfunction resourceCounterSelected(_, selectedIndex, id)\n optionPanel[id] = RESOURCE_OPTIONS[tonumber(selectedIndex) + 1]\nend\n\n-- returns the ID for the provided option name\nfunction returnResourceCounterId(name)\n for index, optionName in ipairs(RESOURCE_OPTIONS) do\n if optionName == name then\n return index\n end\n end\nend\n\n-- called by the playermat removal selection dropdown\nfunction playermatRemovalSelected(player, selectedIndex, id)\n if selectedIndex == \"0\" then return end\n\n local matColorList = { \"White\", \"Orange\", \"Green\", \"Red\" }\n local matColor = matColorList[tonumber(selectedIndex)]\n local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\")\n\n if mat then\n -- confirmation dialog about deletion\n player.pingTable(mat.getPosition())\n player.showConfirmDialog(\"Do you really want to remove \" .. matColor .. \"'s playermat and related objects? This can't be reversed.\", function() removePlayermat(matColor) end)\n else\n -- info dialog that it is already deleted\n player.showInfoDialog(matColor .. \"'s playermat has already been removed.\")\n end\n\n -- set selected value back to first option\n UI.setAttribute(id, \"value\", 0)\nend\n\n-- removes a playermat and all related objects from play\n---@param matColor String Color of the playermat to remove\nfunction removePlayermat(matColor)\n local matObjects = guidReferenceApi.getObjectsByOwner(matColor)\n if not matObjects.Playermat then return end\n\n -- remove action tokens\n local actionTokens = playmatApi.searchAroundPlaymat(matColor, \"isActionToken\")\n for _, obj in ipairs(actionTokens) do\n obj.destruct()\n end\n\n -- remove mat owned objects\n for _, obj in pairs(matObjects) do\n obj.destruct()\n end\nend\n\n-- sets the option panel to the correct state (corresponding to 'optionPanel')\nfunction updateOptionPanelState()\n for id, optionValue in pairs(optionPanel) do\n if id == \"cardLanguage\" and type(optionValue) == \"string\" then\n local dropdownId = returnLanguageId(optionValue) - 1\n UI.setAttribute(id, \"value\", dropdownId)\n elseif id == \"useResourceCounters\" and type(optionValue) == \"string\" then\n local dropdownId = returnResourceCounterId(optionValue) - 1\n UI.setAttribute(id, \"value\", dropdownId)\n elseif id == \"playAreaConnectionColor\" then\n UI.setAttribute(id, \"color\", \"#\" .. Color.new(optionValue):toHex())\n elseif (type(optionValue) == \"boolean\" and optionValue)\n or (type(optionValue) == \"string\" and optionValue)\n or (type(optionValue) == \"table\" and #optionValue ~= 0) then\n UI.setAttribute(id, \"isOn\", true)\n else\n UI.setAttribute(id, \"isOn\", \"False\")\n end\n end\nend\n\n-- handles the applying of option selections and calls the respective functions based\n---@param id String ID of the option that was selected or deselected\n---@param state Boolean State of the option (true = enabled)\nfunction applyOptionPanelChange(id, state)\n -- option: Snap tags\n if id == \"useSnapTags\" then\n playmatApi.setLimitSnapsByType(state, \"All\")\n optionPanel[id] = state\n\n -- option: Draw 1 button\n elseif id == \"showDrawButton\" then\n playmatApi.showDrawButton(state, \"All\")\n optionPanel[id] = state\n\n -- option: Clickable clue counters\n elseif id == \"useClueClickers\" then\n playmatApi.clickableClues(state, \"All\")\n optionPanel[id] = state\n\n -- update master clue counter\n local counter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MasterClueCounter\")\n counter.setVar(\"useClickableCounters\", state)\n\n -- option: Play area snap tags\n elseif id == \"playAreaConnections\" then\n playAreaApi.setConnectionDrawState(state)\n optionPanel[id] = state\n\n -- option: Play area connection color\n elseif id == \"playAreaConnectionColor\" then\n playAreaApi.setConnectionColor(state)\n UI.setAttribute(id, \"color\", \"#\" .. Color.new(state):toHex())\n optionPanel[id] = state\n\n -- option: Play area snap tags\n elseif id == \"playAreaSnapTags\" then\n playAreaApi.setLimitSnapsByType(state)\n optionPanel[id] = state\n\n -- option: Show Title on placing scenarios\n elseif id == \"showTitleSplash\" then\n optionPanel[id] = state\n\n -- option: Change custom playarea image on setup\n elseif id == \"changePlayAreaImage\" then\n optionPanel[id] = state\n\n -- option: Show clean up helper\n elseif id == \"showCleanUpHelper\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Clean Up Helper\", {-66, 1.6, 46})\n\n -- option: Show hand helper for each player\n elseif id == \"showHandHelper\" then\n local helperName = \"Hand Helper\"\n local spawnData = playmatApi.getHelperSpawnData(\"All\", helperName)\n local i = 0\n for color, data in pairs(spawnData) do\n i = i + 1\n optionPanel[id][i] = spawnOrRemoveHelper(state, helperName, data.position, data.rotation, color)\n end\n\n -- option: Show search assistant for each player\n elseif id == \"showSearchAssistant\" then\n local helperName = \"Search Assistant\"\n local spawnData = playmatApi.getHelperSpawnData(\"All\", helperName)\n local i = 0\n for color, data in pairs(spawnData) do\n i = i + 1\n optionPanel[id][i] = spawnOrRemoveHelper(state, helperName, data.position, data.rotation, color)\n end\n\n -- option: Show attachment helper\n elseif id == \"showAttachmentHelper\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Attachment Helper\", {-62, 1.4, 0})\n\n -- option: Show CYOA campaign guides\n elseif id == \"showCYOA\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"CYOA Campaign Guides\", {39, 1.3, -20})\n\n -- option: Show displacement tool\n elseif id == \"showDisplacementTool\" then\n optionPanel[id] = spawnOrRemoveHelper(state, \"Displacement Tool\", {-57, 1.6, 46})\n end\nend\n\n-- handler for spawn / remove functions of helper objects\n---@param state Boolean Contains the state of the option: true = spawn it, false = remove it\n---@param name String Name of the helper object\n---@param position Vector Position of the object (where it will spawn)\n---@param rotation Vector Rotation of the object for spawning (default: {0, 270, 0})\n---@param owner String Owner of the object (defaults to \"Mythos\")\n---@return. GUID of the spawnedObj (or nil if object was removed)\nfunction spawnOrRemoveHelper(state, name, position, rotation, owner)\n if (type(state) == \"table\" and #state == 0) then\n return removeHelperObject(name)\n elseif state then\n Player.getPlayers()[1].pingTable(position)\n local spawnedGUID = spawnHelperObject(name, position, rotation).getGUID()\n local cleanName = name:gsub(\"%s+\", \"\")\n guidReferenceApi.editIndex(owner or \"Mythos\", cleanName, spawnedGUID)\n return spawnedGUID\n else\n return removeHelperObject(name)\n end\nend\n\n-- copies the specified tool (by name) from the option panel source bag\n---@param name String Name of the object that should be copied\n---@param position Table Desired position of the object\n---@param rotation Table Desired rotation of the object (defaults to object's rotation)\nfunction spawnHelperObject(name, position, rotation)\n local sourceBag = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\",\"OptionPanelSource\")\n\n -- error handling for missing sourceBag\n if not sourceBag then\n broadcastToAll(\"Option panel source bag could not be found!\", \"Red\")\n return\n end\n\n local spawnTable = { position = position }\n\n -- only overrride rotation if there is one provided (object's rotation used instead)\n if rotation then\n spawnTable.rotation = rotation\n end\n\n for _, obj in ipairs(sourceBag.getData().ContainedObjects) do\n if obj[\"Nickname\"] == name then\n spawnTable.data = obj\n spawnTable.callback_function = function(spawnedObj)\n Wait.time(function() spawnedObj.setLock(true) end, 2)\n end\n return spawnObjectData(spawnTable)\n end\n end\nend\n\n-- removes the specified tool (by name)\n---@param name String Object that should be removed\nfunction removeHelperObject(name)\n -- links objects name to the respective option name (to grab the GUID for removal)\n local referenceTable = {\n [\"Clean Up Helper\"] = \"showCleanUpHelper\",\n [\"Hand Helper\"] = \"showHandHelper\",\n [\"Search Assistant\"] = \"showSearchAssistant\",\n [\"Displacement Tool\"] = \"showDisplacementTool\",\n [\"Attachment Helper\"] = \"showAttachmentHelper\",\n [\"CYOA Campaign Guides\"] = \"showCYOA\"\n }\n\n local data = optionPanel[referenceTable[name]]\n\n -- if there is a GUID stored, remove that object\n if type(data) == \"string\" then\n local obj = getObjectFromGUID(data)\n if obj then obj.destruct() end\n\n -- if it is a table (e.g. for the \"Hand Helper\", remove all of them)\n elseif type(data) == \"table\" then\n for _, guid in pairs(data) do\n local obj = getObjectFromGUID(guid)\n if obj then obj.destruct() end\n end\n end\nend\n\n-- loads saved options\nfunction loadSettings(newOptions)\n optionPanel = newOptions\n updateOptionPanelState()\n for id, state in pairs(optionPanel) do\n applyOptionPanelChange(id, state)\n end\nend\n\n-- loads the default options\nfunction onClick_defaultSettings()\n for id, _ in pairs(optionPanel) do\n local state = false\n -- override for settings that are enabled by default\n if id == \"useSnapTags\" or id == \"showTitleSplash\" then\n state = true\n end\n applyOptionPanelChange(id, state)\n end\n\n -- clean reset of variables\n optionPanel = {\n cardLanguage = \"en\",\n playAreaConnectionColor = { 0.4, 0.4, 0.4, 1 },\n playAreaConnections = true,\n playAreaSnapTags = true,\n showAttachmentHelper = false,\n showCleanUpHelper = false,\n showCYOA = false,\n showDisplacementTool = false,\n showDrawButton = false,\n showHandHelper = {},\n showSearchAssistant = {},\n showTitleSplash = true,\n useClueClickers = false,\n useResourceCounters = \"disabled\",\n useSnapTags = true\n }\n\n -- update UI\n updateOptionPanelState()\nend\n\n-- splash scenario title on setup\nfunction titleSplash(scenarioName)\n if optionPanel['showTitleSplash'] then\n -- if there's any ongoing title being displayed, hide it and cancel the waiting function\n if hideTitleSplashWaitFunctionId then\n Wait.stop(hideTitleSplashWaitFunctionId)\n hideTitleSplashWaitFunctionId = nil\n UI.setAttribute('title_splash', 'active', false)\n end\n\n -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen)\n -- wait timer to hide the scenario name\n UI.setValue('title_splash_text', scenarioName)\n UI.show('title_splash')\n hideTitleSplashWaitFunctionId = Wait.time(function()\n UI.hide('title_splash')\n hideTitleSplashWaitFunctionId = nil\n end, 4)\n\n soundCubeApi.playSoundByName(\"Deep Bell\")\n end\nend\n\n---------------------------------------------------------\n-- Update notification related functionality\n---------------------------------------------------------\n\n-- grabs the latest mod version and release notes from GitHub (called onLoad())\nfunction getModVersion()\n WebRequest.get(SOURCE_REPO .. '/modversion.json', compareVersion)\nend\n\n-- compares the modversion with GitHub and possibly shows the update notification\nfunction compareVersion(request)\n if request.is_error then\n log(request.error)\n return\n end\n\n -- global variable to make it accessible for other functions\n modMeta = JSON.decode(request.text)\n\n -- stop here if on latest or newer version\n if convertVersionToNumber(MOD_VERSION) \u003e= convertVersionToNumber(modMeta[\"latestVersion\"]) then return end\n\n -- stop here if \"don't show again\" was clicked for this version before\n if acknowledgedUpgradeVersions[modMeta[\"latestVersion\"]] then return end\n\n updateNotificationLoading()\n\n -- delay to avoid lagging during onLoad()\n Wait.time(function() UI.show(\"FinnIcon\") end, 1)\nend\n\n-- converts a version number to a string\n---@param version String Version number, separated by dots (e.g. 3.3.1)\nfunction convertVersionToNumber(version)\n local major, minor, patch = string.match(version, \"(%d+)%.(%d+)%.(%d+)\")\n return major * 100 + minor * 10 + patch\nend\n\n-- updates the XML update notification based on the mod metadata\nfunction updateNotificationLoading()\n -- grab data\n local highlights = modMeta[\"releaseHighlights\"]\n\n -- concatenate the release highlights\n local highlightText = \"• \" .. highlights[1]\n for i, entry in pairs(highlights) do\n if i ~= 1 then\n highlightText = highlightText .. \"\\n• \" .. entry\n end\n end\n\n -- update the XML UI\n UI.setValue(\"notificationHeader\", \"New version available: \" .. modMeta[\"latestVersion\"])\n UI.setValue(\"releaseHighlightText\", highlightText)\n UI.setAttribute(\"highlightRow\", \"preferredHeight\", 20*#highlights)\n UI.setAttribute(\"updateNotification\", \"height\", 20*#highlights + 125)\nend\n\n-- close / don't show again buttons on the update notification\nfunction onClick_notification(_, parameter)\n if parameter == \"dontShowAgain\" then\n -- this variable tracks if \"don't show again\" was pressed for a version\n acknowledgedUpgradeVersions[modMeta[\"latestVersion\"]] = true\n end\n UI.hide(\"FinnIcon\")\n UI.hide(\"updateNotification\")\n xmlVisibility[\"updateNotification\"] = false\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "{\"acknowledgedUpgradeVersions\":[],\"chaosTokensGUID\":[],\"optionPanel\":{\"cardLanguage\":\"en\",\"changePlayAreaImage\":false,\"playAreaConnectionColor\":{\"a\":1,\"b\":0.4,\"g\":0.4,\"r\":0.4},\"playAreaConnections\":true,\"playAreaSnapTags\":true,\"showAttachmentHelper\":false,\"showCleanUpHelper\":false,\"showCYOA\":false,\"showDisplacementTool\":false,\"showDrawButton\":false,\"showHandHelper\":[],\"showSearchAssistant\":[],\"showTitleSplash\":true,\"useClueClickers\":false,\"useResourceCounters\":\"disabled\",\"useSnapTags\":true}}", "MusicPlayer": { "AudioLibrary": [ { @@ -575,8 +580,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GUIDReferenceHandler\")\nend)\n__bundle_register(\"core/GUIDReferenceHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal GuidReferences = {\n White = {\n ClueCounter = \"d86b7c\",\n ClickableClueCounter = \"db85d6\",\n DamageCounter = \"eb08d6\",\n HandZone = \"a70eee\",\n HorrorCounter = \"468e88\",\n InvestigatorSkillTracker = \"e598c2\",\n Playermat = \"8b081b\",\n ResourceCounter = \"4406f0\",\n TokenDiscardZone = \"457de3\",\n Trash = \"147e80\"\n },\n Orange = {\n ClueCounter = \"1769ed\",\n ClickableClueCounter = \"3f22e5\",\n DamageCounter = \"e64eec\",\n HandZone = \"5fe087\",\n HorrorCounter = \"0257d9\",\n InvestigatorSkillTracker = \"b4a5f7\",\n Playermat = \"bd0ff4\",\n ResourceCounter = \"816d84\",\n TokenDiscardZone = \"457de4\",\n Trash = \"f7b6c8\"\n },\n Green = {\n ClueCounter = \"032300\",\n ClickableClueCounter = \"891403\",\n DamageCounter = \"1f5a0a\",\n HandZone = \"0285cc\",\n HorrorCounter = \"7b5729\",\n InvestigatorSkillTracker = \"af7ed7\",\n Playermat = \"383d8b\",\n ResourceCounter = \"cd15ac\",\n TokenDiscardZone = \"457de5\",\n Trash = \"5f896a\"\n },\n Red = {\n ClueCounter = \"37be78\",\n ClickableClueCounter = \"4111de\",\n DamageCounter = \"591a45\",\n HandZone = \"be2f17\",\n HorrorCounter = \"beb964\",\n InvestigatorSkillTracker = \"e74881\",\n Playermat = \"0840d5\",\n ResourceCounter = \"a4b60d\",\n TokenDiscardZone = \"457de6\",\n Trash = \"4b8594\"\n },\n Mythos = {\n AllCardsBag = \"15bb07\",\n BlessCurseManager = \"5933fb\",\n CampaignThePathToCarcosa = \"aca04c\",\n DataHelper = \"708279\",\n DeckImporter = \"a28140\",\n DoomCounter = \"85c4c6\",\n DoomInPlayCounter = \"652ff3\",\n InvestigatorCounter = \"f182ee\",\n MasterClueCounter = \"4a3aa4\",\n MythosArea = \"9f334f\",\n NavigationOverlayHandler = \"797ede\",\n OptionPanelSource = \"830bd0\",\n PlaceholderBoxDummy = \"a93466\",\n PlayArea = \"721ba2\",\n PlayAreaZone = \"a2f932\",\n PlayerCardPanel = \"2d30ee\",\n ResourceTokenBag = \"9fadf9\",\n RulesReference = \"d99993\",\n SoundCube = \"3c988f\",\n TokenArranger = \"022907\",\n TokenSource = \"124381\",\n TokenSpawnTracker = \"e3ffc9\",\n TourStarter = \"0e5aa8\",\n Trash = \"70b9f6\",\n VictoryDisplay = \"6ccd6d\"\n }\n}\n\nfunction getObjectByOwnerAndType(params)\n local owner = params.owner or \"Mythos\"\n local type = params.type\n return getObjectFromGUID(GuidReferences[owner][type])\nend\n\nfunction getObjectsByType(type)\n local objList = {}\n for owner, objects in pairs(GuidReferences) do\n local obj = getObjectFromGUID(objects[type])\n if obj then\n objList[owner] = obj\n end\n end\n return objList\nend\n\nfunction getObjectsByOwner(owner)\n local objList = {}\n for type, guid in pairs(GuidReferences[owner]) do\n local obj = getObjectFromGUID(guid)\n if obj then\n objList[type] = obj\n end\n end\n return objList\nend\nend)\nreturn __bundle_require(\"__root\")", - "LuaScriptState": "", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GUIDReferenceHandler\")\nend)\n__bundle_register(\"core/GUIDReferenceHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal GuidReferences = {\n White = {\n ClueCounter = \"d86b7c\",\n ClickableClueCounter = \"db85d6\",\n DamageCounter = \"eb08d6\",\n HandZone = \"a70eee\",\n HorrorCounter = \"468e88\",\n InvestigatorSkillTracker = \"e598c2\",\n Playermat = \"8b081b\",\n ResourceCounter = \"4406f0\",\n TokenDiscardZone = \"457de3\",\n Trash = \"147e80\"\n },\n Orange = {\n ClueCounter = \"1769ed\",\n ClickableClueCounter = \"3f22e5\",\n DamageCounter = \"e64eec\",\n HandZone = \"5fe087\",\n HorrorCounter = \"0257d9\",\n InvestigatorSkillTracker = \"b4a5f7\",\n Playermat = \"bd0ff4\",\n ResourceCounter = \"816d84\",\n TokenDiscardZone = \"457de4\",\n Trash = \"f7b6c8\"\n },\n Green = {\n ClueCounter = \"032300\",\n ClickableClueCounter = \"891403\",\n DamageCounter = \"1f5a0a\",\n HandZone = \"0285cc\",\n HorrorCounter = \"7b5729\",\n InvestigatorSkillTracker = \"af7ed7\",\n PoolResources = \"0168ae\",\n PoolDamage = \"b0ef6c\",\n PoolHorror = \"ae1a4e\",\n PoolClues = \"fae2f6\",\n PoolDoom = \"16724b\",\n Playermat = \"383d8b\",\n ResourceCounter = \"cd15ac\",\n TokenDiscardZone = \"457de5\",\n TokenRemover = \"2ba7a5\",\n Trash = \"5f896a\"\n },\n Red = {\n ClueCounter = \"37be78\",\n ClickableClueCounter = \"4111de\",\n DamageCounter = \"591a45\",\n HandZone = \"be2f17\",\n HorrorCounter = \"beb964\",\n InvestigatorSkillTracker = \"e74881\",\n PoolResources = \"fd617a\",\n PoolDamage = \"93f4a0\",\n PoolHorror = \"7bd2a0\",\n PoolClues = \"3b2550\",\n PoolDoom = \"16fcd6\",\n Playermat = \"0840d5\",\n ResourceCounter = \"a4b60d\",\n TokenDiscardZone = \"457de6\",\n TokenRemover = \"39b175\",\n Trash = \"4b8594\"\n },\n Mythos = {\n AdditionalPlayerCardsBag = \"2cba6b\",\n AllCardsBag = \"15bb07\",\n BlessCurseManager = \"5933fb\",\n CampaignThePathToCarcosa = \"aca04c\",\n ChaosBagZone = \"83ef06\",\n DataHelper = \"708279\",\n DeckImporter = \"a28140\",\n DoomCounter = \"85c4c6\",\n DoomInPlayCounter = \"652ff3\",\n InvestigatorCounter = \"f182ee\",\n MasterClueCounter = \"4a3aa4\",\n MythosArea = \"9f334f\",\n NavigationOverlayHandler = \"797ede\",\n OptionPanelSource = \"830bd0\",\n PlaceholderBoxDummy = \"a93466\",\n PlayArea = \"721ba2\",\n PlayAreaImageSelector = \"b7b45b\",\n PlayAreaZone = \"a2f932\",\n PlayerCardPanel = \"2d30ee\",\n ResourceTokenBag = \"9fadf9\",\n RulesReference = \"d99993\",\n SoundCube = \"3c988f\",\n TokenArranger = \"022907\",\n TokenSource = \"124381\",\n TokenSpawnTracker = \"e3ffc9\",\n TourStarter = \"0e5aa8\",\n Trash = \"70b9f6\",\n VictoryDisplay = \"6ccd6d\"\n }\n}\n\nlocal editsToIndex = {\n White = {},\n Orange = {},\n Green = {},\n Red = {},\n Mythos = {}\n}\n\n-- save function to keep edits to the index\nfunction onSave() return JSON.encode({ editsToIndex = editsToIndex }) end\n\n-- load function to restore edits to the index\nfunction onLoad(savedData)\n if savedData and savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n editsToIndex = loadedData.editsToIndex\n updateMainIndex()\n end\nend\n\n-- merges the main index and the edits\nfunction updateMainIndex()\n for owner, subTable in pairs(editsToIndex) do\n for type, guid in pairs(subTable) do\n GuidReferences[owner][type] = guid\n end\n end\nend\n\n-- returns an object reference for the requested owner and type\nfunction getObjectByOwnerAndType(params)\n local owner = params.owner or \"Mythos\"\n local type = params.type\n return getObjectFromGUID(GuidReferences[owner][type])\nend\n\n-- returns a list of objects for the requested type\nfunction getObjectsByType(type)\n local objList = {}\n for owner, objects in pairs(GuidReferences) do\n local obj = getObjectFromGUID(objects[type])\n if obj then\n objList[owner] = obj\n end\n end\n return objList\nend\n\n-- returns a list of objects for the requested owner\nfunction getObjectsByOwner(owner)\n local objList = {}\n for type, guid in pairs(GuidReferences[owner]) do\n local obj = getObjectFromGUID(guid)\n if obj then\n objList[type] = obj\n end\n end\n return objList\nend\n\n-- makes an edit to the main index\nfunction editIndex(params)\n editsToIndex[params.owner][params.type] = params.guid\n updateMainIndex()\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "{\"editsToIndex\":{\"Green\":[],\"Mythos\":[],\"Orange\":[],\"Red\":[],\"White\":[]}}", "MeasureMovement": false, "Name": "go_game_piece_white", "Nickname": "GUID Reference Handler", @@ -1016,7 +1021,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "tableHeightOffset =-9\r\nfunction onSave()\r\n saved_data = JSON.encode({tid=tableImageData, cd=checkData})\r\n --saved_data = \"\"\r\n return saved_data\r\nend\r\n\r\nfunction onload(saved_data)\r\n --Loads the tracking for if the game has started yet\r\n if saved_data ~= \"\" then\r\n local loaded_data = JSON.decode(saved_data)\r\n tableImageData = loaded_data.tid\r\n checkData = loaded_data.cd\r\n else\r\n tableImageData = {}\r\n checkData = {move=false, scale=false}\r\n end\r\n\r\n --Disables interactable status of objects with GUID in list\r\n for _, guid in ipairs(ref_noninteractable) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj then obj.interactable = false end\r\n end\r\n\r\n --Establish references to table parts\r\n obj_leg1 = getObjectFromGUID(\"afc863\")\r\n obj_leg2 = getObjectFromGUID(\"c8edca\")\r\n obj_leg3 = getObjectFromGUID(\"393bf7\")\r\n obj_leg4 = getObjectFromGUID(\"12c65e\")\r\n obj_surface = getObjectFromGUID(\"4ee1f2\")\r\n obj_side_top = getObjectFromGUID(\"35b95f\")\r\n obj_side_bot = getObjectFromGUID(\"f938a2\")\r\n obj_side_lef = getObjectFromGUID(\"9f95fd\")\r\n obj_side_rig = getObjectFromGUID(\"5af8f2\")\r\n\r\n controlActive = true\r\n createOpenCloseButton()\r\nend\r\n\r\n\r\n\r\n--Activation/deactivation of control panel\r\n\r\n\r\n\r\n--Activated by clicking on\r\nfunction click_toggleControl(_, color)\r\n if permissionCheck(color) then\r\n if not controlActive then\r\n --Activate control panel\r\n controlActive = true\r\n self.clearButtons()\r\n createOpenCloseButton()\r\n createSurfaceInput()\r\n createSurfaceButtons()\r\n createScaleInput()\r\n createScaleButtons()\r\n else\r\n --Deactivate control panel\r\n controlActive = false\r\n self.clearButtons()\r\n self.clearInputs()\r\n createOpenCloseButton()\r\n\r\n end\r\n end\r\nend\r\n\r\n\r\n\r\n\r\n--Table surface control\r\n\r\n\r\n\r\n--Changes table surface\r\nfunction click_applySurface(_, color)\r\n if permissionCheck(color) then\r\n updateSurface()\r\n broadcastToAll(\"New Table Image Applied\", {0.2,0.9,0.2})\r\n end\r\nend\r\n\r\n--Saves table surface\r\nfunction click_saveSurface(_, color)\r\n if permissionCheck(color) then\r\n local nickname = self.getInputs()[1].value\r\n local url = self.getInputs()[2].value\r\n if nickname == \"\" then\r\n --No nickname\r\n broadcastToAll(\"Please supply a nickname for this save.\", {0.9,0.2,0.2})\r\n else\r\n --Nickname exists\r\n\r\n if findInImageDataIndex(url, nickname) == nil then\r\n --Save doesn't exist already\r\n table.insert(tableImageData, {url=url, name=nickname})\r\n broadcastToAll(\"Image URL saved to memory.\", {0.2,0.9,0.2})\r\n --Refresh buttons\r\n self.clearButtons()\r\n createOpenCloseButton()\r\n createSurfaceButtons()\r\n createScaleButtons()\r\n else\r\n --Save exists already\r\n broadcastToAll(\"Memory already contains a save with this Name or URL. Delete it first.\", {0.9,0.2,0.2})\r\n end\r\n end\r\n end\r\nend\r\n\r\n--Loads table surface\r\nfunction click_loadMemory(_, color, index)\r\n if permissionCheck(color) then\r\n self.editInput({index=0, value=tableImageData[index].name})\r\n self.editInput({index=1, value=tableImageData[index].url})\r\n updateSurface()\r\n broadcastToAll(\"Table Image Loaded\", {0.2,0.9,0.2})\r\n end\r\nend\r\n\r\n--Deletes table surface\r\nfunction click_deleteMemory(_, color, index)\r\n if permissionCheck(color) then\r\n table.remove(tableImageData, index)\r\n self.clearButtons()\r\n createOpenCloseButton()\r\n createSurfaceButtons()\r\n createScaleButtons()\r\n broadcastToAll(\"Element Removed from Memory\", {0.2,0.9,0.2})\r\n end\r\nend\r\n\r\n--Updates surface from the values in the input field\r\nfunction updateSurface()\r\n local customInfo = obj_surface.getCustomObject()\r\n customInfo.diffuse = self.getInputs()[2].value\r\n obj_surface.setCustomObject(customInfo)\r\n obj_surface = obj_surface.reload()\r\nend\r\n\r\n\r\n\r\n--Table Scale control\r\n\r\n\r\n\r\n--Applies Scale to table pieces\r\nfunction click_applyScale(_, color)\r\n if permissionCheck(color) then\r\n local newWidth = tonumber(self.getInputs()[3].value)\r\n local newDepth = tonumber(self.getInputs()[4].value)\r\n if type(newWidth) ~= \"number\" then\r\n broadcastToAll(\"Invalid Width\", {0.9,0.2,0.2})\r\n return\r\n elseif type(newDepth) ~= \"number\" then\r\n broadcastToAll(\"Invalid Depth\", {0.9,0.2,0.2})\r\n return\r\n elseif newWidth\u003c0.1 or newDepth\u003c0.1 then\r\n broadcastToAll(\"Scale cannot go below 0.1\", {0.9,0.2,0.2})\r\n return\r\n elseif newWidth\u003e12 or newDepth\u003e12 then\r\n broadcastToAll(\"Scale should not go over 12 (world size limitation)\", {0.9,0.2,0.2})\r\n return\r\n else\r\n changeTableScale(math.abs(newWidth), math.abs(newDepth))\r\n broadcastToAll(\"Scale applied.\", {0.2,0.9,0.2})\r\n end\r\n end\r\nend\r\n\r\n--Checks/unchecks move box for hands\r\nfunction click_checkMove(_, color)\r\n if permissionCheck(color) then\r\n local find_func = function(o) return o.click_function==\"click_checkMove\" end\r\n if checkData.move == true then\r\n checkData.move = false\r\n local buttonEntry = findButton(self, find_func)\r\n self.editButton({index=buttonEntry.index, label=\"\"})\r\n else\r\n checkData.move = true\r\n local buttonEntry = findButton(self, find_func)\r\n self.editButton({index=buttonEntry.index, label=string.char(10008)})\r\n end\r\n end\r\nend\r\n\r\n--Checks/unchecks scale box for hands\r\n--This button was disabled for technical reasons\r\n--[[\r\nfunction click_checkScale(_, color)\r\n if permissionCheck(color) then\r\n local find_func = function(o) return o.click_function==\"click_checkScale\" end\r\n if checkData.scale == true then\r\n checkData.scale = false\r\n local buttonEntry = findButton(self, find_func)\r\n self.editButton({index=buttonEntry.index, label=\"\"})\r\n else\r\n checkData.scale = true\r\n local buttonEntry = findButton(self, find_func)\r\n self.editButton({index=buttonEntry.index, label=string.char(10008)})\r\n end\r\n end\r\nend\r\n]]\r\n\r\n--Alters scale of elements and moves them\r\nfunction changeTableScale(width, depth)\r\n --Scaling factors used to translate scale to position offset\r\n local width2pos = (width-1) * 18\r\n local depth2pos = (depth-1) * 18\r\n\r\n --Hand zone movement\r\n if checkData.move == true then\r\n for _, pc in ipairs(ref_playerColor) do\r\n if Player[pc].getHandCount() \u003e 0 then\r\n moveHandZone(Player[pc], width2pos, depth2pos)\r\n end\r\n end\r\n end\r\n --Hand zone scaling\r\n --The button to enable this was disabled for technical reasons\r\n if checkData.scale == true then\r\n for _, pc in ipairs(ref_playerColor) do\r\n if Player[pc].getHandCount() \u003e 0 then\r\n scaleHandZone(Player[pc], width, depth)\r\n end\r\n end\r\n end\r\n\r\n --Resizing table elements\r\n obj_side_top.setScale({width, 1, 1})\r\n obj_side_bot.setScale({width, 1, 1})\r\n obj_side_lef.setScale({depth, 1, 1})\r\n obj_side_rig.setScale({depth, 1, 1})\r\n obj_surface.setScale({width, 1, depth})\r\n\r\n --Moving table elements to accomodate new scale\r\n obj_side_lef.setPosition({-width2pos,tableHeightOffset,0})\r\n obj_side_rig.setPosition({ width2pos,tableHeightOffset,0})\r\n obj_side_top.setPosition({0,tableHeightOffset, depth2pos})\r\n obj_side_bot.setPosition({0,tableHeightOffset,-depth2pos})\r\n obj_leg1.setPosition({-width2pos,tableHeightOffset,-depth2pos})\r\n obj_leg2.setPosition({-width2pos,tableHeightOffset, depth2pos})\r\n obj_leg3.setPosition({ width2pos,tableHeightOffset, depth2pos})\r\n obj_leg4.setPosition({ width2pos,tableHeightOffset,-depth2pos})\r\n self.setPosition(obj_leg4.positionToWorld({-22.12, 8.74,-19.16}))\r\n --Only enabled when changing tableHeightOffset\r\n --obj_surface.setPosition({0,tableHeightOffset,0})\r\nend\r\n\r\n--Move hand zone, p=player reference, facts are scaling factors\r\nfunction moveHandZone(p, width2pos, depth2pos)\r\n local widthX = obj_side_rig.getPosition().x\r\n local depthZ = obj_side_top.getPosition().z\r\n for i=1, p.getHandCount() do\r\n local handT = p.getHandTransform()\r\n local pos = handT.position\r\n local y = handT.rotation.y\r\n\r\n if y\u003c45 or y\u003e320 or y\u003e135 and y\u003c225 then\r\n if pos.z \u003e 0 then\r\n pos.z = pos.z + depth2pos - depthZ\r\n else\r\n pos.z = pos.z - depth2pos + depthZ\r\n end\r\n else\r\n if pos.x \u003e 0 then\r\n pos.x = pos.x + width2pos - widthX\r\n else\r\n pos.x = pos.x - width2pos + widthX\r\n end\r\n end\r\n\r\n --Only enabled when changing tableHeightOffset\r\n --pos.y = tableHeightOffset + 14\r\n\r\n handT.position = pos\r\n p.setHandTransform(handT, i)\r\n end\r\nend\r\n\r\n\r\n---Scales hand zones, p=player reference, facts are scaling factors\r\nfunction scaleHandZone(p, width, depth)\r\n local widthFact = width / obj_side_top.getScale().x\r\n local depthFact = depth / obj_side_lef.getScale().x\r\n for i=1, p.getHandCount() do\r\n local handT = p.getHandTransform()\r\n local scale = handT.scale\r\n local y = handT.rotation.y\r\n if y\u003c45 or y\u003e320 or y\u003e135 and y\u003c225 then\r\n scale.x = scale.x * widthFact\r\n else\r\n scale.x = scale.x * depthFact\r\n end\r\n handT.scale = scale\r\n p.setHandTransform(handT, i)\r\n end\r\nend\r\n\r\n\r\n\r\n--Information gathering\r\n\r\n\r\n\r\n--Checks if a color is promoted or host\r\nfunction permissionCheck(color)\r\n if Player[color].host==true or Player[color].promoted==true then\r\n return true\r\n else\r\n return false\r\n end\r\nend\r\n\r\n--Locates a string saved within memory file\r\nfunction findInImageDataIndex(...)\r\n for _, str in ipairs({...}) do\r\n for i, v in ipairs(tableImageData) do\r\n if v.url == str or v.name == str then\r\n return i\r\n end\r\n end\r\n end\r\n return nil\r\nend\r\n\r\n--Round number (num) to the Nth decimal (dec)\r\nfunction round(num, dec)\r\n local mult = 10^(dec or 0)\r\n return math.floor(num * mult + 0.5) / mult\r\nend\r\n\r\n--Locates a button with a helper function\r\nfunction findButton(obj, func)\r\n if func==nil then error(\"No func supplied to findButton\") end\r\n for _, v in ipairs(obj.getButtons()) do\r\n if func(v) then\r\n return v\r\n end\r\n end\r\n return nil\r\nend\r\n\r\n\r\n\r\n--Creation of buttons/inputs\r\n\r\n\r\n\r\nfunction createOpenCloseButton()\r\n local tooltip = \"Open Table Control Panel\"\r\n if controlActive then\r\n tooltip = \"Close Table Control Panel\"\r\n end\r\n self.createButton({\r\n click_function=\"click_toggleControl\", function_owner=self,\r\n position={0,0,0}, rotation={-45,0,0}, height=400, width=400,\r\n color={1,1,1,0}, tooltip=tooltip\r\n })\r\nend\r\n\r\nfunction createSurfaceInput()\r\n local currentURL = obj_surface.getCustomObject().diffuse\r\n local nickname = \"\"\r\n if findInImageDataIndex(currentURL) ~= nil then\r\n nickname = tableImageData[findInImageDataIndex(currentURL)].name\r\n end\r\n self.createInput({\r\n label=\"Nickname\", input_function=\"none\", function_owner=self,\r\n alignment=3, position={0,0,2}, height=224, width=4000,\r\n font_size=200, tooltip=\"Enter nickname for table image (only used for save)\",\r\n value=nickname\r\n })\r\n self.createInput({\r\n label=\"URL\", input_function=\"none\", function_owner=self,\r\n alignment=3, position={0,0,3}, height=224, width=4000,\r\n font_size=200, tooltip=\"Enter URL for tabletop image\",\r\n value=currentURL\r\n })\r\nend\r\n\r\nfunction createSurfaceButtons()\r\n --Label\r\n self.createButton({\r\n label=\"Tabletop Surface Image\", click_function=\"none\",\r\n position={0,0,1}, height=0, width=0, font_size=300, font_color={1,1,1}\r\n })\r\n --Functional\r\n self.createButton({\r\n label=\"Apply Image\\nTo Table\", click_function=\"click_applySurface\",\r\n function_owner=self, tooltip=\"Apply URL as table image\",\r\n position={2,0,4}, height=440, width=1400, font_size=200,\r\n })\r\n self.createButton({\r\n label=\"Save Image\\nTo Memory\", click_function=\"click_saveSurface\",\r\n function_owner=self, tooltip=\"Record URL into memory (requires nickname)\",\r\n position={-2,0,4}, height=440, width=1400, font_size=200,\r\n })\r\n --Label\r\n self.createButton({\r\n label=\"Load From Memory\", click_function=\"none\",\r\n position={0,0,5.5}, height=0, width=0, font_size=300, font_color={1,1,1}\r\n })\r\n --Saves, created dynamically from memory file\r\n for i, memoryEntry in ipairs(tableImageData) do\r\n --Load\r\n local funcName = i..\"loadMemory\"\r\n local func = function(x,y) click_loadMemory(x,y,i) end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n label=memoryEntry.name, click_function=funcName,\r\n function_owner=self, tooltip=memoryEntry.url, font_size=200,\r\n position={-0.6,0,6.5+0.5*(i-1)}, height=240, width=3300,\r\n })\r\n --Delete\r\n local funcName = i..\"deleteMemory\"\r\n local func = function(x,y) click_deleteMemory(x,y,i) end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n label=\"DELETE\", click_function=funcName,\r\n function_owner=self, tooltip=\"\",\r\n position={3.6,0,6.5+0.5*(i-1)}, height=240, width=600,\r\n font_size=160, font_color={1,0,0}, color={0.8,0.8,0.8}\r\n })\r\n end\r\nend\r\n\r\nfunction createScaleInput()\r\n self.createInput({\r\n label=string.char(8644), input_function=\"none\", function_owner=self,\r\n alignment=3, position={-8.5,0,2}, height=224, width=400,\r\n font_size=200, tooltip=\"Table Width\",\r\n value=round(obj_side_top.getScale().x, 1)\r\n })\r\n self.createInput({\r\n label=string.char(8645), input_function=\"none\", function_owner=self,\r\n alignment=3, position={-7.5,0,2}, height=224, width=400,\r\n font_size=200, tooltip=\"Table Depth\",\r\n value=round(obj_side_lef.getScale().x, 1)\r\n })\r\nend\r\n\r\nfunction createScaleButtons()\r\n --Labels\r\n self.createButton({\r\n label=\"Table Scale\", click_function=\"none\",\r\n position={-8,0,1}, height=0, width=0, font_size=300, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=string.char(8644)..\" \"..string.char(8645),\r\n click_function=\"none\",\r\n position={-8,0,2}, height=0, width=0, font_size=300, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Move Hands:\", click_function=\"none\",\r\n position={-8.3,0,3}, height=0, width=0, font_size=200, font_color={1,1,1}\r\n })\r\n --Disabled due to me removing the feature for technical reasons\r\n --[[\r\n self.createButton({\r\n label=\"Scale Hands:\", click_function=\"none\",\r\n position={-8.3,0,4}, height=0, width=0, font_size=200, font_color={1,1,1}\r\n })\r\n ]]\r\n --Checkboxes\r\n local label = \"\"\r\n if checkData.move == true then label = string.char(10008) end\r\n self.createButton({\r\n label=label, click_function=\"click_checkMove\",\r\n function_owner=self, tooltip=\"Check to move hands when table is rescaled\",\r\n position={-6.8,0,3}, height=224, width=224, font_size=200,\r\n })\r\n --[[\r\n local label = \"\"\r\n if checkData.scale == true then label = string.char(10008) end\r\n self.createButton({\r\n label=label, click_function=\"click_checkScale\",\r\n function_owner=self, tooltip=\"Check to scale the width of hands when table is rescaled\",\r\n position={-6.8,0,4}, height=224, width=224, font_size=200,\r\n })\r\n ]]\r\n --Apply button\r\n self.createButton({\r\n label=\"Apply Scale\", click_function=\"click_applyScale\",\r\n function_owner=self, tooltip=\"Apply width/depth to table\",\r\n position={-8,0,4}, height=440, width=1400, font_size=200,\r\n })\r\nend\r\n\r\n\r\n\r\n\r\n\r\n--Data tables\r\n\r\n\r\n\r\n\r\nref_noninteractable = {\r\n \"afc863\",\"c8edca\",\"393bf7\",\"12c65e\",\"f938a2\",\"9f95fd\",\"35b95f\",\r\n \"5af8f2\",\"4ee1f2\",\"bd69bd\"\r\n}\r\n\r\nref_playerColor = {\r\n \"White\", \"Brown\", \"Red\", \"Orange\", \"Yellow\",\r\n \"Green\", \"Teal\", \"Blue\", \"Purple\", \"Pink\", \"Black\"\r\n}\r\n\r\n--Dummy function, absorbs unwanted triggers\r\nfunction none() end\r", + "LuaScript": "tableHeightOffset =-9\nfunction onSave()\n saved_data = JSON.encode({tid=tableImageData, cd=checkData})\n --saved_data = \"\"\n return saved_data\nend\n\nfunction onload(saved_data)\n --Loads the tracking for if the game has started yet\n if saved_data ~= \"\" then\n local loaded_data = JSON.decode(saved_data)\n tableImageData = loaded_data.tid\n checkData = loaded_data.cd\n else\n tableImageData = {}\n checkData = {move=false, scale=false}\n end\n\n --Disables interactable status of objects with GUID in list\n for _, guid in ipairs(ref_noninteractable) do\n local obj = getObjectFromGUID(guid)\n if obj then obj.interactable = false end\n end\n\n --Establish references to table parts\n obj_leg1 = getObjectFromGUID(\"afc863\")\n obj_leg2 = getObjectFromGUID(\"c8edca\")\n obj_leg3 = getObjectFromGUID(\"393bf7\")\n obj_leg4 = getObjectFromGUID(\"12c65e\")\n obj_surface = getObjectFromGUID(\"4ee1f2\")\n obj_side_top = getObjectFromGUID(\"35b95f\")\n obj_side_bot = getObjectFromGUID(\"f938a2\")\n obj_side_lef = getObjectFromGUID(\"9f95fd\")\n obj_side_rig = getObjectFromGUID(\"5af8f2\")\n\n controlActive = true\n createOpenCloseButton()\nend\n\n\n\n--Activation/deactivation of control panel\n\n\n\n--Activated by clicking on\nfunction click_toggleControl(_, color)\n if permissionCheck(color) then\n if not controlActive then\n --Activate control panel\n controlActive = true\n self.clearButtons()\n createOpenCloseButton()\n createSurfaceInput()\n createSurfaceButtons()\n createScaleInput()\n createScaleButtons()\n else\n --Deactivate control panel\n controlActive = false\n self.clearButtons()\n self.clearInputs()\n createOpenCloseButton()\n\n end\n end\nend\n\n\n\n\n--Table surface control\n\n\n\n--Changes table surface\nfunction click_applySurface(_, color)\n if permissionCheck(color) then\n updateSurface()\n broadcastToAll(\"New Table Image Applied\", {0.2,0.9,0.2})\n end\nend\n\n--Saves table surface\nfunction click_saveSurface(_, color)\n if permissionCheck(color) then\n local nickname = self.getInputs()[1].value\n local url = self.getInputs()[2].value\n if nickname == \"\" then\n --No nickname\n broadcastToAll(\"Please supply a nickname for this save.\", {0.9,0.2,0.2})\n else\n --Nickname exists\n\n if findInImageDataIndex(url, nickname) == nil then\n --Save doesn't exist already\n table.insert(tableImageData, {url=url, name=nickname})\n broadcastToAll(\"Image URL saved to memory.\", {0.2,0.9,0.2})\n --Refresh buttons\n self.clearButtons()\n createOpenCloseButton()\n createSurfaceButtons()\n createScaleButtons()\n else\n --Save exists already\n broadcastToAll(\"Memory already contains a save with this Name or URL. Delete it first.\", {0.9,0.2,0.2})\n end\n end\n end\nend\n\n--Loads table surface\nfunction click_loadMemory(_, color, index)\n if permissionCheck(color) then\n self.editInput({index=0, value=tableImageData[index].name})\n self.editInput({index=1, value=tableImageData[index].url})\n updateSurface()\n broadcastToAll(\"Table Image Loaded\", {0.2,0.9,0.2})\n end\nend\n\n--Deletes table surface\nfunction click_deleteMemory(_, color, index)\n if permissionCheck(color) then\n table.remove(tableImageData, index)\n self.clearButtons()\n createOpenCloseButton()\n createSurfaceButtons()\n createScaleButtons()\n broadcastToAll(\"Element Removed from Memory\", {0.2,0.9,0.2})\n end\nend\n\n--Updates surface from the values in the input field\nfunction updateSurface()\n local customInfo = obj_surface.getCustomObject()\n customInfo.diffuse = self.getInputs()[2].value\n obj_surface.setCustomObject(customInfo)\n obj_surface = obj_surface.reload()\nend\n\n\n\n--Table Scale control\n\n\n\n--Applies Scale to table pieces\nfunction click_applyScale(_, color)\n if permissionCheck(color) then\n local newWidth = tonumber(self.getInputs()[3].value)\n local newDepth = tonumber(self.getInputs()[4].value)\n if type(newWidth) ~= \"number\" then\n broadcastToAll(\"Invalid Width\", {0.9,0.2,0.2})\n return\n elseif type(newDepth) ~= \"number\" then\n broadcastToAll(\"Invalid Depth\", {0.9,0.2,0.2})\n return\n elseif newWidth\u003c0.1 or newDepth\u003c0.1 then\n broadcastToAll(\"Scale cannot go below 0.1\", {0.9,0.2,0.2})\n return\n elseif newWidth\u003e12 or newDepth\u003e12 then\n broadcastToAll(\"Scale should not go over 12 (world size limitation)\", {0.9,0.2,0.2})\n return\n else\n changeTableScale(math.abs(newWidth), math.abs(newDepth))\n broadcastToAll(\"Scale applied.\", {0.2,0.9,0.2})\n end\n end\nend\n\n--Checks/unchecks move box for hands\nfunction click_checkMove(_, color)\n if permissionCheck(color) then\n local find_func = function(o) return o.click_function==\"click_checkMove\" end\n if checkData.move == true then\n checkData.move = false\n local buttonEntry = findButton(self, find_func)\n self.editButton({index=buttonEntry.index, label=\"\"})\n else\n checkData.move = true\n local buttonEntry = findButton(self, find_func)\n self.editButton({index=buttonEntry.index, label=string.char(10008)})\n end\n end\nend\n\n--Checks/unchecks scale box for hands\n--This button was disabled for technical reasons\n--[[\nfunction click_checkScale(_, color)\n if permissionCheck(color) then\n local find_func = function(o) return o.click_function==\"click_checkScale\" end\n if checkData.scale == true then\n checkData.scale = false\n local buttonEntry = findButton(self, find_func)\n self.editButton({index=buttonEntry.index, label=\"\"})\n else\n checkData.scale = true\n local buttonEntry = findButton(self, find_func)\n self.editButton({index=buttonEntry.index, label=string.char(10008)})\n end\n end\nend\n]]\n\n--Alters scale of elements and moves them\nfunction changeTableScale(width, depth)\n --Scaling factors used to translate scale to position offset\n local width2pos = (width-1) * 18\n local depth2pos = (depth-1) * 18\n\n --Hand zone movement\n if checkData.move == true then\n for _, pc in ipairs(ref_playerColor) do\n if Player[pc].getHandCount() \u003e 0 then\n moveHandZone(Player[pc], width2pos, depth2pos)\n end\n end\n end\n --Hand zone scaling\n --The button to enable this was disabled for technical reasons\n if checkData.scale == true then\n for _, pc in ipairs(ref_playerColor) do\n if Player[pc].getHandCount() \u003e 0 then\n scaleHandZone(Player[pc], width, depth)\n end\n end\n end\n\n --Resizing table elements\n obj_side_top.setScale({width, 1, 1})\n obj_side_bot.setScale({width, 1, 1})\n obj_side_lef.setScale({depth, 1, 1})\n obj_side_rig.setScale({depth, 1, 1})\n obj_surface.setScale({width, 1, depth})\n\n --Moving table elements to accomodate new scale\n obj_side_lef.setPosition({-width2pos,tableHeightOffset,0})\n obj_side_rig.setPosition({ width2pos,tableHeightOffset,0})\n obj_side_top.setPosition({0,tableHeightOffset, depth2pos})\n obj_side_bot.setPosition({0,tableHeightOffset,-depth2pos})\n obj_leg1.setPosition({-width2pos,tableHeightOffset,-depth2pos})\n obj_leg2.setPosition({-width2pos,tableHeightOffset, depth2pos})\n obj_leg3.setPosition({ width2pos,tableHeightOffset, depth2pos})\n obj_leg4.setPosition({ width2pos,tableHeightOffset,-depth2pos})\n self.setPosition(obj_leg4.positionToWorld({-22.12, 8.74,-19.16}))\n --Only enabled when changing tableHeightOffset\n --obj_surface.setPosition({0,tableHeightOffset,0})\nend\n\n--Move hand zone, p=player reference, facts are scaling factors\nfunction moveHandZone(p, width2pos, depth2pos)\n local widthX = obj_side_rig.getPosition().x\n local depthZ = obj_side_top.getPosition().z\n for i=1, p.getHandCount() do\n local handT = p.getHandTransform()\n local pos = handT.position\n local y = handT.rotation.y\n\n if y\u003c45 or y\u003e320 or y\u003e135 and y\u003c225 then\n if pos.z \u003e 0 then\n pos.z = pos.z + depth2pos - depthZ\n else\n pos.z = pos.z - depth2pos + depthZ\n end\n else\n if pos.x \u003e 0 then\n pos.x = pos.x + width2pos - widthX\n else\n pos.x = pos.x - width2pos + widthX\n end\n end\n\n --Only enabled when changing tableHeightOffset\n --pos.y = tableHeightOffset + 14\n\n handT.position = pos\n p.setHandTransform(handT, i)\n end\nend\n\n\n---Scales hand zones, p=player reference, facts are scaling factors\nfunction scaleHandZone(p, width, depth)\n local widthFact = width / obj_side_top.getScale().x\n local depthFact = depth / obj_side_lef.getScale().x\n for i=1, p.getHandCount() do\n local handT = p.getHandTransform()\n local scale = handT.scale\n local y = handT.rotation.y\n if y\u003c45 or y\u003e320 or y\u003e135 and y\u003c225 then\n scale.x = scale.x * widthFact\n else\n scale.x = scale.x * depthFact\n end\n handT.scale = scale\n p.setHandTransform(handT, i)\n end\nend\n\n\n\n--Information gathering\n\n\n\n--Checks if a color is promoted or host\nfunction permissionCheck(color)\n if Player[color].host==true or Player[color].promoted==true then\n return true\n else\n return false\n end\nend\n\n--Locates a string saved within memory file\nfunction findInImageDataIndex(...)\n for _, str in ipairs({...}) do\n for i, v in ipairs(tableImageData) do\n if v.url == str or v.name == str then\n return i\n end\n end\n end\n return nil\nend\n\n--Round number (num) to the Nth decimal (dec)\nfunction round(num, dec)\n local mult = 10^(dec or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n--Locates a button with a helper function\nfunction findButton(obj, func)\n if func==nil then error(\"No func supplied to findButton\") end\n for _, v in ipairs(obj.getButtons()) do\n if func(v) then\n return v\n end\n end\n return nil\nend\n\n\n\n--Creation of buttons/inputs\n\n\n\nfunction createOpenCloseButton()\n local tooltip = \"Open Table Control Panel\"\n if controlActive then\n tooltip = \"Close Table Control Panel\"\n end\n self.createButton({\n click_function=\"click_toggleControl\", function_owner=self,\n position={0,0,0}, rotation={-45,0,0}, height=400, width=400,\n color={1,1,1,0}, tooltip=tooltip\n })\nend\n\nfunction createSurfaceInput()\n local currentURL = obj_surface.getCustomObject().diffuse\n local nickname = \"\"\n if findInImageDataIndex(currentURL) ~= nil then\n nickname = tableImageData[findInImageDataIndex(currentURL)].name\n end\n self.createInput({\n label=\"Nickname\", input_function=\"none\", function_owner=self,\n alignment=3, position={0,0,2}, height=224, width=4000,\n font_size=200, tooltip=\"Enter nickname for table image (only used for save)\",\n value=nickname\n })\n self.createInput({\n label=\"URL\", input_function=\"none\", function_owner=self,\n alignment=3, position={0,0,3}, height=224, width=4000,\n font_size=200, tooltip=\"Enter URL for tabletop image\",\n value=currentURL\n })\nend\n\nfunction createSurfaceButtons()\n --Label\n self.createButton({\n label=\"Tabletop Surface Image\", click_function=\"none\",\n position={0,0,1}, height=0, width=0, font_size=300, font_color={1,1,1}\n })\n --Functional\n self.createButton({\n label=\"Apply Image\\nTo Table\", click_function=\"click_applySurface\",\n function_owner=self, tooltip=\"Apply URL as table image\",\n position={2,0,4}, height=440, width=1400, font_size=200,\n })\n self.createButton({\n label=\"Save Image\\nTo Memory\", click_function=\"click_saveSurface\",\n function_owner=self, tooltip=\"Record URL into memory (requires nickname)\",\n position={-2,0,4}, height=440, width=1400, font_size=200,\n })\n --Label\n self.createButton({\n label=\"Load From Memory\", click_function=\"none\",\n position={0,0,5.5}, height=0, width=0, font_size=300, font_color={1,1,1}\n })\n --Saves, created dynamically from memory file\n for i, memoryEntry in ipairs(tableImageData) do\n --Load\n local funcName = i..\"loadMemory\"\n local func = function(x,y) click_loadMemory(x,y,i) end\n self.setVar(funcName, func)\n self.createButton({\n label=memoryEntry.name, click_function=funcName,\n function_owner=self, tooltip=memoryEntry.url, font_size=200,\n position={-0.6,0,6.5+0.5*(i-1)}, height=240, width=3300,\n })\n --Delete\n local funcName = i..\"deleteMemory\"\n local func = function(x,y) click_deleteMemory(x,y,i) end\n self.setVar(funcName, func)\n self.createButton({\n label=\"DELETE\", click_function=funcName,\n function_owner=self, tooltip=\"\",\n position={3.6,0,6.5+0.5*(i-1)}, height=240, width=600,\n font_size=160, font_color={1,0,0}, color={0.8,0.8,0.8}\n })\n end\nend\n\nfunction createScaleInput()\n self.createInput({\n label=string.char(8644), input_function=\"none\", function_owner=self,\n alignment=3, position={-8.5,0,2}, height=224, width=400,\n font_size=200, tooltip=\"Table Width\",\n value=round(obj_side_top.getScale().x, 1)\n })\n self.createInput({\n label=string.char(8645), input_function=\"none\", function_owner=self,\n alignment=3, position={-7.5,0,2}, height=224, width=400,\n font_size=200, tooltip=\"Table Depth\",\n value=round(obj_side_lef.getScale().x, 1)\n })\nend\n\nfunction createScaleButtons()\n --Labels\n self.createButton({\n label=\"Table Scale\", click_function=\"none\",\n position={-8,0,1}, height=0, width=0, font_size=300, font_color={1,1,1}\n })\n self.createButton({\n label=string.char(8644)..\" \"..string.char(8645),\n click_function=\"none\",\n position={-8,0,2}, height=0, width=0, font_size=300, font_color={1,1,1}\n })\n self.createButton({\n label=\"Move Hands:\", click_function=\"none\",\n position={-8.3,0,3}, height=0, width=0, font_size=200, font_color={1,1,1}\n })\n --Disabled due to me removing the feature for technical reasons\n --[[\n self.createButton({\n label=\"Scale Hands:\", click_function=\"none\",\n position={-8.3,0,4}, height=0, width=0, font_size=200, font_color={1,1,1}\n })\n ]]\n --Checkboxes\n local label = \"\"\n if checkData.move == true then label = string.char(10008) end\n self.createButton({\n label=label, click_function=\"click_checkMove\",\n function_owner=self, tooltip=\"Check to move hands when table is rescaled\",\n position={-6.8,0,3}, height=224, width=224, font_size=200,\n })\n --[[\n local label = \"\"\n if checkData.scale == true then label = string.char(10008) end\n self.createButton({\n label=label, click_function=\"click_checkScale\",\n function_owner=self, tooltip=\"Check to scale the width of hands when table is rescaled\",\n position={-6.8,0,4}, height=224, width=224, font_size=200,\n })\n ]]\n --Apply button\n self.createButton({\n label=\"Apply Scale\", click_function=\"click_applyScale\",\n function_owner=self, tooltip=\"Apply width/depth to table\",\n position={-8,0,4}, height=440, width=1400, font_size=200,\n })\nend\n\n\n\n\n\n--Data tables\n\n\n\n\nref_noninteractable = {\n \"afc863\",\"c8edca\",\"393bf7\",\"12c65e\",\"f938a2\",\"9f95fd\",\"35b95f\",\n \"5af8f2\",\"4ee1f2\",\"bd69bd\"\n}\n\nref_playerColor = {\n \"White\", \"Brown\", \"Red\", \"Orange\", \"Yellow\",\n \"Green\", \"Teal\", \"Blue\", \"Purple\", \"Pink\", \"Black\"\n}\n\n--Dummy function, absorbs unwanted triggers\nfunction none() end", "LuaScriptState": "{\"cd\":{\"move\":false,\"scale\":false},\"tid\":[{\"name\":\"Felt - Grey\",\"url\":\"https://i.imgur.com/N0O6aqj.jpg\"},{\"name\":\"Wood\",\"url\":\"https://i.imgur.com/iOFFsGh.jpg\"},{\"name\":\"Wood 2\",\"url\":\"https://i.imgur.com/SQ2t01d.jpg\"}]}", "MaterialIndex": 1, "MeasureMovement": false, @@ -1297,6 +1302,13 @@ "ImageURL": "http://cloud-3.steamusercontent.com/ugc/952965089462071147/F586DAA07E810B16A62C23AE2EA526BE3C7FD7FB/", "WidthScale": 0 }, + "CustomUIAssets": [ + { + "Name": "font_teutonic-arkham", + "Type": 1, + "URL": "http://cloud-3.steamusercontent.com/ugc/2027213118467703445/89328E273B4C5180BF491516CE998DE3C604E162/" + } + ], "Description": "", "DragSelectable": true, "GMNotes": "", @@ -1308,7 +1320,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/MythosArea\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\nlocal ENCOUNTER_DECK_AREA = {\n upperLeft = { x = 0.9, z = 0.42 },\n lowerRight = { x = 0.86, z = 0.38 },\n}\nlocal ENCOUNTER_DISCARD_AREA = {\n upperLeft = { x = 1.62, z = 0.42 },\n lowerRight = { x = 1.58, z = 0.38 },\n}\n\n-- global position of encounter deck and discard pile\nlocal ENCOUNTER_DECK_POS = { x = -3.93, y = 1, z = 5.76 }\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1, z = 10.38 }\nlocal isReshuffling = false\n\n-- scenario metadata\nlocal currentScenario, useFrontData, tokenData\n\n-- object references\nlocal TRASH, DATA_HELPER\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\nfunction onLoad(saveState)\n if saveState ~= nil then\n local loadedState = JSON.decode(saveState) or {}\n currentScenario = loadedState.currentScenario or \"\"\n useFrontData = loadedState.useFrontData or true\n tokenData = loadedState.tokenData or {}\n end\n TRASH = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n collisionEnabled = true\nend\n\nfunction onSave()\n return JSON.encode({\n currentScenario = currentScenario,\n useFrontData = useFrontData,\n tokenData = tokenData\n })\nend\n\n-- TTS event handler. Handles scenario name event triggering and encounter card token resets.\nfunction onCollisionEnter(collisionInfo)\n if not collisionEnabled then return end\n local object = collisionInfo.collision_object\n\n if object.getName() == \"Scenario\" then\n local description = object.getDescription()\n\n -- detect if a new scenario card is placed down\n if currentScenario ~= description then\n currentScenario = description\n fireScenarioChangedEvent()\n end\n\n local metadata = JSON.decode(object.getGMNotes()) or {}\n if not metadata[\"tokens\"] then\n tokenData = {}\n return\n end\n\n -- detect orientation of scenario card (for difficulty)\n useFrontData = not object.is_face_down\n tokenData = metadata[\"tokens\"][(useFrontData and \"front\" or \"back\")]\n fireTokenDataChangedEvent()\n end\n\n local localPos = self.positionToLocal(object.getPosition())\n if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then\n tokenSpawnTrackerApi.resetTokensSpawned(object.getGUID())\n removeTokensFromObject(object)\n end\nend\n\n-- TTS event handler. Handles scenario name event triggering\nfunction onCollisionExit(collisionInfo)\n if not collisionEnabled then return end\n local object = collisionInfo.collision_object\n\n -- reset token metadata if scenario reference card is removed\n if object.getName() == \"Scenario\" then\n tokenData = {}\n useFrontData = nil\n fireTokenDataChangedEvent()\n end\nend\n\n-- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state\n-- for the cards when they do.\nfunction onObjectEnterContainer(container, object)\n local localPos = self.positionToLocal(container.getPosition())\n if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then\n tokenSpawnTrackerApi.resetTokensSpawned(object.getGUID())\n end\nend\n\n-- fires if the scenario title changes\nfunction fireScenarioChangedEvent()\n Wait.frames(function() Global.call('titleSplash', currentScenario) end, 20)\n playAreaApi.onScenarioChanged(currentScenario)\nend\n\n-- fires if the scenario title or the difficulty changes\nfunction fireTokenDataChangedEvent()\n local fullData = returnTokenData()\n tokenArrangerApi.onTokenDataChanged(fullData)\nend\n\n-- returns the chaos token metadata (if provided)\nfunction returnTokenData()\n return {\n tokenData = tokenData,\n currentScenario = currentScenario,\n useFrontData = useFrontData\n }\nend\n\n---------------------------------------------------------\n-- encounter card drawing\n---------------------------------------------------------\n\n-- gets the encounter deck (for internal functions and Api calls)\nfunction getEncounterDeck()\n local search = searchArea(ENCOUNTER_DECK_POS, { 3, 1, 4 }, isCardOrDeck)\n\n for _, v in ipairs(search) do\n local obj = v.hit_object\n if obj.type == 'Deck' then\n return obj\n end\n end\n \n -- if no deck was found, return the first hit (a card)\n if #search \u003e 0 then\n return search[1].hit_object\n end\nend\n\n-- 'params' contains the position, rotation and a boolean to force a faceup draw\nfunction drawEncounterCard(params)\n local card\n local deck = getEncounterDeck()\n\n if deck then\n if deck.type == \"Deck\" then\n card = deck.takeObject()\n else\n card = deck\n end\n actualEncounterCardDraw(card, params)\n else\n -- nothing here, time to reshuffle\n reshuffleEncounterDeck(params)\n end\nend\n\nfunction actualEncounterCardDraw(card, params)\n local faceUpRotation = 0\n if not params.alwaysFaceUp then\n local metadata = JSON.decode(card.getGMNotes()) or {}\n if metadata.hidden or DATA_HELPER.call('checkHiddenCard', card.getName()) then\n faceUpRotation = 180\n end\n end\n card.setPositionSmooth(params.pos, false, false)\n card.setRotationSmooth({ 0, params.rotY, faceUpRotation }, false, false)\nend\n\nfunction reshuffleEncounterDeck(params)\n -- flag to avoid multiple calls\n if isReshuffling then return end\n isReshuffling = true\n\n -- shuffle and flip deck, draw card after completion\n local discarded = searchArea(ENCOUNTER_DISCARD_POSITION, { 3, 1, 4 }, isDeck)\n if #discarded \u003e 0 then\n local deck = discarded[1].hit_object\n if not deck.is_face_down then deck.flip() end\n deck.shuffle()\n deck.setPositionSmooth(Vector(ENCOUNTER_DECK_POS) + Vector(0, 2, 0), false, true)\n Wait.time(function() actualEncounterCardDraw(deck.takeObject({ index = 0 }), params) end, 0.5)\n else\n printToAll(\"Couldn't find encounter discard pile to reshuffle.\", { 1, 0, 0 })\n end\n\n -- disable flag\n Wait.time(function() isReshuffling = false end, 1)\nend\n\n---------------------------------------------------------\n-- helper functions\n---------------------------------------------------------\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector. Point to check, only x and z values are relevant\n---@param bounds Table. Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean. True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, v in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do\n local obj = v.hit_object\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n not tokenChecker.isChaosToken(obj) then\n TRASH.putObject(obj)\n end\n end\nend\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n local objList = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = self.getRotation(),\n type = 3,\n size = size,\n max_distance = 1\n })\n\n if filter then\n local filteredList = {}\n for _, obj in ipairs(objList) do\n if filter(obj.hit_object) then\n table.insert(filteredList, obj)\n end\n end\n return filteredList\n else\n return objList\n end\nend\n\n-- filter functions for searchArea\nfunction isDeck(x) return x.tag == 'Deck' end\n\nfunction isCardOrDeck(x) return x.tag == 'Card' or x.tag == 'Deck' end\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/MythosArea\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/MythosArea\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal deckLib = require(\"util/DeckLib\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\nlocal ENCOUNTER_DECK_AREA = {\n upperLeft = { x = 0.9, z = 0.42 },\n lowerRight = { x = 0.86, z = 0.38 },\n}\nlocal ENCOUNTER_DISCARD_AREA = {\n upperLeft = { x = 1.62, z = 0.42 },\n lowerRight = { x = 1.58, z = 0.38 },\n}\n\n-- global position of encounter deck and discard pile\nlocal ENCOUNTER_DECK_POS = { x = -3.93, y = 1, z = 5.76 }\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1, z = 10.38 }\nlocal isReshuffling = false\nlocal currentScenario, useFrontData, tokenData\nlocal TRASH, DATA_HELPER\n\nfunction onLoad(saveState)\n if saveState ~= nil then\n local loadedState = JSON.decode(saveState) or {}\n currentScenario = loadedState.currentScenario or \"\"\n useFrontData = loadedState.useFrontData or true\n tokenData = loadedState.tokenData or {}\n end\n TRASH = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\nend\n\nfunction onSave()\n return JSON.encode({\n currentScenario = currentScenario,\n useFrontData = useFrontData,\n tokenData = tokenData\n })\nend\n\n---------------------------------------------------------\n-- collison and container event handling\n---------------------------------------------------------\n\n-- TTS event handler. Handles scenario name event triggering and encounter card token resets.\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n if object.getName() == \"Scenario\" then\n local description = object.getDescription()\n\n -- detect if a new scenario card is placed down\n if currentScenario ~= description then\n currentScenario = description\n fireScenarioChangedEvent()\n end\n\n local metadata = JSON.decode(object.getGMNotes()) or {}\n if not metadata[\"tokens\"] then\n tokenData = {}\n return\n end\n\n -- detect orientation of scenario card (for difficulty)\n useFrontData = not object.is_face_down\n tokenData = metadata[\"tokens\"][(useFrontData and \"front\" or \"back\")]\n fireTokenDataChangedEvent()\n end\n\n local localPos = self.positionToLocal(object.getPosition())\n if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then\n tokenSpawnTrackerApi.resetTokensSpawned(object.getGUID())\n removeTokensFromObject(object)\n end\nend\n\n-- TTS event handler. Handles scenario name event triggering\nfunction onCollisionExit(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- reset token metadata if scenario reference card is removed\n if object.getName() == \"Scenario\" then\n tokenData = {}\n useFrontData = nil\n fireTokenDataChangedEvent()\n end\nend\n\n-- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state\n-- for the cards when they do.\nfunction onObjectEnterContainer(container, object)\n local localPos = self.positionToLocal(container.getPosition())\n if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then\n tokenSpawnTrackerApi.resetTokensSpawned(object.getGUID())\n end\nend\n\n-- fires if the scenario title changes\nfunction fireScenarioChangedEvent()\n -- maybe show the title splash screen\n Wait.frames(function() Global.call('titleSplash', currentScenario) end, 20)\n\n -- set the scenario for the playarea (connections might be disabled)\n playAreaApi.onScenarioChanged(currentScenario)\n\n -- maybe update the playarea image\n local playAreaImageSelector = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaImageSelector\")\n playAreaImageSelector.call(\"maybeUpdatePlayAreaImage\", currentScenario)\nend\n\n-- fires if the scenario title or the difficulty changes\nfunction fireTokenDataChangedEvent()\n local fullData = returnTokenData()\n tokenArrangerApi.onTokenDataChanged(fullData)\nend\n\n-- returns the chaos token metadata (if provided)\nfunction returnTokenData()\n return {\n tokenData = tokenData,\n currentScenario = currentScenario,\n useFrontData = useFrontData\n }\nend\n\n---------------------------------------------------------\n-- encounter card drawing\n---------------------------------------------------------\n\n-- gets the encounter deck (for internal functions and Api calls)\nfunction getEncounterDeck()\n local searchResult = searchLib.atPosition(ENCOUNTER_DECK_POS, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n return searchResult[1]\n end\nend\n\n-- 'params' contains the position, rotation and a boolean to force a faceup draw\nfunction drawEncounterCard(params)\n local encounterDeck = getEncounterDeck()\n\n if encounterDeck then\n reshuffledAlready = false\n local card\n if encounterDeck.type == \"Deck\" then\n card = encounterDeck.takeObject()\n else\n card = encounterDeck\n end\n actualEncounterCardDraw(card, params)\n else\n -- nothing here, time to reshuffle\n if reshuffledAlready == true then\n reshuffledAlready = false\n return\n end\n reshuffleEncounterDeck() -- if there is no discard pile either, reshuffleEncounterDeck will give an error message already\n reshuffledAlready = true\n drawEncounterCard(params)\n end\nend\n\nfunction actualEncounterCardDraw(card, params)\n local faceUpRotation = 0\n if not params.alwaysFaceUp then\n local metadata = JSON.decode(card.getGMNotes()) or {}\n if metadata.hidden or DATA_HELPER.call('checkHiddenCard', card.getName()) then\n faceUpRotation = 180\n end\n end\n\n local DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}\n local pos = params.mat.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET)\n local rotY = params.mat.getRotation().y\n\n deckLib.placeOrMergeIntoDeck(card, pos, { 0, rotY, faceUpRotation })\nend\n\nfunction reshuffleEncounterDeck()\n -- flag to avoid multiple calls\n if isReshuffling then return end\n isReshuffling = true\n local encounterDeck = getEncounterDeck()\n local discardPile = searchLib.atPosition(ENCOUNTER_DISCARD_POSITION, \"isCardOrDeck\")\n \n if #discardPile \u003e 0 then\n local discardDeck = discardPile[1]\n if not discardDeck.is_face_down then --flips discard pile\n discardDeck.setRotation({0, -90, 180}) \n end \n if encounterDeck == nil then\n discardDeck.setPosition(Vector(ENCOUNTER_DECK_POS) + Vector({0, 1, 0}))\n discardDeck.shuffle()\n else\n encounterDeck.putObject(discardDeck)\n encounterDeck.shuffle()\n end\n broadcastToAll(\"Shuffled encounter discard into deck.\", \"White\")\n else\n broadcastToAll(\"Encounter discard pile is already empty.\", \"Red\")\n end\n\n -- disable flag\n Wait.time(function() isReshuffling = false end, 1)\nend\n---------------------------------------------------------\n-- helper functions\n---------------------------------------------------------\n\n-- Simple method to check if the given point is in a specified area\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within\n---@return Boolean: True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, obj in ipairs(searchLib.onObject(object)) do\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n not tokenChecker.isChaosToken(obj) then\n TRASH.putObject(obj)\n end\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"util/DeckLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckLib = {}\n local searchLib = require(\"util/SearchLib\")\n\n -- places a card/deck at a position or merges into an existing deck\n ---@param obj TTSObject Object to move\n ---@param pos Table New position for the object\n ---@param rot Table New rotation for the object (optional)\n DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)\n if obj == nil or pos == nil then return end\n\n -- search the new position for existing card/deck\n local searchResult = searchLib.atPosition(pos, \"isCardOrDeck\")\n\n -- get new position\n local newPos\n local offset = 0.5\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\n end\n\n return DeckLib\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/MythosArea\")\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"currentScenario\":\"\",\"tokenData\":[],\"useFrontData\":true}", "MeasureMovement": false, "Name": "Custom_Tile", @@ -1331,7 +1343,7 @@ "scaleZ": 6.5 }, "Value": 0, - "XmlUI": "" + "XmlUI": "\u003c!-- include MythosArea.xml --\u003e\n\u003cPanel position=\"160 70 -13\"\n rotation=\"0 0 180\"\n height=\"74\"\n width=\"315\"\u003e\n \u003cButton scale=\"0.1 0.1 1\"\n color=\"#ffffff00\"\n textColors=\"#ffffff|#88e3cf|#4f8478\"\n font=\"font_teutonic-arkham\"\n fontSize=\"62\"\n onClick=\"reshuffleEncounterDeck\"\u003eReshuffle ➡\u003c/Button\u003e\n\u003c/Panel\u003e\n\u003c!-- include MythosArea.xml --\u003e" }, { "AltLookAngle": { @@ -1735,19 +1747,19 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "ScriptingTrigger", - "Nickname": "", + "Nickname": "ChaosBagZone", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 1.4, - "posY": 2.866, - "posZ": -13.4, + "posX": 1.6, + "posY": 4.5, + "posZ": -13.75, "rotX": 0, - "rotY": 90, + "rotY": 0, "rotZ": 0, "scaleX": 6, - "scaleY": 2, + "scaleY": 7, "scaleZ": 6 }, "Value": 0, @@ -2028,7 +2040,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DoomCounter\")\nend)\n__bundle_register(\"core/DoomCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\nlocal optionsVisible = false\nlocal options = {\n Agenda = true,\n Playarea = true,\n Playermats = true\n}\n\nval = 0\n\n-- save current value and options\nfunction onSave() return JSON.encode({ val, options }) end\n\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n val = loadedData[1]\n options = loadedData[2]\n\n -- restore state for option panel\n for key, bool in pairs(options) do\n self.UI.setAttribute(\"option\" .. key, \"isOn\", not bool)\n end\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 800,\n width = 800,\n font_size = 650,\n scale = { 1.5, 1.5, 1.5 },\n font_color = { 1, 1, 1, 95 },\n color = { 0, 0, 0, 0 }\n })\nend\n\n-- called by the invisible button to change displayed value\nfunction addOrSubtract(_, _, isRightClick)\n local newVal = math.min(math.max(val + (isRightClick and -1 or 1), 0), 99)\n if val ~= newVal then\n updateVal(newVal)\n end\nend\n\n-- adds the provided number to the current count\nfunction addVal(number)\n number = tonumber(number) or 0\n val = val + number\n self.editButton({ index = 0, label = tostring(val) })\n printToAll(\"Doom on agenda set to: \" .. val)\nend\n\n-- sets the current count to the provided number\nfunction updateVal(number)\n val = number or 0\n self.editButton({ index = 0, label = tostring(val) })\n printToAll(\"Doom on agenda set to: \" .. val)\nend\n\n-- called by \"Reset\" button to remove doom\nfunction startReset()\n if options.Agenda then\n updateVal(0)\n end\n local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomInPlayCounter\")\n if doomInPlayCounter then\n doomInPlayCounter.call(\"removeDoom\", options)\n end\nend\n\n-- XML UI functions\nfunction optionClick(_, optionName)\n options[optionName] = not options[optionName]\n printToAll(\"Doom removal of \" .. optionName .. (options[optionName] and \" enabled\" or \" disabled\"))\nend\n\nfunction toggleOptions()\n optionsVisible = not optionsVisible\n\n if optionsVisible then\n self.UI.show(\"Options\")\n else\n self.UI.hide(\"Options\")\n end\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DoomCounter\")\nend)\n__bundle_register(\"core/DoomCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal searchLib = require(\"util/SearchLib\")\n\nlocal optionsVisible = false\nlocal options = {\n Agenda = true,\n Playarea = true,\n Playermats = true\n}\n\nval = 0\n\n-- save current value and options\nfunction onSave() return JSON.encode({ val, options }) end\n\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n val = loadedData[1]\n options = loadedData[2]\n\n -- restore state for option panel\n for key, bool in pairs(options) do\n self.UI.setAttribute(\"option\" .. key, \"isOn\", not bool)\n end\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 800,\n width = 800,\n font_size = 650,\n scale = { 1.5, 1.5, 1.5 },\n font_color = { 1, 1, 1, 95 },\n color = { 0, 0, 0, 0 }\n })\nend\n\n-- called by the invisible button to change displayed value\nfunction addOrSubtract(_, _, isRightClick)\n local newVal = math.min(math.max(val + (isRightClick and -1 or 1), 0), 99)\n if val ~= newVal then\n updateVal(newVal)\n end\nend\n\n-- adds the provided number to the current count\nfunction addVal(number)\n val = val + number\n updateVal(val)\nend\n\n-- sets the current count to the provided number\nfunction updateVal(number)\n val = number or 0\n self.editButton({ index = 0, label = tostring(val) })\n if number then\n broadcastDoom(val)\n else\n broadcastToAll(\"0 doom on the agenda\", \"White\")\n end\nend\n\n-- called by updateVal and addVal to broadcast total doom in play, including doom threshold\nfunction broadcastDoom(val)\n local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomInPlayCounter\")\n local doomInPlay = doomInPlayCounter.call(\"countDoomInPlay\") + val\n local doomThreshold = getDoomThreshold()\n\n if doomThreshold then\n broadcastToAll(val .. \" doom on the agenda (\" .. doomInPlay .. \"/\" .. doomThreshold .. \" in play)\", \"White\")\n else\n broadcastToAll(val .. \" doom on the agenda (\" .. doomInPlay .. \" in play)\", \"White\")\n end\nend\n\n-- called by \"Reset\" button to remove doom\nfunction startReset()\n if options.Agenda then\n -- omitting the number will broadcast a special message just for this case\n updateVal()\n end\n local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomInPlayCounter\")\n if doomInPlayCounter then\n doomInPlayCounter.call(\"removeDoom\", options)\n end\nend\n\n-- get doom threshold from top card of Agenda deck\nfunction getDoomThreshold()\n local agendaPos = { -2.72, 1.6, 0.37 }\n local searchResult = searchLib.atPosition(agendaPos, \"isCardOrDeck\")\n\n if #searchResult == 1 then\n local obj = searchResult[1]\n if obj.type == \"Card\" then\n return getDoomThresholdFromGMNotes(obj.getGMNotes())\n else\n -- handle agenda deck\n local containedObjects = obj.getData().ContainedObjects\n local topCardData = containedObjects[#containedObjects]\n return getDoomThresholdFromGMNotes(topCardData.GMNotes)\n end\n end\n return nil\nend\n\n-- decodes the gm notes and return the doom treshhold\nfunction getDoomThresholdFromGMNotes(notes)\n local metadata = JSON.decode(notes) or {}\n if metadata.doomThresholdPerInvestigator then\n return metadata.doomThresholdPerInvestigator * playAreaApi.getInvestigatorCount() + metadata.doomThreshold\n else\n return metadata.doomThreshold\n end\nend\n\n-- XML UI functions\nfunction optionClick(_, optionName)\n options[optionName] = not options[optionName]\n printToAll(\"Doom removal of \" .. optionName .. (options[optionName] and \" enabled\" or \" disabled\"))\nend\n\nfunction toggleOptions()\n optionsVisible = not optionsVisible\n\n if optionsVisible then\n self.UI.show(\"Options\")\n else\n self.UI.hide(\"Options\")\n end\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[0,{\"Agenda\":true,\"Playarea\":true,\"Playermats\":true}]", "MeasureMovement": false, "Name": "Custom_Token", @@ -2380,7 +2392,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GenericCounter\")\nend)\n__bundle_register(\"core/GenericCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nMIN_VALUE = 0\nMAX_VALUE = 99\nval = 0\n\nfunction onSave() return JSON.encode(val) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n val = JSON.decode(savedData)\n end\n\n local name = self.getName()\n local position = {}\n\n if name == \"Damage\" or name == \"Resources\" or name == \"Resource Counter\" then\n position = { 0, 0.06, 0.1 }\n elseif name == \"Horror\" then\n position = { -0.025, 0.06, -0.025 }\n elseif name == \"Elder Sign Counter\" or name == \"Auto-fail Counter\" then\n position = { 0, 0.1, 0 }\n else\n position = { 0, 0.06, 0 }\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = position,\n height = 600,\n width = 1000,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n self.addContextMenuItem(\"Add 5\", function() updateVal(val + 5) end)\n self.addContextMenuItem(\"Subtract 5\", function() updateVal(val - 5) end)\n self.addContextMenuItem(\"Add 10\", function() updateVal(val + 10) end)\n self.addContextMenuItem(\"Subtract 10\", function() updateVal(val - 10) end)\nend\n\nfunction updateVal(newVal)\n if tonumber(newVal) then\n val = math.min(math.max(newVal, MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\n end\nend\n\nfunction addOrSubtract(_, _, isRightClick)\n val = math.min(math.max(val + (isRightClick and -1 or 1), MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GenericCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nMIN_VALUE = 0\nMAX_VALUE = 99\nval = 0\n\nfunction onSave() return JSON.encode(val) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n val = JSON.decode(savedData)\n end\n\n local name = self.getName()\n local position = {}\n\n if name == \"Damage\" or name == \"Resources\" or name == \"Resource Counter\" then\n position = { 0, 0.06, 0.1 }\n elseif name == \"Horror\" then\n position = { -0.025, 0.06, -0.025 }\n elseif name == \"Elder Sign Counter\" or name == \"Auto-fail Counter\" then\n position = { 0, 0.1, 0 }\n else\n position = { 0, 0.06, 0 }\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = position,\n height = 600,\n width = 1000,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n self.addContextMenuItem(\"Add 5\", function() updateVal(val + 5) end)\n self.addContextMenuItem(\"Subtract 5\", function() updateVal(val - 5) end)\n self.addContextMenuItem(\"Add 10\", function() updateVal(val + 10) end)\n self.addContextMenuItem(\"Subtract 10\", function() updateVal(val - 10) end)\nend\n\nfunction updateVal(newVal)\n if tonumber(newVal) then\n val = math.min(math.max(newVal, MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\n end\nend\n\nfunction addOrSubtract(_, _, isRightClick)\n val = math.min(math.max(val + (isRightClick and -1 or 1), MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GenericCounter\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "0", "MeasureMovement": false, "Name": "Custom_Token", @@ -2677,7 +2689,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GenericCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nMIN_VALUE = 0\nMAX_VALUE = 99\nval = 0\n\nfunction onSave() return JSON.encode(val) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n val = JSON.decode(savedData)\n end\n\n local name = self.getName()\n local position = {}\n\n if name == \"Damage\" or name == \"Resources\" or name == \"Resource Counter\" then\n position = { 0, 0.06, 0.1 }\n elseif name == \"Horror\" then\n position = { -0.025, 0.06, -0.025 }\n elseif name == \"Elder Sign Counter\" or name == \"Auto-fail Counter\" then\n position = { 0, 0.1, 0 }\n else\n position = { 0, 0.06, 0 }\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = position,\n height = 600,\n width = 1000,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n self.addContextMenuItem(\"Add 5\", function() updateVal(val + 5) end)\n self.addContextMenuItem(\"Subtract 5\", function() updateVal(val - 5) end)\n self.addContextMenuItem(\"Add 10\", function() updateVal(val + 10) end)\n self.addContextMenuItem(\"Subtract 10\", function() updateVal(val - 10) end)\nend\n\nfunction updateVal(newVal)\n if tonumber(newVal) then\n val = math.min(math.max(newVal, MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\n end\nend\n\nfunction addOrSubtract(_, _, isRightClick)\n val = math.min(math.max(val + (isRightClick and -1 or 1), MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GenericCounter\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GenericCounter\")\nend)\n__bundle_register(\"core/GenericCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nMIN_VALUE = 0\nMAX_VALUE = 99\nval = 0\n\nfunction onSave() return JSON.encode(val) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n val = JSON.decode(savedData)\n end\n\n local name = self.getName()\n local position = {}\n\n if name == \"Damage\" or name == \"Resources\" or name == \"Resource Counter\" then\n position = { 0, 0.06, 0.1 }\n elseif name == \"Horror\" then\n position = { -0.025, 0.06, -0.025 }\n elseif name == \"Elder Sign Counter\" or name == \"Auto-fail Counter\" then\n position = { 0, 0.1, 0 }\n else\n position = { 0, 0.06, 0 }\n end\n\n self.createButton({\n label = tostring(val),\n click_function = \"addOrSubtract\",\n function_owner = self,\n position = position,\n height = 600,\n width = 1000,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n self.addContextMenuItem(\"Add 5\", function() updateVal(val + 5) end)\n self.addContextMenuItem(\"Subtract 5\", function() updateVal(val - 5) end)\n self.addContextMenuItem(\"Add 10\", function() updateVal(val + 10) end)\n self.addContextMenuItem(\"Subtract 10\", function() updateVal(val - 10) end)\nend\n\nfunction updateVal(newVal)\n if tonumber(newVal) then\n val = math.min(math.max(newVal, MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\n end\nend\n\nfunction addOrSubtract(_, _, isRightClick)\n val = math.min(math.max(val + (isRightClick and -1 or 1), MIN_VALUE), MAX_VALUE)\n self.editButton({ index = 0, label = tostring(val) })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "0", "MeasureMovement": false, "Name": "Custom_Token", @@ -3382,7 +3394,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "function onLoad()\r\n self.addContextMenuItem(\"Download\", download)\r\nend\r\n\r\nfunction download()\r\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\r\nend\r", + "LuaScript": "function onLoad()\n self.addContextMenuItem(\"Download\", download)\nend\n\nfunction download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -3700,7 +3712,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/Trashcan\")\nend)\n__bundle_register(\"util/Trashcan\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- adds a context menu entry to trigger the emptying\nfunction onLoad()\n self.addContextMenuItem(\"Empty Trash\", emptyTrash)\nend\n\n-- removes all objects by taking them out and then destructing them\nfunction emptyTrash()\n for _, trash in ipairs(self.getObjects()) do\n self.takeObject().destruct()\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/Trashcan\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- adds a context menu entry to trigger the emptying\nfunction onLoad()\n self.addContextMenuItem(\"Empty Trash\", emptyTrash)\nend\n\n-- removes all objects by taking them out and then destructing them\nfunction emptyTrash()\n for _, trash in ipairs(self.getObjects()) do\n self.takeObject().destruct()\n end\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/Trashcan\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, @@ -7904,7 +7916,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/Trashcan\")\nend)\n__bundle_register(\"util/Trashcan\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- adds a context menu entry to trigger the emptying\nfunction onLoad()\n self.addContextMenuItem(\"Empty Trash\", emptyTrash)\nend\n\n-- removes all objects by taking them out and then destructing them\nfunction emptyTrash()\n for _, trash in ipairs(self.getObjects()) do\n self.takeObject().destruct()\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/Trashcan\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- adds a context menu entry to trigger the emptying\nfunction onLoad()\n self.addContextMenuItem(\"Empty Trash\", emptyTrash)\nend\n\n-- removes all objects by taking them out and then destructing them\nfunction emptyTrash()\n for _, trash in ipairs(self.getObjects()) do\n self.takeObject().destruct()\n end\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/Trashcan\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, @@ -17041,7 +17053,7 @@ }, "Autoraise": true, "ColorDiffuse": { - "a": 0.75, + "a": 0.25, "b": 0.168, "g": 0.701, "r": 0.192 @@ -17125,7 +17137,7 @@ }, "Description": "Ally. Detective. Police.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"b5151\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Detective. Police.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Beta\"\r\n}\r", + "GMNotes": "{\n \"id\": \"b5151\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Detective. Police.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Beta\"\n}", "GUID": "94f23b", "Grid": true, "GridProjection": false, @@ -17187,7 +17199,7 @@ }, "Description": "Item. Weapon. Melee.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"b8060\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Beta\"\r\n}\r", + "GMNotes": "{\n \"id\": \"b8060\",\n \"type\": \"Asset\",\n \"class\": \"Guardian|Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"Beta\"\n}", "GUID": "a20aef", "Grid": true, "GridProjection": false, @@ -17249,7 +17261,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"B2023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"B2023\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Clothing.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "5cb973", "Grid": true, "GridProjection": false, @@ -17311,7 +17323,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"A2023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"A2023\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "9c32e2", "Grid": true, "GridProjection": false, @@ -18602,7 +18614,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table of items which can be counted in this Bowl\n-- Each entry has 2 things to enter\n-- a name (what is in the name field of that object)\n-- a value (how much it is worth)\n-- a number in the items description will override the number entry in this table\nlocal validCountItemList = {\n [\"Clue\"] = 1,\n [\"\"] = 1\n}\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(findValidItemsInSphere()) do\n local descValue = tonumber(item.getDescription())\n local stackMult = math.abs(item.getQuantity())\n -- Use value in description if available\n if descValue ~= nil then\n totalValue = totalValue + descValue * stackMult\n else\n -- Otherwise use the value in validCountItemList\n totalValue = totalValue + validCountItemList[item.getName()] * stackMult\n end\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction findValidItemsInSphere()\n local items = Physics.cast({\n origin = self.getPosition(),\n direction = { 0, 1, 0 },\n type = 2,\n max_distance = 0,\n size = { 2, 2, 2 }\n })\n\n local validItemList = {}\n for _, entry in ipairs(items) do\n if entry.hit_object ~= self then\n if validCountItemList[entry.hit_object.getName()] ~= nil then\n table.insert(validItemList, entry.hit_object)\n end\n end\n end\n return validItemList\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(findValidItemsInSphere()) do\n trash.putObject(obj)\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1.5, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(getClues()) do\n totalValue = totalValue + math.abs(item.getQuantity())\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(getClues()) do\n trash.putObject(obj)\n end\nend\n\nfunction getClues()\n return searchLib.inArea(self.getPosition(), self.getRotation(), { 2, 1, 2 }, \"isClue\")\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -18668,7 +18680,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table of items which can be counted in this Bowl\n-- Each entry has 2 things to enter\n-- a name (what is in the name field of that object)\n-- a value (how much it is worth)\n-- a number in the items description will override the number entry in this table\nlocal validCountItemList = {\n [\"Clue\"] = 1,\n [\"\"] = 1\n}\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(findValidItemsInSphere()) do\n local descValue = tonumber(item.getDescription())\n local stackMult = math.abs(item.getQuantity())\n -- Use value in description if available\n if descValue ~= nil then\n totalValue = totalValue + descValue * stackMult\n else\n -- Otherwise use the value in validCountItemList\n totalValue = totalValue + validCountItemList[item.getName()] * stackMult\n end\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction findValidItemsInSphere()\n local items = Physics.cast({\n origin = self.getPosition(),\n direction = { 0, 1, 0 },\n type = 2,\n max_distance = 0,\n size = { 2, 2, 2 }\n })\n\n local validItemList = {}\n for _, entry in ipairs(items) do\n if entry.hit_object ~= self then\n if validCountItemList[entry.hit_object.getName()] ~= nil then\n table.insert(validItemList, entry.hit_object)\n end\n end\n end\n return validItemList\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(findValidItemsInSphere()) do\n trash.putObject(obj)\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1.5, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(getClues()) do\n totalValue = totalValue + math.abs(item.getQuantity())\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(getClues()) do\n trash.putObject(obj)\n end\nend\n\nfunction getClues()\n return searchLib.inArea(self.getPosition(), self.getRotation(), { 2, 1, 2 }, \"isClue\")\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -18734,7 +18746,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table of items which can be counted in this Bowl\n-- Each entry has 2 things to enter\n-- a name (what is in the name field of that object)\n-- a value (how much it is worth)\n-- a number in the items description will override the number entry in this table\nlocal validCountItemList = {\n [\"Clue\"] = 1,\n [\"\"] = 1\n}\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(findValidItemsInSphere()) do\n local descValue = tonumber(item.getDescription())\n local stackMult = math.abs(item.getQuantity())\n -- Use value in description if available\n if descValue ~= nil then\n totalValue = totalValue + descValue * stackMult\n else\n -- Otherwise use the value in validCountItemList\n totalValue = totalValue + validCountItemList[item.getName()] * stackMult\n end\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction findValidItemsInSphere()\n local items = Physics.cast({\n origin = self.getPosition(),\n direction = { 0, 1, 0 },\n type = 2,\n max_distance = 0,\n size = { 2, 2, 2 }\n })\n\n local validItemList = {}\n for _, entry in ipairs(items) do\n if entry.hit_object ~= self then\n if validCountItemList[entry.hit_object.getName()] ~= nil then\n table.insert(validItemList, entry.hit_object)\n end\n end\n end\n return validItemList\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(findValidItemsInSphere()) do\n trash.putObject(obj)\n end\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1.5, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(getClues()) do\n totalValue = totalValue + math.abs(item.getQuantity())\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(getClues()) do\n trash.putObject(obj)\n end\nend\n\nfunction getClues()\n return searchLib.inArea(self.getPosition(), self.getRotation(), { 2, 1, 2 }, \"isClue\")\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -18800,7 +18812,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table of items which can be counted in this Bowl\n-- Each entry has 2 things to enter\n-- a name (what is in the name field of that object)\n-- a value (how much it is worth)\n-- a number in the items description will override the number entry in this table\nlocal validCountItemList = {\n [\"Clue\"] = 1,\n [\"\"] = 1\n}\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(findValidItemsInSphere()) do\n local descValue = tonumber(item.getDescription())\n local stackMult = math.abs(item.getQuantity())\n -- Use value in description if available\n if descValue ~= nil then\n totalValue = totalValue + descValue * stackMult\n else\n -- Otherwise use the value in validCountItemList\n totalValue = totalValue + validCountItemList[item.getName()] * stackMult\n end\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction findValidItemsInSphere()\n local items = Physics.cast({\n origin = self.getPosition(),\n direction = { 0, 1, 0 },\n type = 2,\n max_distance = 0,\n size = { 2, 2, 2 }\n })\n\n local validItemList = {}\n for _, entry in ipairs(items) do\n if entry.hit_object ~= self then\n if validCountItemList[entry.hit_object.getName()] ~= nil then\n table.insert(validItemList, entry.hit_object)\n end\n end\n end\n return validItemList\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(findValidItemsInSphere()) do\n trash.putObject(obj)\n end\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/ClueCounter\")\nend)\n__bundle_register(\"playermat/ClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nexposedValue = 0\n\nfunction onLoad()\n self.createButton({\n label = \"\",\n click_function = \"countItems\",\n function_owner = self,\n position = { 0, 0.1, 0 },\n height = 0,\n width = 0,\n font_color = { 0, 0, 0 },\n font_size = 2000\n })\n loopID = Wait.time(countItems, 1.5, -1)\nend\n\n-- Activated once per second, counts items in bowls\nfunction countItems()\n local totalValue = 0\n for _, item in ipairs(getClues()) do\n totalValue = totalValue + math.abs(item.getQuantity())\n end\n exposedValue = totalValue\n self.editButton({ index = 0, label = totalValue })\nend\n\nfunction removeAllClues(trash)\n for _, obj in ipairs(getClues()) do\n trash.putObject(obj)\n end\nend\n\nfunction getClues()\n return searchLib.inArea(self.getPosition(), self.getRotation(), { 2, 1, 2 }, \"isClue\")\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -18857,7 +18869,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/MasterClueCounter\")\nend)\n__bundle_register(\"core/MasterClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- variables are intentionally global to be accessible\ncount = 0\nuseClickableCounters = false\n\nfunction onSave() return JSON.encode(useClickableCounters) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n useClickableCounters = JSON.decode(savedData)\n end\n self.createButton({\n label = \"0\",\n click_function = \"removeAllPlayerClues\",\n tooltip = \"Click here to remove all collected clues\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 900,\n width = 900,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 650,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n Wait.time(sumClues, 2, -1)\nend\n\n-- removes all player clues by calling the respective function from the counting bowls / clickers\nfunction removeAllPlayerClues()\n printToAll(count .. \" clue(s) from playermats removed.\", \"White\")\n playmatApi.removeClues(\"All\")\n self.editButton({ index = 0, label = \"0\" })\nend\n\n-- gets the counted values from the counting bowls / clickers and sums them up\nfunction sumClues()\n count = playmatApi.getClueCount(useClickableCounters, \"All\")\n self.editButton({ index = 0, label = tostring(count) })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/MasterClueCounter\")\nend)\n__bundle_register(\"core/MasterClueCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- variables are intentionally global to be accessible\ncount = 0\nuseClickableCounters = false\n\nfunction onSave() return JSON.encode(useClickableCounters) end\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n useClickableCounters = JSON.decode(savedData)\n end\n self.createButton({\n label = \"0\",\n click_function = \"removeAllPlayerClues\",\n tooltip = \"Click here to remove all collected clues\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 900,\n width = 900,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 650,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n Wait.time(sumClues, 2, -1)\nend\n\n-- removes all player clues by calling the respective function from the counting bowls / clickers\nfunction removeAllPlayerClues()\n printToAll(count .. \" clue(s) from playermats removed.\", \"White\")\n playmatApi.removeClues(\"All\")\n self.editButton({ index = 0, label = \"0\" })\nend\n\n-- gets the counted values from the counting bowls / clickers and sums them up\nfunction sumClues()\n count = playmatApi.getClueCount(useClickableCounters, \"All\")\n self.editButton({ index = 0, label = tostring(count) })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "false", "MeasureMovement": false, "Name": "Custom_Token", @@ -20148,8 +20160,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayArea\")\nend)\n__bundle_register(\"core/PlayArea\", function(require, _LOADED, __bundle_register, __bundle_modules)\n---------------------------------------------------------\n-- general setup\n---------------------------------------------------------\n\n-- Location connection directional options\nlocal BIDIRECTIONAL = 0\nlocal ONE_WAY = 1\nlocal INCOMING_ONE_WAY = 2\n\n-- Connector draw parameters\nlocal CONNECTION_THICKNESS = 0.015\nlocal DRAGGING_CONNECTION_THICKNESS = 0.15\nlocal DRAGGING_CONNECTION_COLOR = { 0.8, 0.8, 0.8, 1 }\nlocal CONNECTION_COLOR = { 0.4, 0.4, 0.4, 1 }\nlocal DIRECTIONAL_ARROW_DISTANCE = 3.5\nlocal ARROW_ARM_LENGTH = 0.9\nlocal ARROW_ANGLE = 25\n\n-- Height to draw the connector lines, places them just above the table and always below cards\nlocal CONNECTION_LINE_Y = 1.529\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- used for recreating the link to a custom data helper after image change\ncustomDataHelper = nil\n\nlocal DEFAULT_URL =\n\"http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/\"\n\nlocal SHIFT_OFFSETS = {\n left = { x = 0.00, y = 0, z = 7.67 },\n right = { x = 0.00, y = 0, z = -7.67 },\n up = { x = 6.54, y = 0, z = 0.00 },\n down = { x = -6.54, y = 0, z = 0.00 }\n}\nlocal SHIFT_EXCLUSION = {\n [\"b7b45b\"] = true,\n [\"f182ee\"] = true,\n [\"721ba2\"] = true\n}\nlocal LOC_LINK_EXCLUDE_SCENARIOS = {\n [\"The Witching Hour\"] = true,\n [\"The Heart of Madness\"] = true\n}\n\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal tokenManager = require(\"core/token/TokenManager\")\nlocal clueData = {}\nlocal spawnedLocationGUIDs = {}\nlocal locations = {}\nlocal locationConnections = {}\nlocal draggingGuids = {}\nlocal missingData = {}\nlocal locationData, currentScenario\n\n---------------------------------------------------------\n-- general code\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({\n trackedLocations = locations,\n currentScenario = currentScenario,\n })\nend\n\nfunction onLoad(saveState)\n -- records locations we have spawned clues for\n local save = JSON.decode(saveState) or {}\n locations = save.trackedLocations or {}\n currentScenario = save.currentScenario\n\n self.interactable = false\n Wait.time(function() collisionEnabled = true end, 1)\nend\n\n-- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n-- data to the local token manager instance.\n---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\nfunction updateLocations(args)\n customDataHelper = getObjectFromGUID(args[1])\n if customDataHelper ~= nil then\n tokenManager.addLocationData(customDataHelper.getTable(\"LOCATIONS_DATA\"))\n end\nend\n\nfunction updateSurface(newURL)\n local customInfo = self.getCustomObject()\n\n if newURL ~= \"\" and newURL ~= nil and newURL ~= DEFAULT_URL then\n customInfo.image = newURL\n broadcastToAll(\"New Playmat Image Applied\", { 0.2, 0.9, 0.2 })\n else\n customInfo.image = DEFAULT_URL\n broadcastToAll(\"Default Playmat Image Applied\", { 0.2, 0.9, 0.2 })\n end\n\n self.setCustomObject(customInfo)\n\n local guid = nil\n\n if customDataHelper then guid = customDataHelper.getGUID() end\n self.reload()\n\n if guid ~= nil then\n Wait.time(function() updateLocations({ guid }) end, 1)\n end\nend\n\nfunction onCollisionEnter(collisionInfo)\n local obj = collisionInfo.collision_object\n local objType = obj.name\n\n -- only continue for cards\n if not collisionEnabled or (objType ~= \"Card\" and objType ~= \"CardCustom\") then\n if objType == \"Deck\" then\n table.insert(missingData, obj)\n end\n return\n end\n\n -- check if we should spawn clues here and do so according to playercount\n local card = collisionInfo.collision_object\n if shouldSpawnTokens(card) then\n tokenManager.spawnForCard(card)\n end\n \n -- If this card was being dragged, clear the dragging connections. A multi-drag/drop may send\n -- the dropped card immediately into a deck, so this has to be done here\n if draggingGuids[card.getGUID()] ~= nil then\n card.setVectorLines(nil)\n draggingGuids[card.getGUID()] = nil\n end\n \n maybeTrackLocation(card)\nend\n\nfunction shouldSpawnTokens(card)\n local metadata = JSON.decode(card.getGMNotes())\n if metadata == nil then\n return tokenManager.hasLocationData(card)\n end\n return metadata.type == \"Location\"\n or metadata.type == \"Enemy\"\n or metadata.type == \"Treachery\"\n or metadata.weakness\n -- hardcoded IDs for \"Makeshift Trap\" and \"Shrine of the Moirai\"\n -- these cards are events with uses, that attach to encounter cards and thus will enter play in the playarea\n -- TODO: probably turn this into a metadata field if we get more cards like that\n or metadata.id == \"07310\"\n or metadata.id == \"09100\"\nend\n\nfunction onCollisionExit(collisionInfo)\n maybeUntrackLocation(collisionInfo.collision_object)\nend\n\n-- Destroyed objects don't trigger onCollisionExit(), so check on destruction to untrack as well\nfunction onObjectDestroy(object)\n maybeUntrackLocation(object)\nend\n\nfunction onObjectPickUp(player, object)\n -- only continue for cards\n local objType = object.name\n if objType ~= \"Card\" and objType ~= \"CardCustom\" then return end\n\n -- onCollisionExit USUALLY fires first, so we have to check the card to see if it's a location we\n -- should be tracking\n if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= \"\" then\n local pickedUpGuid = object.getGUID()\n local metadata = JSON.decode(object.getGMNotes()) or {}\n if metadata.type == \"Location\" then\n -- onCollisionExit sometimes comes 1 frame after onObjectPickUp (rather than before it or in\n -- the same frame). This causes a mismatch in the data between dragging the on-table, and\n -- that one frame draws connectors on the card which then show up as shadows for snap points.\n -- Waiting ensures we always do thing in the expected Exit-\u003ePickUp order\n Wait.frames(function()\n if object.is_face_down then\n draggingGuids[pickedUpGuid] = metadata.locationBack\n else\n draggingGuids[pickedUpGuid] = metadata.locationFront\n end\n rebuildConnectionList()\n end, 2)\n end\n end\nend\n\nfunction onUpdate()\n -- Due to the frequence of onUpdate calls, ensure that we only process any changes to the\n -- connection list once, and only redraw once\n local needsConnectionRebuild = false\n local needsConnectionDraw = false\n for guid, _ in pairs(draggingGuids) do\n local obj = getObjectFromGUID(guid)\n if obj == nil or not isInPlayArea(obj) then\n draggingGuids[guid] = nil\n needsConnectionRebuild = true\n -- If object still exists then it's been dragged outside the area and needs to clear the\n -- lines attached to it\n if obj ~= nil then\n obj.setVectorLines(nil)\n end\n end\n -- Even if the last location left the play area, need one last draw to clear the lines\n needsConnectionDraw = true\n end\n if (needsConnectionRebuild) then\n rebuildConnectionList()\n end\n if needsConnectionDraw then\n drawDraggingConnections()\n end\nend\n\n-- Checks the given card and adds it to the list of locations tracked for connection purposes.\n-- A card will be added to the tracking if it is a location in the play area (based on centerpoint).\n---@param card Object A card object, possibly a location.\nfunction maybeTrackLocation(card)\n -- Collision checks for any part of the card overlap, but our other tracking is centerpoint\n -- Ignore any collision where the centerpoint isn't in the area\n if isInPlayArea(card) then\n local metadata = JSON.decode(card.getGMNotes())\n if metadata == nil then\n table.insert(missingData, card)\n else\n if metadata.type == \"Location\" then\n if card.is_face_down then\n locations[card.getGUID()] = metadata.locationBack\n else\n locations[card.getGUID()] = metadata.locationFront\n end\n\n -- only draw connection lines for not-excluded scenarios\n if showLocationLinks() then\n rebuildConnectionList()\n drawBaseConnections()\n end\n end\n end\n end\nend\n\n-- Stop tracking a location for connection drawing. This should be called for both collision exit\n-- and destruction, as a destroyed object does not trigger collision exit. An object can also be\n-- deleted mid-drag, but the ordering for drag events means we can't clear those here and those will\n-- be cleared in the next onUpdate() cycle.\n---@param card Object Card to (maybe) stop tracking\nfunction maybeUntrackLocation(card)\n -- Locked objects no longer collide (hence triggering an exit event) but are still in the play\n -- area. If the object is now locked, don't remove it.\n if locations[card.getGUID()] ~= nil and not card.locked then\n locations[card.getGUID()] = nil\n rebuildConnectionList()\n drawBaseConnections()\n end\nend\n\n-- Global event handler, delegated from Global. Clears any connection lines from dragged cards\n-- before they are destroyed by entering a deck. Removal of the card from the dragging list will\n-- be handled during the next onUpdate() call.\nfunction tryObjectEnterContainer(params)\n for draggedGuid, _ in pairs(draggingGuids) do\n local draggedObj = getObjectFromGUID(draggedGuid)\n if draggedObj ~= nil then\n draggedObj.setVectorLines(nil)\n end\n end\nend\n\n-- Builds a list of GUID to GUID connection information based on the currently tracked locations.\n-- This will update the connection information and store it in the locationConnections data member,\n-- but does not draw those connections. This should often be followed by a call to\n-- drawBaseConnections()\nfunction rebuildConnectionList()\n if not showLocationLinks() then\n locationConnections = {}\n return\n end\n\n local iconCardList = {}\n\n -- Build a list of cards with each icon as their location ID\n for cardId, metadata in pairs(draggingGuids) do\n buildLocListByIcon(cardId, iconCardList, metadata)\n end\n for cardId, metadata in pairs(locations) do\n buildLocListByIcon(cardId, iconCardList, metadata)\n end\n\n -- Pair up all the icons\n locationConnections = {}\n for cardId, metadata in pairs(draggingGuids) do\n buildConnection(cardId, iconCardList, metadata)\n end\n for cardId, metadata in pairs(locations) do\n if draggingGuids[cardId] == nil then\n buildConnection(cardId, iconCardList, metadata)\n end\n end\nend\n\n-- Extracts the card's icon string into a list of individual location icons\n---@param cardID String GUID of the card to pull the icon data from\n---@param iconCardList Table A table of icon-\u003eGUID list. Mutable, will be updated by this method\n---@param locData Table A table containing the metadata for the card (for the correct side)\nfunction buildLocListByIcon(cardId, iconCardList, locData)\n if locData ~= nil and locData.icons ~= nil then\n for icon in string.gmatch(locData.icons, \"%a+\") do\n if iconCardList[icon] == nil then\n iconCardList[icon] = {}\n end\n table.insert(iconCardList[icon], cardId)\n end\n end\nend\n\n-- Builds the connections for the given cardID by finding matching icons and adding them to the\n-- Playarea's locationConnections table.\n---@param cardId String GUID of the card to build the connections for\n---@param iconCardList Table A table of icon-\u003eGUID List. Used to find matching icons for connections.\n---@param locData Table A table containing the metadata for the card (for the correct side)\nfunction buildConnection(cardId, iconCardList, locData)\n if locData ~= nil and locData.connections ~= nil then\n locationConnections[cardId] = {}\n for icon in string.gmatch(locData.connections, \"%a+\") do\n if iconCardList[icon] ~= nil then\n for _, connectedGuid in ipairs(iconCardList[icon]) do\n -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way\n if locationConnections[connectedGuid] ~= nil\n and (locationConnections[connectedGuid][cardId] == ONE_WAY\n or locationConnections[connectedGuid][cardId] == BIDIRECTIONAL) then\n locationConnections[connectedGuid][cardId] = BIDIRECTIONAL\n locationConnections[cardId][connectedGuid] = nil\n else\n if locationConnections[connectedGuid] == nil then\n locationConnections[connectedGuid] = {}\n end\n locationConnections[cardId][connectedGuid] = ONE_WAY\n locationConnections[connectedGuid][cardId] = INCOMING_ONE_WAY\n end\n end\n end\n end\n end\nend\n\n-- Draws the lines for connections currently in locationConnections but not in draggingGuids.\n-- Constructed vectors will be set to the playmat\nfunction drawBaseConnections()\n if not showLocationLinks() then\n locationConnections = {}\n return\n end\n local cardConnectionLines = {}\n\n for originGuid, targetGuids in pairs(locationConnections) do\n -- Objects should reliably exist at this point, but since this can be called during onUpdate the\n -- object checks are conservative just to make sure.\n local origin = getObjectFromGUID(originGuid)\n if draggingGuids[originGuid] == nil and origin != nil then\n for targetGuid, direction in pairs(targetGuids) do\n local target = getObjectFromGUID(targetGuid)\n if draggingGuids[targetGuid] == nil and target != nil then\n -- Since we process the full list, we're guaranteed to hit any ONE_WAY connections later\n -- so we can ignore INCOMING_ONE_WAY\n if direction == BIDIRECTIONAL then\n addBidirectionalVector(origin, target, self, cardConnectionLines)\n elseif direction == ONE_WAY then\n addOneWayVector(origin, target, self, cardConnectionLines)\n end\n end\n end\n end\n end\n self.setVectorLines(cardConnectionLines)\nend\n\n-- Draws the lines for cards which are currently being dragged.\nfunction drawDraggingConnections()\n if not showLocationLinks() then\n return\n end\n local cardConnectionLines = {}\n local ownedVectors = {}\n\n for originGuid, _ in pairs(draggingGuids) do\n targetGuids = locationConnections[originGuid]\n -- Objects should reliably exist at this point, but since this can be called during onUpdate the\n -- object checks are conservative just to make sure.\n local origin = getObjectFromGUID(originGuid)\n if draggingGuids[originGuid] and origin ~= nil and targetGuids ~= nil then\n ownedVectors[originGuid] = {}\n for targetGuid, direction in pairs(targetGuids) do\n local target = getObjectFromGUID(targetGuid)\n if target != nil then\n if direction == BIDIRECTIONAL then\n addBidirectionalVector(origin, target, origin, ownedVectors[originGuid])\n elseif direction == ONE_WAY then\n addOneWayVector(origin, target, origin, ownedVectors[originGuid])\n elseif direction == INCOMING_ONE_WAY and not draggingGuids[targetGuid] then\n addOneWayVector(target, origin, origin, ownedVectors[originGuid])\n end\n end\n end\n end\n end\n for ownerGuid, vectors in pairs(ownedVectors) do\n local card = getObjectFromGUID(ownerGuid)\n card.setVectorLines(vectors)\n end\nend\n\n-- Draws a bidirectional location connection between the two cards, adding the lines to do so to the\n-- given lines list.\n---@param card1 Object One of the card objects to connect\n---@param card2 Object The other card object to connect\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this connector\nfunction addBidirectionalVector(card1, card2, vectorOwner, lines)\n local cardPos1 = card1.getPosition()\n local cardPos2 = card2.getPosition()\n cardPos1.y = CONNECTION_LINE_Y\n cardPos2.y = CONNECTION_LINE_Y\n\n local pos1 = vectorOwner.positionToLocal(cardPos1)\n local pos2 = vectorOwner.positionToLocal(cardPos2)\n\n table.insert(lines, {\n points = { pos1, pos2 },\n color = vectorOwner == self and CONNECTION_COLOR or DRAGGING_CONNECTION_COLOR,\n thickness = vectorOwner == self and CONNECTION_THICKNESS or DRAGGING_CONNECTION_THICKNESS,\n })\nend\n\n-- Draws a one-way location connection between the two cards, adding the lines to do so to the\n-- given lines list. Arrows will point towards the target card.\n---@param origin Object Origin card in the connection\n---@param target Object Target card object to connect\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this connector\nfunction addOneWayVector(origin, target, vectorOwner, lines)\n -- Start with the BiDi then add the arrow lines to it\n addBidirectionalVector(origin, target, vectorOwner, lines)\n local originPos = origin.getPosition()\n local targetPos = target.getPosition()\n originPos.y = CONNECTION_LINE_Y\n targetPos.y = CONNECTION_LINE_Y\n\n -- Calculate card distance to be closer for horizontal positions than vertical, since cards are\n -- taller than they are wide\n local heading = Vector(originPos):sub(targetPos):heading(\"y\")\n local distanceFromCard = DIRECTIONAL_ARROW_DISTANCE * 0.7 +\n DIRECTIONAL_ARROW_DISTANCE * 0.3 * math.abs(math.sin(math.rad(heading)))\n\n -- Calculate the three possible arrow positions. These are offset by half the arrow length to\n -- make them visually balanced by keeping the arrows centered, not tracking the point\n local midpoint = Vector(originPos):add(targetPos):scale(Vector(0.5, 0.5, 0.5)):moveTowards(targetPos,\n ARROW_ARM_LENGTH / 2)\n local closeToOrigin = Vector(originPos):moveTowards(targetPos, distanceFromCard + ARROW_ARM_LENGTH / 2)\n local closeToTarget = Vector(targetPos):moveTowards(originPos, distanceFromCard - ARROW_ARM_LENGTH / 2)\n\n if (originPos:distance(closeToOrigin) \u003e originPos:distance(closeToTarget)) then\n addArrowLines(midpoint, originPos, vectorOwner, lines)\n else\n addArrowLines(closeToOrigin, originPos, vectorOwner, lines)\n addArrowLines(closeToTarget, originPos, vectorOwner, lines)\n end\nend\n\n-- Draws an arrowhead at the given position.\n---@param arrowheadPosition Table Centerpoint of the arrowhead to draw (NOT the tip of the arrow)\n---@param originPos Table Origin point of the connection, used to position the arrow arms\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this arrow\nfunction addArrowLines(arrowheadPos, originPos, vectorOwner, lines)\n local arrowArm1 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver(\"y\",\n -1 * ARROW_ANGLE):add(arrowheadPos)\n local arrowArm2 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver(\"y\",\n ARROW_ANGLE):add(arrowheadPos)\n\n local head = vectorOwner.positionToLocal(arrowheadPos)\n local arm1 = vectorOwner.positionToLocal(arrowArm1)\n local arm2 = vectorOwner.positionToLocal(arrowArm2)\n table.insert(lines, {\n points = { arm1, head, arm2 },\n color = vectorOwner == self and CONNECTION_COLOR or DRAGGING_CONNECTION_COLOR,\n thickness = vectorOwner == self and CONNECTION_THICKNESS or DRAGGING_CONNECTION_THICKNESS,\n })\nend\n\n-- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n-- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n---@param playerColor String Color of the player requesting the shift. Used solely to send an error\n--- message in the unlikely case that the scripting zone has been deleted\nfunction shiftContentsUp(playerColor)\n shiftContents(playerColor, \"up\")\nend\n\nfunction shiftContentsDown(playerColor)\n shiftContents(playerColor, \"down\")\nend\n\nfunction shiftContentsLeft(playerColor)\n shiftContents(playerColor, \"left\")\nend\n\nfunction shiftContentsRight(playerColor)\n shiftContents(playerColor, \"right\")\nend\n\nfunction shiftContents(playerColor, direction)\n local zone = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n if not zone then\n broadcastToColor(\"Scripting zone couldn't be found.\", playerColor, \"Red\")\n return\n end\n\n for _, object in ipairs(zone.getObjects()) do\n if not (SHIFT_EXCLUSION[object.getGUID()] or object.hasTag(\"displacement_excluded\")) then\n object.translate(SHIFT_OFFSETS[direction])\n end\n end\n Wait.time(drawBaseConnections, 0.1)\nend\n\n-- Check to see if the given object is within the bounds of the play area, based solely on the X and\n-- Z coordinates, ignoring height\n---@param object Object Object to check\n---@return. True if the object is inside the play area\nfunction isInPlayArea(object)\n local bounds = self.getBounds()\n local position = object.getPosition()\n -- Corners are arbitrary since it's all global - c1 goes down both axes, c2 goes up\n local c1 = { x = bounds.center.x - bounds.size.x / 2, z = bounds.center.z - bounds.size.z / 2 }\n local c2 = { x = bounds.center.x + bounds.size.x / 2, z = bounds.center.z + bounds.size.z / 2 }\n\n return position.x \u003e c1.x and position.x \u003c c2.x and position.z \u003e c1.z and position.z \u003c c2.z\nend\n\n-- Reset the play area's tracking of which cards have had tokens spawned.\nfunction resetSpawnedCards()\n spawnedLocationGUIDs = {}\nend\n\nfunction onScenarioChanged(scenarioName)\n currentScenario = scenarioName\n if not showLocationLinks() then\n broadcastToAll(\"Automatic location connections not available for this scenario\")\n end\nend\n\nfunction showLocationLinks()\n return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario]\nend\n\n-- Sets this playmat's snap points to limit snapping to locations or not.\n-- If matchTypes is false, snap points will be reset to snap all cards.\n---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Location\" }\n else\n table.insert(snaps[i].tags, \"Location\")\n end\n else\n snaps[i].tags = nil\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- count victory points on locations in play area\n---@param highlightOff Boolean True if highlighting should be enabled\n---@return. Returns the total amount of VP found in the play area\nfunction countVP(highlightOff)\n local totalVP = 0\n\n for cardId, metadata in pairs(locations) do\n local card = getObjectFromGUID(cardId)\n if metadata ~= nil and card ~= nil then\n if highlightOff == true then\n card.highlightOff(\"Green\")\n end\n\n local cardVP = tonumber(metadata.victory) or 0\n if cardVP ~= 0 and not cardHasClues(card) then\n totalVP = totalVP + cardVP\n if highlightOff == false then\n card.highlightOn(\"Green\")\n end\n end\n end\n end\n\n return totalVP\nend\n\n-- checks if a card has clues on it, returns true if clues are on it\n---@param card TTSObject Card to check for clues\nfunction cardHasClues(card)\n for _, v in ipairs(searchOnObj(card)) do\n local obj = v.hit_object\n if obj.memo == \"clueDoom\" and obj.is_face_down == false then\n return true\n end\n end\n return false\nend\n\n-- searches on an object (by using its bounds)\n---@param obj Object Object to search on\nfunction searchOnObj(obj)\n return Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0.5,\n type = 3,\n size = obj.getBounds().size,\n origin = obj.getPosition()\n })\nend\n\n-- highlights all locations in the play area without metadata\n---@param state Boolean True if highlighting should be enabled\nfunction highlightMissingData(state)\n for i, obj in pairs(missingData) do\n if obj ~= nil then\n if state then\n obj.highlightOff(\"Red\")\n else\n obj.highlightOn(\"Red\")\n end\n else\n missingData[i] = nil\n end\n end\nend\n\n-- rebuilds local snap points (could be useful in the future again)\nfunction buildSnaps()\n local upperleft = { x = 1.53, z = -1.09 }\n local lowerright = { x = -1.53, z = 1.55 }\n local snaps = {}\n\n -- creates 81 snap points, for uneven rows + columns it makes a rotation snap point\n for i = 1, 9 do\n for j = 1, 9 do\n local snap = {}\n snap.position = {}\n snap.position.x = round(upperleft.x - (upperleft.x - lowerright.x) * (i - 1) / 8, 3)\n snap.position.y = 0.1\n snap.position.z = round(upperleft.z - (upperleft.z - lowerright.z) * (j - 1) / 8, 3)\n\n -- enable rotation snaps for uneven rows / columns\n if (i % 2 ~= 0) and (j % 2 ~= 0) then\n snap.rotation = { 0, 0, 0 }\n snap.rotation_snap = true\n end\n\n table.insert(snaps, snap)\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- utility function\nfunction round(num, numDecimalPlaces)\n local mult = 10 ^ (numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\nreturn __bundle_require(\"__root\")", - "LuaScriptState": "{\"trackedLocations\":[]}", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayArea\")\nend)\n__bundle_register(\"core/PlayArea\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- Location connection directional options\nlocal BIDIRECTIONAL = 0\nlocal ONE_WAY = 1\nlocal INCOMING_ONE_WAY = 2\n\n-- Connector draw parameters\nlocal CONNECTION_THICKNESS = 0.015\nlocal DRAGGING_CONNECTION_THICKNESS = 0.15\nlocal DRAGGING_CONNECTION_COLOR = { 0.8, 0.8, 0.8, 1 }\nlocal DIRECTIONAL_ARROW_DISTANCE = 3.5\nlocal ARROW_ARM_LENGTH = 0.9\nlocal ARROW_ANGLE = 25\n\n-- Height to draw the connector lines, places them just above the table and always below cards\nlocal CONNECTION_LINE_Y = 1.529\n\n-- used for recreating the link to a custom data helper after image change\ncustomDataHelper = nil\n\nlocal DEFAULT_URL = \"http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/\"\n\nlocal SHIFT_OFFSETS = {\n left = { x = 0.00, y = 0, z = 7.67 },\n right = { x = 0.00, y = 0, z = -7.67 },\n up = { x = 6.54, y = 0, z = 0.00 },\n down = { x = -6.54, y = 0, z = 0.00 }\n}\nlocal SHIFT_EXCLUSION = {\n [\"b7b45b\"] = true,\n [\"f182ee\"] = true,\n [\"721ba2\"] = true\n}\nlocal LOC_LINK_EXCLUDE_SCENARIOS = {\n [\"The Witching Hour\"] = true,\n [\"The Heart of Madness\"] = true\n}\n\nlocal clueData = {}\nlocal spawnedLocationGUIDs = {}\nlocal locations = {}\nlocal locationConnections = {}\nlocal draggingGuids = {}\nlocal missingData = {}\nlocal locationData, currentScenario, connectionsEnabled\n\n---------------------------------------------------------\n-- general code\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({\n trackedLocations = locations,\n currentScenario = currentScenario,\n connectionColor = connectionColor,\n connectionsEnabled = connectionsEnabled\n })\nend\n\nfunction onLoad(savedData)\n self.interactable = false -- this needs to be here since the playarea will be reloaded when the image changes\n local loadedData = JSON.decode(savedData) or {}\n locations = loadedData.trackedLocations or {}\n currentScenario = loadedData.currentScenario\n connectionColor = loadedData.connectionColor or { 0.4, 0.4, 0.4, 1 }\n connectionsEnabled = loadedData.connectionsEnabled or true\nend\n\n-- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n-- data to the local token manager instance.\n---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\nfunction updateLocations(args)\n customDataHelper = getObjectFromGUID(args[1])\n if customDataHelper ~= nil then\n tokenManager.addLocationData(customDataHelper.getTable(\"LOCATIONS_DATA\"))\n end\nend\n\n-- sets the image of the playarea\nfunction updateSurface(newURL)\n local customInfo = self.getCustomObject()\n\n if newURL ~= \"\" and newURL ~= nil and newURL ~= DEFAULT_URL then\n customInfo.image = newURL\n broadcastToAll(\"New Playarea Image Applied\", { 0.2, 0.9, 0.2 })\n else\n customInfo.image = DEFAULT_URL\n broadcastToAll(\"Default Playarea Image Applied\", { 0.2, 0.9, 0.2 })\n end\n\n self.setCustomObject(customInfo)\n\n local guid = nil\n\n if customDataHelper then guid = customDataHelper.getGUID() end\n self.reload()\n\n if guid ~= nil then\n Wait.time(function() updateLocations({ guid }) end, 1)\n end\nend\n\n-- TTS event, called for each object that is placed on the playarea\nfunction onCollisionEnter(collisionInfo)\n local obj = collisionInfo.collision_object\n local objType = obj.name\n\n -- only continue for cards\n if objType ~= \"Card\" and objType ~= \"CardCustom\" then\n if objType == \"Deck\" then\n table.insert(missingData, obj)\n end\n return\n end\n\n -- check if we should spawn clues here and do so according to playercount\n local card = collisionInfo.collision_object\n if shouldSpawnTokens(card) then\n tokenManager.spawnForCard(card)\n end\n \n -- If this card was being dragged, clear the dragging connections. A multi-drag/drop may send\n -- the dropped card immediately into a deck, so this has to be done here\n if draggingGuids[card.getGUID()] ~= nil then\n card.setVectorLines(nil)\n draggingGuids[card.getGUID()] = nil\n end\n \n maybeTrackLocation(card)\nend\n\nfunction shouldSpawnTokens(card)\n local metadata = JSON.decode(card.getGMNotes())\n if metadata == nil then\n return tokenManager.hasLocationData(card)\n end\n return metadata.type == \"Location\"\n or metadata.type == \"Enemy\"\n or metadata.type == \"Treachery\"\n or metadata.weakness\n -- hardcoded IDs for \"Makeshift Trap\" and \"Shrine of the Moirai\"\n -- these cards are events with uses, that attach to encounter cards and thus will enter play in the playarea\n -- TODO: probably turn this into a metadata field if we get more cards like that\n or metadata.id == \"07310\"\n or metadata.id == \"09100\"\nend\n\nfunction onCollisionExit(collisionInfo)\n maybeUntrackLocation(collisionInfo.collision_object)\nend\n\n-- Destroyed objects don't trigger onCollisionExit(), so check on destruction to untrack as well\nfunction onObjectDestroy(object)\n maybeUntrackLocation(object)\nend\n\nfunction onObjectPickUp(player, object)\n -- only continue for cards\n local objType = object.name\n if objType ~= \"Card\" and objType ~= \"CardCustom\" then return end\n\n -- onCollisionExit USUALLY fires first, so we have to check the card to see if it's a location we\n -- should be tracking\n if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= \"\" then\n local pickedUpGuid = object.getGUID()\n local metadata = JSON.decode(object.getGMNotes()) or {}\n if metadata.type == \"Location\" then\n -- onCollisionExit sometimes comes 1 frame after onObjectPickUp (rather than before it or in\n -- the same frame). This causes a mismatch in the data between dragging the on-table, and\n -- that one frame draws connectors on the card which then show up as shadows for snap points.\n -- Waiting ensures we always do thing in the expected Exit-\u003ePickUp order\n Wait.frames(function()\n if object.is_face_down then\n draggingGuids[pickedUpGuid] = metadata.locationBack\n else\n draggingGuids[pickedUpGuid] = metadata.locationFront\n end\n rebuildConnectionList()\n end, 2)\n end\n end\nend\n\nfunction onUpdate()\n -- Due to the frequence of onUpdate calls, ensure that we only process any changes to the\n -- connection list once, and only redraw once\n local needsConnectionRebuild = false\n local needsConnectionDraw = false\n for guid, _ in pairs(draggingGuids) do\n local obj = getObjectFromGUID(guid)\n if obj == nil or not isInPlayArea(obj) then\n draggingGuids[guid] = nil\n needsConnectionRebuild = true\n -- If object still exists then it's been dragged outside the area and needs to clear the\n -- lines attached to it\n if obj ~= nil then\n obj.setVectorLines(nil)\n end\n end\n -- Even if the last location left the play area, need one last draw to clear the lines\n needsConnectionDraw = true\n end\n if needsConnectionRebuild then\n rebuildConnectionList()\n end\n if needsConnectionDraw then\n drawDraggingConnections()\n end\nend\n\n-- Checks the given card and adds it to the list of locations tracked for connection purposes.\n-- A card will be added to the tracking if it is a location in the play area (based on centerpoint).\n---@param card Object A card object, possibly a location.\nfunction maybeTrackLocation(card)\n -- Collision checks for any part of the card overlap, but our other tracking is centerpoint\n -- Ignore any collision where the centerpoint isn't in the area\n if isInPlayArea(card) then\n local metadata = JSON.decode(card.getGMNotes())\n if metadata == nil then\n table.insert(missingData, card)\n else\n if metadata.type == \"Location\" then\n if card.is_face_down then\n locations[card.getGUID()] = metadata.locationBack\n else\n locations[card.getGUID()] = metadata.locationFront\n end\n\n -- only draw connection lines for not-excluded scenarios\n if showLocationLinks() then\n rebuildConnectionList()\n drawBaseConnections()\n end\n end\n end\n end\nend\n\n-- Stop tracking a location for connection drawing. This should be called for both collision exit\n-- and destruction, as a destroyed object does not trigger collision exit. An object can also be\n-- deleted mid-drag, but the ordering for drag events means we can't clear those here and those will\n-- be cleared in the next onUpdate() cycle.\n---@param card Object Card to (maybe) stop tracking\nfunction maybeUntrackLocation(card)\n -- Locked objects no longer collide (hence triggering an exit event) but are still in the play\n -- area. If the object is now locked, don't remove it.\n if locations[card.getGUID()] ~= nil and not card.locked then\n locations[card.getGUID()] = nil\n rebuildConnectionList()\n drawBaseConnections()\n end\nend\n\n-- Global event handler, delegated from Global. Clears any connection lines from dragged cards\n-- before they are destroyed by entering a deck. Removal of the card from the dragging list will\n-- be handled during the next onUpdate() call.\nfunction tryObjectEnterContainer(params)\n for draggedGuid, _ in pairs(draggingGuids) do\n local draggedObj = getObjectFromGUID(draggedGuid)\n if draggedObj ~= nil then\n draggedObj.setVectorLines(nil)\n end\n end\nend\n\n-- Builds a list of GUID to GUID connection information based on the currently tracked locations.\n-- This will update the connection information and store it in the locationConnections data member,\n-- but does not draw those connections. This should often be followed by a call to\n-- drawBaseConnections()\nfunction rebuildConnectionList()\n if not showLocationLinks() then\n locationConnections = {}\n return\n end\n\n local iconCardList = {}\n\n -- Build a list of cards with each icon as their location ID\n for cardId, metadata in pairs(draggingGuids) do\n buildLocListByIcon(cardId, iconCardList, metadata)\n end\n for cardId, metadata in pairs(locations) do\n buildLocListByIcon(cardId, iconCardList, metadata)\n end\n\n -- Pair up all the icons\n locationConnections = {}\n for cardId, metadata in pairs(draggingGuids) do\n buildConnection(cardId, iconCardList, metadata)\n end\n for cardId, metadata in pairs(locations) do\n if draggingGuids[cardId] == nil then\n buildConnection(cardId, iconCardList, metadata)\n end\n end\nend\n\n-- Extracts the card's icon string into a list of individual location icons\n---@param cardId String GUID of the card to pull the icon data from\n---@param iconCardList Table A table of icon-\u003eGUID list. Mutable, will be updated by this method\n---@param locData Table A table containing the metadata for the card (for the correct side)\nfunction buildLocListByIcon(cardId, iconCardList, locData)\n if locData ~= nil and locData.icons ~= nil then\n for icon in string.gmatch(locData.icons, \"%a+\") do\n if iconCardList[icon] == nil then\n iconCardList[icon] = {}\n end\n table.insert(iconCardList[icon], cardId)\n end\n end\nend\n\n-- Builds the connections for the given cardID by finding matching icons and adding them to the\n-- Playarea's locationConnections table.\n---@param cardId String GUID of the card to build the connections for\n---@param iconCardList Table A table of icon-\u003eGUID List. Used to find matching icons for connections.\n---@param locData Table A table containing the metadata for the card (for the correct side)\nfunction buildConnection(cardId, iconCardList, locData)\n if locData ~= nil and locData.connections ~= nil then\n locationConnections[cardId] = {}\n for icon in string.gmatch(locData.connections, \"%a+\") do\n if iconCardList[icon] ~= nil then\n for _, connectedGuid in ipairs(iconCardList[icon]) do\n -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way\n if locationConnections[connectedGuid] ~= nil\n and (locationConnections[connectedGuid][cardId] == ONE_WAY\n or locationConnections[connectedGuid][cardId] == BIDIRECTIONAL) then\n locationConnections[connectedGuid][cardId] = BIDIRECTIONAL\n locationConnections[cardId][connectedGuid] = nil\n else\n if locationConnections[connectedGuid] == nil then\n locationConnections[connectedGuid] = {}\n end\n locationConnections[cardId][connectedGuid] = ONE_WAY\n locationConnections[connectedGuid][cardId] = INCOMING_ONE_WAY\n end\n end\n end\n end\n end\nend\n\n-- Draws the lines for connections currently in locationConnections but not in draggingGuids.\n-- Constructed vectors will be set to the playmat\nfunction drawBaseConnections()\n if not showLocationLinks() then\n locationConnections = {}\n self.setVectorLines({})\n return\n end\n local cardConnectionLines = {}\n\n for originGuid, targetGuids in pairs(locationConnections) do\n -- Objects should reliably exist at this point, but since this can be called during onUpdate the\n -- object checks are conservative just to make sure.\n local origin = getObjectFromGUID(originGuid)\n if draggingGuids[originGuid] == nil and origin ~= nil then\n for targetGuid, direction in pairs(targetGuids) do\n local target = getObjectFromGUID(targetGuid)\n if draggingGuids[targetGuid] == nil and target ~= nil then\n -- Since we process the full list, we're guaranteed to hit any ONE_WAY connections later\n -- so we can ignore INCOMING_ONE_WAY\n if direction == BIDIRECTIONAL then\n addBidirectionalVector(origin, target, self, cardConnectionLines)\n elseif direction == ONE_WAY then\n addOneWayVector(origin, target, self, cardConnectionLines)\n end\n end\n end\n end\n end\n self.setVectorLines(cardConnectionLines)\nend\n\n-- Draws the lines for cards which are currently being dragged.\nfunction drawDraggingConnections()\n if not showLocationLinks() then\n return\n end\n local cardConnectionLines = {}\n local ownedVectors = {}\n\n for originGuid, _ in pairs(draggingGuids) do\n targetGuids = locationConnections[originGuid]\n -- Objects should reliably exist at this point, but since this can be called during onUpdate the\n -- object checks are conservative just to make sure.\n local origin = getObjectFromGUID(originGuid)\n if draggingGuids[originGuid] and origin ~= nil and targetGuids ~= nil then\n ownedVectors[originGuid] = {}\n for targetGuid, direction in pairs(targetGuids) do\n local target = getObjectFromGUID(targetGuid)\n if target ~= nil then\n if direction == BIDIRECTIONAL then\n addBidirectionalVector(origin, target, origin, ownedVectors[originGuid])\n elseif direction == ONE_WAY then\n addOneWayVector(origin, target, origin, ownedVectors[originGuid])\n elseif direction == INCOMING_ONE_WAY and not draggingGuids[targetGuid] then\n addOneWayVector(target, origin, origin, ownedVectors[originGuid])\n end\n end\n end\n end\n end\n for ownerGuid, vectors in pairs(ownedVectors) do\n local card = getObjectFromGUID(ownerGuid)\n card.setVectorLines(vectors)\n end\nend\n\n-- Draws a bidirectional location connection between the two cards, adding the lines to do so to the\n-- given lines list.\n---@param card1 Object One of the card objects to connect\n---@param card2 Object The other card object to connect\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this connector\nfunction addBidirectionalVector(card1, card2, vectorOwner, lines)\n local cardPos1 = card1.getPosition()\n local cardPos2 = card2.getPosition()\n cardPos1.y = CONNECTION_LINE_Y\n cardPos2.y = CONNECTION_LINE_Y\n\n local pos1 = vectorOwner.positionToLocal(cardPos1)\n local pos2 = vectorOwner.positionToLocal(cardPos2)\n\n table.insert(lines, {\n points = { pos1, pos2 },\n color = vectorOwner == self and connectionColor or DRAGGING_CONNECTION_COLOR,\n thickness = vectorOwner == self and CONNECTION_THICKNESS or DRAGGING_CONNECTION_THICKNESS,\n })\nend\n\n-- Draws a one-way location connection between the two cards, adding the lines to do so to the\n-- given lines list. Arrows will point towards the target card.\n---@param origin Object Origin card in the connection\n---@param target Object Target card object to connect\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this connector\nfunction addOneWayVector(origin, target, vectorOwner, lines)\n -- Start with the BiDi then add the arrow lines to it\n addBidirectionalVector(origin, target, vectorOwner, lines)\n local originPos = origin.getPosition()\n local targetPos = target.getPosition()\n originPos.y = CONNECTION_LINE_Y\n targetPos.y = CONNECTION_LINE_Y\n\n -- Calculate card distance to be closer for horizontal positions than vertical, since cards are\n -- taller than they are wide\n local heading = Vector(originPos):sub(targetPos):heading(\"y\")\n local distanceFromCard = DIRECTIONAL_ARROW_DISTANCE * 0.7 +\n DIRECTIONAL_ARROW_DISTANCE * 0.3 * math.abs(math.sin(math.rad(heading)))\n\n -- Calculate the three possible arrow positions. These are offset by half the arrow length to\n -- make them visually balanced by keeping the arrows centered, not tracking the point\n local midpoint = Vector(originPos):add(targetPos):scale(Vector(0.5, 0.5, 0.5)):moveTowards(targetPos,\n ARROW_ARM_LENGTH / 2)\n local closeToOrigin = Vector(originPos):moveTowards(targetPos, distanceFromCard + ARROW_ARM_LENGTH / 2)\n local closeToTarget = Vector(targetPos):moveTowards(originPos, distanceFromCard - ARROW_ARM_LENGTH / 2)\n\n if (originPos:distance(closeToOrigin) \u003e originPos:distance(closeToTarget)) then\n addArrowLines(midpoint, originPos, vectorOwner, lines)\n else\n addArrowLines(closeToOrigin, originPos, vectorOwner, lines)\n addArrowLines(closeToTarget, originPos, vectorOwner, lines)\n end\nend\n\n-- Draws an arrowhead at the given position.\n---@param arrowheadPos Table Centerpoint of the arrowhead to draw (NOT the tip of the arrow)\n---@param originPos Table Origin point of the connection, used to position the arrow arms\n---@param vectorOwner Object The object which these lines will be set to. Used for relative\n--- positioning and scaling, as well as highlighting connections during a drag operation\n---@param lines Table List of vector line elements. Mutable, will be updated to add this arrow\nfunction addArrowLines(arrowheadPos, originPos, vectorOwner, lines)\n local arrowArm1 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver(\"y\",\n -1 * ARROW_ANGLE):add(arrowheadPos)\n local arrowArm2 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver(\"y\",\n ARROW_ANGLE):add(arrowheadPos)\n\n local head = vectorOwner.positionToLocal(arrowheadPos)\n local arm1 = vectorOwner.positionToLocal(arrowArm1)\n local arm2 = vectorOwner.positionToLocal(arrowArm2)\n table.insert(lines, {\n points = { arm1, head, arm2 },\n color = vectorOwner == self and connectionColor or DRAGGING_CONNECTION_COLOR,\n thickness = vectorOwner == self and CONNECTION_THICKNESS or DRAGGING_CONNECTION_THICKNESS,\n })\nend\n\n-- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n-- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n---@param playerColor String Color of the player requesting the shift. Used solely to send an error\n--- message in the unlikely case that the scripting zone has been deleted\nfunction shiftContentsUp(playerColor)\n shiftContents(playerColor, \"up\")\nend\n\nfunction shiftContentsDown(playerColor)\n shiftContents(playerColor, \"down\")\nend\n\nfunction shiftContentsLeft(playerColor)\n shiftContents(playerColor, \"left\")\nend\n\nfunction shiftContentsRight(playerColor)\n shiftContents(playerColor, \"right\")\nend\n\nfunction shiftContents(playerColor, direction)\n local zone = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n if not zone then\n broadcastToColor(\"Scripting zone couldn't be found.\", playerColor, \"Red\")\n return\n end\n\n for _, object in ipairs(zone.getObjects()) do\n if not (SHIFT_EXCLUSION[object.getGUID()] or object.hasTag(\"displacement_excluded\")) then\n object.translate(SHIFT_OFFSETS[direction])\n end\n end\n Wait.time(drawBaseConnections, 0.1)\nend\n\n-- Check to see if the given object is within the bounds of the play area, based solely on the X and\n-- Z coordinates, ignoring height\n---@param object Object Object to check\n---@return. True if the object is inside the play area\nfunction isInPlayArea(object)\n local bounds = self.getBounds()\n local position = object.getPosition()\n -- Corners are arbitrary since it's all global - c1 goes down both axes, c2 goes up\n local c1 = { x = bounds.center.x - bounds.size.x / 2, z = bounds.center.z - bounds.size.z / 2 }\n local c2 = { x = bounds.center.x + bounds.size.x / 2, z = bounds.center.z + bounds.size.z / 2 }\n\n return position.x \u003e c1.x and position.x \u003c c2.x and position.z \u003e c1.z and position.z \u003c c2.z\nend\n\n-- Reset the play area's tracking of which cards have had tokens spawned.\nfunction resetSpawnedCards()\n spawnedLocationGUIDs = {}\nend\n\nfunction onScenarioChanged(scenarioName)\n currentScenario = scenarioName\n if not showLocationLinks() then\n broadcastToAll(\"Automatic location connections not available for this scenario\")\n end\nend\n\nfunction showLocationLinks()\n return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario] and connectionsEnabled\nend\n\n-- Sets this playmat's snap points to limit snapping to locations or not.\n-- If matchTypes is false, snap points will be reset to snap all cards.\n---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Location\" }\n else\n table.insert(snaps[i].tags, \"Location\")\n end\n else\n snaps[i].tags = nil\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- called by the option panel to enabled / disable location connections\nfunction setConnectionDrawState(state)\n connectionsEnabled = state\n rebuildConnectionList()\n drawBaseConnections()\nend\n\n-- called by the option panel to edit the location connection color\nfunction setConnectionColor(color)\n connectionColor = color\n rebuildConnectionList()\n drawBaseConnections()\nend\n\n-- count victory points on locations in play area\n---@param highlightOff Boolean True if highlighting should be enabled\n---@return. Returns the total amount of VP found in the play area\nfunction countVP(highlightOff)\n local totalVP = 0\n\n for cardId, metadata in pairs(locations) do\n local card = getObjectFromGUID(cardId)\n if metadata ~= nil and card ~= nil then\n if highlightOff == true then\n card.highlightOff(\"Green\")\n end\n\n local cardVP = tonumber(metadata.victory) or 0\n if cardVP ~= 0 and not cardHasClues(card) then\n totalVP = totalVP + cardVP\n if highlightOff == false then\n card.highlightOn(\"Green\")\n end\n end\n end\n end\n\n return totalVP\nend\n\n-- checks if a card has clues on it, returns true if clues are on it\n---@param card TTSObject Card to check for clues\nfunction cardHasClues(card)\n local searchResult = searchLib.onObject(card, \"isClue\")\n return #searchResult \u003e 0\nend\n\n-- highlights all locations in the play area without metadata\n---@param state Boolean True if highlighting should be enabled\nfunction highlightMissingData(state)\n for i, obj in pairs(missingData) do\n if obj ~= nil then\n if state then\n obj.highlightOff(\"Red\")\n else\n obj.highlightOn(\"Red\")\n end\n else\n missingData[i] = nil\n end\n end\nend\n\n-- rebuilds local snap points (could be useful in the future again)\nfunction buildSnaps()\n local upperleft = { x = 1.53, z = -1.09 }\n local lowerright = { x = -1.53, z = 1.55 }\n local snaps = {}\n\n -- creates 81 snap points, for uneven rows + columns it makes a rotation snap point\n for i = 1, 9 do\n for j = 1, 9 do\n local snap = {}\n snap.position = {}\n snap.position.x = round(upperleft.x - (upperleft.x - lowerright.x) * (i - 1) / 8, 3)\n snap.position.y = 0.1\n snap.position.z = round(upperleft.z - (upperleft.z - lowerright.z) * (j - 1) / 8, 3)\n\n -- enable rotation snaps for uneven rows / columns\n if (i % 2 ~= 0) and (j % 2 ~= 0) then\n snap.rotation = { 0, 0, 0 }\n snap.rotation_snap = true\n end\n\n table.insert(snaps, snap)\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- utility function\nfunction round(num, numDecimalPlaces)\n local mult = 10 ^ (numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "{\"connectionColor\":{\"a\":1,\"b\":0.4,\"g\":0.4,\"r\":0.4},\"connectionsEnabled\":true,\"trackedLocations\":[]}", "MeasureMovement": false, "Name": "Custom_Token", "Nickname": "Play Area", @@ -20175,6 +20187,60 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 0, + "g": 0.36652, + "r": 0.70588 + }, + "Description": "Put any cards in here to add them to the indices for the player card panel and deck importer.\n\nSelect the 'update index' entry in the context menu of this bag once you've added all cards.\n\nThis can be used for custom cards too.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "2cba6b", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/HotfixBag\")\nend)\n__bundle_register(\"arkhamdb/HotfixBag\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- A Hotfix bag contains replacement cards for the All Cards Bag, and should\n-- have the 'AllCardsHotfix' tag on the object. Code for the All Cards Bag will\n-- find these bags during indexing, and use them to replace cards from the\n-- actual bag.\n\n-- Tells the All Cards Bag to recreate its indexes. The All Cards Bag may\n-- ignore this request; see the rebuildIndexForHotfix() method in the All Cards\n-- Bag for details.\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\nfunction onLoad()\n allCardsBagApi.rebuildIndexForHotfix()\n self.addContextMenuItem(\"Update card index\", function() allCardsBagApi.rebuildIndexForHotfix() end)\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Bag", + "Nickname": "Additional Player Cards", + "Number": 0, + "Snap": true, + "Sticky": true, + "Tags": [ + "AllCardsHotfix" + ], + "Tooltip": true, + "Transform": { + "posX": 60, + "posY": 1.204, + "posZ": 48, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1.5, + "scaleY": 1.5, + "scaleZ": 1.5 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -20380,1298 +20446,6 @@ "Value": 0, "XmlUI": "" }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.04894, - "g": 0.32859, - "r": 0.37456 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b2b7be", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Bless", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -1.465, - "posY": 1.703, - "posZ": -26.93, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778623873/C9EF4B44CE708DFC5A804FF2912C9F9B47323287/", - "MaterialIndex": 3, - "MeshURL": "https://pastebin.com/raw/ALrYhQGb", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "afa06b", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": true, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "Bless tokens", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore", - "displacement_excluded" - ], - "Tooltip": true, - "Transform": { - "posX": 2.842, - "posY": 1.644, - "posZ": -11.239, - "rotX": 0, - "rotY": 225, - "rotZ": 0, - "scaleX": 0.7, - "scaleY": 0.7, - "scaleZ": 0.7 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 0.44425, - "g": 0.00387, - "r": 0.27072 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 2 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", - "WidthScale": 0 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "678891", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "Curse", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -46.206, - "posY": 1.789, - "posZ": -3.483, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 0.81, - "scaleY": 1, - "scaleZ": 0.81 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778633181/7A00AF905BCD6EB5D866F2107CECBC0A49E360F7/", - "MaterialIndex": 3, - "MeshURL": "https://pastebin.com/raw/ALrYhQGb", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "bd0253", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": true, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "Curse tokens", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore", - "displacement_excluded" - ], - "Tooltip": true, - "Transform": { - "posX": 4.053, - "posY": 1.642, - "posZ": -12.449, - "rotX": 0, - "rotY": 225, - "rotZ": 0, - "scaleX": 0.7, - "scaleY": 0.7, - "scaleZ": 0.7 - }, - "Value": 0, - "XmlUI": "" - }, { "AltLookAngle": { "x": 0, @@ -21695,7 +20469,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/TokenSpawnTool\")\nend)\n__bundle_register(\"util/TokenSpawnTool\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal tokenManager = require(\"core/token/TokenManager\")\nlocal TOKEN_INDEX = {}\nTOKEN_INDEX[3] = \"resourceCounter\"\nTOKEN_INDEX[4] = \"damage\"\nTOKEN_INDEX[5] = \"path\"\nTOKEN_INDEX[6] = \"horror\"\nTOKEN_INDEX[7] = \"doom\"\nTOKEN_INDEX[8] = \"clue\"\nTOKEN_INDEX[9] = \"resource\"\n\nlocal stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n}\n\n---@param index number Index of the pressed key\n---@param playerColor string Color of the triggering player\nfunction onScriptingButtonDown(index, playerColor)\n local tokenType = TOKEN_INDEX[index]\n if not tokenType then return end\n\n local rotation = { x = 0, y = Player[playerColor].getPointerRotation(), z = 0 }\n local position = Player[playerColor].getPointerPosition() + Vector(0, 0.2, 0)\n local subType = \"\"\n local callback = nil\n\n -- check for subtype of resource based on card below\n if tokenType == \"resource\" then\n local search = Physics.cast({\n direction = { 0, -1, 0 },\n max_distance = 2,\n type = 3,\n size = { 0.1, 0.1, 0.1 },\n origin = position:setAt(\"y\", 2)\n })\n\n for _, v in ipairs(search) do\n if v.hit_object.tag == \"Card\" and not v.hit_object.is_face_down then\n local metadata = JSON.decode(v.hit_object.getGMNotes()) or {}\n local uses = metadata.uses or {}\n\n for _, useInfo in ipairs(uses) do\n if useInfo.token == \"resource\" then\n subType = useInfo.type\n break\n end\n end\n break\n end\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local stateID = stateTable[string.lower(subType)]\n if stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n -- check hovered object for \"resourceCounter\" tokens and increase them instead\n elseif tokenType == \"resourceCounter\" then\n local hoverObj = Player[playerColor].getHoverObject()\n if hoverObj then\n if tokenType == hoverObj.getMemo() then\n hoverObj.call(\"addOrSubtract\")\n return\n end\n end\n -- check hovered object for \"damage\" and \"horror\" tokens and increase them instead\n elseif tokenType == \"damage\" or tokenType == \"horror\" then\n local hoverObj = Player[playerColor].getHoverObject()\n if hoverObj then\n if tokenType == hoverObj.getMemo() then\n local stateInfo = hoverObj.getStates()\n local stateId = hoverObj.getStateId()\n if stateId \u003c= #stateInfo then\n hoverObj.setState(stateId + 1)\n return\n end\n end\n end\n end\n\n tokenManager.spawnToken(position, tokenType, rotation, callback)\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"util/TokenSpawnTool\")\nend)\n__bundle_register(\"util/TokenSpawnTool\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenManager = require(\"core/token/TokenManager\")\nlocal TOKEN_INDEX = {}\nTOKEN_INDEX[3] = \"resourceCounter\"\nTOKEN_INDEX[4] = \"damage\"\nTOKEN_INDEX[5] = \"path\"\nTOKEN_INDEX[6] = \"horror\"\nTOKEN_INDEX[7] = \"doom\"\nTOKEN_INDEX[8] = \"clue\"\nTOKEN_INDEX[9] = \"resource\"\n\nlocal stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n}\n\n---@param index number Index of the pressed key\n---@param playerColor string Color of the triggering player\nfunction onScriptingButtonDown(index, playerColor)\n local tokenType = TOKEN_INDEX[index]\n if not tokenType then return end\n\n local rotation = { x = 0, y = Player[playerColor].getPointerRotation(), z = 0 }\n local position = Player[playerColor].getPointerPosition() + Vector(0, 0.2, 0)\n local subType = \"\"\n local callback = nil\n\n -- check for subtype of resource based on card below\n if tokenType == \"resource\" then\n for _, obj in ipairs(searchLib.belowPosition(position, \"isCard\")) do\n if not obj.is_face_down then\n local metadata = JSON.decode(obj.getGMNotes()) or {}\n local uses = metadata.uses or {}\n for _, useInfo in ipairs(uses) do\n if useInfo.token == \"resource\" then\n subType = useInfo.type\n break\n end\n end\n break\n end\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local stateID = stateTable[string.lower(subType)]\n if stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n -- check hovered object for \"resourceCounter\" tokens and increase them instead\n elseif tokenType == \"resourceCounter\" then\n local hoverObj = Player[playerColor].getHoverObject()\n if hoverObj then\n if tokenType == hoverObj.getMemo() then\n hoverObj.call(\"addOrSubtract\")\n return\n end\n end\n -- check hovered object for \"damage\" and \"horror\" tokens and increase them instead\n elseif tokenType == \"damage\" or tokenType == \"horror\" then\n local hoverObj = Player[playerColor].getHoverObject()\n if hoverObj then\n if tokenType == hoverObj.getMemo() then\n local stateInfo = hoverObj.getStates()\n local stateId = hoverObj.getStateId()\n if stateId \u003c= #stateInfo then\n hoverObj.setState(stateId + 1)\n return\n end\n end\n end\n end\n\n tokenManager.spawnToken(position, tokenType, rotation, callback)\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Checker_white", @@ -22415,7 +21189,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -22641,8 +21415,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Utility memory bag by Directsun\r\n-- Version 2.5.2\r\n-- Fork of Memory Bag 2.0 by MrStump\r\n\r\nfunction updateSave()\r\n local data_to_save = {[\"ml\"]=memoryList}\r\n saved_data = JSON.encode(data_to_save)\r\n self.script_state = saved_data\r\nend\r\n\r\nfunction combineMemoryFromBagsWithin()\r\n local bagObjList = self.getObjects()\r\n for _, bagObj in ipairs(bagObjList) do\r\n local data = bagObj.lua_script_state\r\n if data ~= nil then\r\n local j = JSON.decode(data)\r\n if j ~= nil and j.ml ~= nil then\r\n for guid, entry in pairs(j.ml) do\r\n memoryList[guid] = entry\r\n end\r\n end\r\n end\r\n end\r\nend\r\n\r\nfunction updateMemoryWithMoves()\r\n memoryList = memoryListBackup\r\n --get the first transposed object's coordinates\r\n local obj = getObjectFromGUID(moveGuid)\r\n\r\n -- p1 is where needs to go, p2 is where it was\r\n local refObjPos = memoryList[moveGuid].pos\r\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\r\n local movedRotation = obj.getRotation()\r\n for guid, entry in pairs(memoryList) do\r\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\r\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\r\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\r\n -- memoryList[guid].rot.x = movedRotation.x\r\n -- memoryList[guid].rot.y = movedRotation.y\r\n -- memoryList[guid].rot.z = movedRotation.z\r\n end\r\n\r\n --theList[obj.getGUID()] = {\r\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n -- lock=obj.getLock()\r\n --}\r\n moveList = {}\r\nend\r\n\r\nfunction onload(saved_data)\r\n fresh = true\r\n if saved_data ~= \"\" then\r\n local loaded_data = JSON.decode(saved_data)\r\n --Set up information off of loaded_data\r\n memoryList = loaded_data.ml\r\n else\r\n --Set up information for if there is no saved saved data\r\n memoryList = {}\r\n end\r\n\r\n moveList = {}\r\n moveGuid = nil\r\n\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n fresh = false\r\n createMemoryActionButtons()\r\n end\r\nend\r\n\r\n\r\n--Beginning Setup\r\n\r\n\r\n--Make setup button\r\nfunction createSetupButton()\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n--Triggered by Transpose button\r\nfunction buttonClick_transpose()\r\n moveGuid = nil\r\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n moveList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(true)\r\n createSetupActionButtons(true)\r\nend\r\n\r\n--Triggered by setup button,\r\nfunction buttonClick_setup()\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(false)\r\n createSetupActionButtons(false)\r\nend\r\n\r\nfunction getAllObjectsInMemory()\r\n local objTable = {}\r\n local curObj = {}\r\n\r\n for guid in pairs(memoryListBackup) do\r\n curObj = getObjectFromGUID(guid)\r\n table.insert(objTable, curObj)\r\n end\r\n\r\n return objTable\r\n -- return getAllObjects()\r\nend\r\n\r\n--Creates selection buttons on objects\r\nfunction createButtonsOnAllObjects(move)\r\n local howManyButtons = 0\r\n\r\n local objsToHaveButtons = {}\r\n if move == true then\r\n objsToHaveButtons = getAllObjectsInMemory()\r\n else\r\n objsToHaveButtons = getAllObjects()\r\n end\r\n\r\n for _, obj in ipairs(objsToHaveButtons) do\r\n if obj ~= self then\r\n local dummyIndex = howManyButtons\r\n --On a normal bag, the button positions aren't the same size as the bag.\r\n globalScaleFactor = 1 * 1/self.getScale().x\r\n --Super sweet math to set button positions\r\n local selfPos = self.getPosition()\r\n local objPos = obj.getPosition()\r\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\r\n local objPos = rotateLocalCoordinates(deltaPos, self)\r\n objPos.x = -objPos.x * globalScaleFactor\r\n objPos.y = objPos.y * globalScaleFactor + 4\r\n objPos.z = objPos.z * globalScaleFactor\r\n --Offset rotation of bag\r\n local rot = self.getRotation()\r\n rot.y = -rot.y + 180\r\n --Create function\r\n local funcName = \"selectButton_\" .. howManyButtons\r\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\r\n local color = {0.75,0.25,0.25,0.6}\r\n local colorMove = {0,0,1,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n click_function=funcName, function_owner=self,\r\n position=objPos, rotation=rot, height=1000, width=1000,\r\n color=color,\r\n })\r\n howManyButtons = howManyButtons + 1\r\n end\r\n end\r\nend\r\n\r\n--Creates submit and cancel buttons\r\nfunction createSetupActionButtons(move)\r\n self.createButton({\r\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\r\n position={-1.25,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n self.createButton({\r\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\r\n position={-1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n if move == false then\r\n self.createButton({\r\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\r\n position={1.25,0.3,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={0.25,1,0.25}\r\n })\r\n\r\n if fresh == false then\r\n self.createButton({\r\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\r\n position={1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={0.75,0.75,1}\r\n })\r\n self.createButton({\r\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\r\n position={1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,0.25,0.25}\r\n })\r\n end\r\n end\r\n\r\n self.createButton({\r\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\r\n position={-1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n\r\n--During Setup\r\n\r\n\r\n--Checks or unchecks buttons\r\nfunction buttonClick_selection(index, obj, move)\r\n local colorMove = {0,0,1,0.6}\r\n local color = {0,1,0,0.6}\r\n\r\n previousGuid = selectedGuid\r\n selectedGuid = obj.getGUID()\r\n\r\n theList = memoryList\r\n if move == true then\r\n theList = moveList\r\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\r\n local prevObj = getObjectFromGUID(previousGuid)\r\n prevObj.highlightOff()\r\n self.editButton({index=previousIndex, color=colorMove})\r\n theList[previousGuid] = nil\r\n end\r\n previousIndex = index\r\n end\r\n\r\n if theList[selectedGuid] == nil then\r\n self.editButton({index=index, color=color})\r\n --Adding pos/rot to memory table\r\n local pos, rot = obj.getPosition(), obj.getRotation()\r\n --I need to add it like this or it won't save due to indexing issue\r\n theList[obj.getGUID()] = {\r\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n lock=obj.getLock()\r\n }\r\n obj.highlightOn({0,1,0})\r\n else\r\n color = {0.75,0.25,0.25,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.editButton({index=index, color=color})\r\n theList[obj.getGUID()] = nil\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Cancels selection process\r\nfunction buttonClick_cancel()\r\n memoryList = memoryListBackup\r\n moveList = {}\r\n self.clearButtons()\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n createMemoryActionButtons()\r\n end\r\n removeAllHighlights()\r\n broadcastToAll(\"Selection Canceled\", {1,1,1})\r\n moveGuid = nil\r\nend\r\n\r\n--Saves selections\r\nfunction buttonClick_submit()\r\n fresh = false\r\n if next(moveList) ~= nil then\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n end\r\n if memoryListBackup[moveGuid] == nil then\r\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\r\n else\r\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n updateMemoryWithMoves()\r\n updateSave()\r\n buttonClick_place()\r\n end\r\n elseif next(memoryList) == nil and moveGuid == nil then\r\n memoryList = memoryListBackup\r\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\r\n end\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\n moveGuid = nil\r\nend\r\n\r\nfunction combineTables(first_table, second_table)\r\n for k,v in pairs(second_table) do first_table[k] = v end\r\nend\r\n\r\nfunction buttonClick_add()\r\n fresh = false\r\n combineTables(memoryList, memoryListBackup)\r\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_remove()\r\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n memoryListBackup[guid] = nil\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_setNew()\r\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for _, obj in ipairs(getAllObjects()) do\r\n guid = obj.guid\r\n if memoryListBackup[guid] ~= nil then\r\n count = count + 1\r\n memoryListBackup[guid].pos = obj.getPosition()\r\n memoryListBackup[guid].rot = obj.getRotation()\r\n memoryListBackup[guid].lock = obj.getLock()\r\n end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\n--Resets bag to starting status\r\nfunction buttonClick_reset()\r\n fresh = true\r\n memoryList = {}\r\n self.clearButtons()\r\n createSetupButton()\r\n removeAllHighlights()\r\n broadcastToAll(\"Tool Reset\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\n\r\n--After Setup\r\n\r\n\r\n--Creates recall and place buttons\r\nfunction createMemoryActionButtons()\r\n self.createButton({\r\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\r\n position={1.35,1,6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\r\n position={-1.25,1,6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n--- self.createButton({\r\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\r\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\r\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\r\n--- })\r\nend\r\n\r\n--Sends objects from bag/table to their saved position/rotation\r\nfunction buttonClick_place()\r\n local bagObjList = self.getObjects()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n --If obj is out on the table, move it to the saved pos/rot\r\n if obj ~= nil then\r\n obj.setPositionSmooth(entry.pos)\r\n obj.setRotationSmooth(entry.rot)\r\n obj.setLock(entry.lock)\r\n else\r\n --If obj is inside of the bag\r\n for _, bagObj in ipairs(bagObjList) do\r\n if bagObj.guid == guid then\r\n local item = self.takeObject({\r\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\r\n })\r\n item.setLock(entry.lock)\r\n break\r\n end\r\n end\r\n end\r\n end\r\n broadcastToAll(\"Objects Placed\", {1,1,1})\r\nend\r\n\r\n--Recalls objects to bag from table\r\nfunction buttonClick_recall()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then self.putObject(obj) end\r\n end\r\n broadcastToAll(\"Objects Recalled\", {1,1,1})\r\nend\r\n\r\n\r\n--Utility functions\r\n\r\n\r\n--Find delta (difference) between 2 x/y/z coordinates\r\nfunction findOffsetDistance(p1, p2, obj)\r\n local yOffset = 0\r\n if obj ~= nil then\r\n local bounds = obj.getBounds()\r\n yOffset = (bounds.size.y - bounds.offset.y)\r\n end\r\n local deltaPos = {}\r\n deltaPos.x = (p2.x-p1.x)\r\n deltaPos.y = (p2.y-p1.y) + yOffset\r\n deltaPos.z = (p2.z-p1.z)\r\n return deltaPos\r\nend\r\n\r\n--Used to rotate a set of coordinates by an angle\r\nfunction rotateLocalCoordinates(desiredPos, obj)\r\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\r\n local angle = math.rad(objRot.y)\r\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\r\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\r\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\nfunction rotateMyCoordinates(desiredPos, obj)\r\n\tlocal angle = math.rad(obj.getRotation().y)\r\n local x = desiredPos.x * math.sin(angle)\r\n\tlocal z = desiredPos.z * math.cos(angle)\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\n--Coroutine delay, in seconds\r\nfunction wait(time)\r\n local start = os.time()\r\n repeat coroutine.yield(0) until os.time() \u003e start + time\r\nend\r\n\r\n--Duplicates a table (needed to prevent it making reference to the same objects)\r\nfunction duplicateTable(oldTable)\r\n local newTable = {}\r\n for k, v in pairs(oldTable) do\r\n newTable[k] = v\r\n end\r\n return newTable\r\nend\r\n\r\n--Moves scripted highlight from all objects\r\nfunction removeAllHighlights()\r\n for _, obj in ipairs(getAllObjects()) do\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Round number (num) to the Nth decimal (dec)\r\nfunction round(num, dec)\r\n local mult = 10^(dec or 0)\r\n return math.floor(num * mult + 0.5) / mult\r\nend\r", - "LuaScriptState": "{\"ml\":{\"01d780\":{\"lock\":false,\"pos\":{\"x\":12.252,\"y\":1.4815,\"z\":11.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"0dce91\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-28.014},\"rot\":{\"x\":0,\"y\":269.9792,\"z\":0}},\"23dd51\":{\"lock\":false,\"pos\":{\"x\":12.249,\"y\":1.4815,\"z\":35.986},\"rot\":{\"x\":0,\"y\":270,\"z\":0}},\"3c4f3c\":{\"lock\":false,\"pos\":{\"x\":12.251,\"y\":1.4815,\"z\":-20.014},\"rot\":{\"x\":0,\"y\":269.9867,\"z\":0}},\"4c173f\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":3.986},\"rot\":{\"x\":0,\"y\":269.9998,\"z\":0}},\"4dee5a\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-4.014},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"d02940\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-36.014},\"rot\":{\"x\":0,\"y\":270.0045,\"z\":0}},\"db7039\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":27.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"ee987d\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":19.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"fc7674\":{\"lock\":false,\"pos\":{\"x\":12.247,\"y\":1.4815,\"z\":-12.016},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}}}}\r", + "LuaScript": "-- Utility memory bag by Directsun\n-- Version 2.5.2\n-- Fork of Memory Bag 2.0 by MrStump\n\nfunction updateSave()\n local data_to_save = {[\"ml\"]=memoryList}\n saved_data = JSON.encode(data_to_save)\n self.script_state = saved_data\nend\n\nfunction combineMemoryFromBagsWithin()\n local bagObjList = self.getObjects()\n for _, bagObj in ipairs(bagObjList) do\n local data = bagObj.lua_script_state\n if data ~= nil then\n local j = JSON.decode(data)\n if j ~= nil and j.ml ~= nil then\n for guid, entry in pairs(j.ml) do\n memoryList[guid] = entry\n end\n end\n end\n end\nend\n\nfunction updateMemoryWithMoves()\n memoryList = memoryListBackup\n --get the first transposed object's coordinates\n local obj = getObjectFromGUID(moveGuid)\n\n -- p1 is where needs to go, p2 is where it was\n local refObjPos = memoryList[moveGuid].pos\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\n local movedRotation = obj.getRotation()\n for guid, entry in pairs(memoryList) do\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\n -- memoryList[guid].rot.x = movedRotation.x\n -- memoryList[guid].rot.y = movedRotation.y\n -- memoryList[guid].rot.z = movedRotation.z\n end\n\n --theList[obj.getGUID()] = {\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n -- lock=obj.getLock()\n --}\n moveList = {}\nend\n\nfunction onload(saved_data)\n fresh = true\n if saved_data ~= \"\" then\n local loaded_data = JSON.decode(saved_data)\n --Set up information off of loaded_data\n memoryList = loaded_data.ml\n else\n --Set up information for if there is no saved saved data\n memoryList = {}\n end\n\n moveList = {}\n moveGuid = nil\n\n if next(memoryList) == nil then\n createSetupButton()\n else\n fresh = false\n createMemoryActionButtons()\n end\nend\n\n\n--Beginning Setup\n\n\n--Make setup button\nfunction createSetupButton()\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n--Triggered by Transpose button\nfunction buttonClick_transpose()\n moveGuid = nil\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n moveList = {}\n self.clearButtons()\n createButtonsOnAllObjects(true)\n createSetupActionButtons(true)\nend\n\n--Triggered by setup button,\nfunction buttonClick_setup()\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n self.clearButtons()\n createButtonsOnAllObjects(false)\n createSetupActionButtons(false)\nend\n\nfunction getAllObjectsInMemory()\n local objTable = {}\n local curObj = {}\n\n for guid in pairs(memoryListBackup) do\n curObj = getObjectFromGUID(guid)\n table.insert(objTable, curObj)\n end\n\n return objTable\n -- return getAllObjects()\nend\n\n--Creates selection buttons on objects\nfunction createButtonsOnAllObjects(move)\n local howManyButtons = 0\n\n local objsToHaveButtons = {}\n if move == true then\n objsToHaveButtons = getAllObjectsInMemory()\n else\n objsToHaveButtons = getAllObjects()\n end\n\n for _, obj in ipairs(objsToHaveButtons) do\n if obj ~= self then\n local dummyIndex = howManyButtons\n --On a normal bag, the button positions aren't the same size as the bag.\n globalScaleFactor = 1 * 1/self.getScale().x\n --Super sweet math to set button positions\n local selfPos = self.getPosition()\n local objPos = obj.getPosition()\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\n local objPos = rotateLocalCoordinates(deltaPos, self)\n objPos.x = -objPos.x * globalScaleFactor\n objPos.y = objPos.y * globalScaleFactor + 4\n objPos.z = objPos.z * globalScaleFactor\n --Offset rotation of bag\n local rot = self.getRotation()\n rot.y = -rot.y + 180\n --Create function\n local funcName = \"selectButton_\" .. howManyButtons\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\n local color = {0.75,0.25,0.25,0.6}\n local colorMove = {0,0,1,0.6}\n if move == true then\n color = colorMove\n end\n self.setVar(funcName, func)\n self.createButton({\n click_function=funcName, function_owner=self,\n position=objPos, rotation=rot, height=1000, width=1000,\n color=color,\n })\n howManyButtons = howManyButtons + 1\n end\n end\nend\n\n--Creates submit and cancel buttons\nfunction createSetupActionButtons(move)\n self.createButton({\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\n position={-1.25,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n\n self.createButton({\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\n position={-1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n\n if move == false then\n self.createButton({\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\n position={1.25,0.3,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={0.25,1,0.25}\n })\n\n if fresh == false then\n self.createButton({\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\n position={1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={0.75,0.75,1}\n })\n self.createButton({\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\n position={1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,0.25,0.25}\n })\n end\n end\n\n self.createButton({\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\n position={-1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n\n--During Setup\n\n\n--Checks or unchecks buttons\nfunction buttonClick_selection(index, obj, move)\n local colorMove = {0,0,1,0.6}\n local color = {0,1,0,0.6}\n\n previousGuid = selectedGuid\n selectedGuid = obj.getGUID()\n\n theList = memoryList\n if move == true then\n theList = moveList\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\n local prevObj = getObjectFromGUID(previousGuid)\n prevObj.highlightOff()\n self.editButton({index=previousIndex, color=colorMove})\n theList[previousGuid] = nil\n end\n previousIndex = index\n end\n\n if theList[selectedGuid] == nil then\n self.editButton({index=index, color=color})\n --Adding pos/rot to memory table\n local pos, rot = obj.getPosition(), obj.getRotation()\n --I need to add it like this or it won't save due to indexing issue\n theList[obj.getGUID()] = {\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n lock=obj.getLock()\n }\n obj.highlightOn({0,1,0})\n else\n color = {0.75,0.25,0.25,0.6}\n if move == true then\n color = colorMove\n end\n self.editButton({index=index, color=color})\n theList[obj.getGUID()] = nil\n obj.highlightOff()\n end\nend\n\n--Cancels selection process\nfunction buttonClick_cancel()\n memoryList = memoryListBackup\n moveList = {}\n self.clearButtons()\n if next(memoryList) == nil then\n createSetupButton()\n else\n createMemoryActionButtons()\n end\n removeAllHighlights()\n broadcastToAll(\"Selection Canceled\", {1,1,1})\n moveGuid = nil\nend\n\n--Saves selections\nfunction buttonClick_submit()\n fresh = false\n if next(moveList) ~= nil then\n for guid in pairs(moveList) do\n moveGuid = guid\n end\n if memoryListBackup[moveGuid] == nil then\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\n else\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(moveList) do\n moveGuid = guid\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n updateMemoryWithMoves()\n updateSave()\n buttonClick_place()\n end\n elseif next(memoryList) == nil and moveGuid == nil then\n memoryList = memoryListBackup\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\n end\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\n moveGuid = nil\nend\n\nfunction combineTables(first_table, second_table)\n for k,v in pairs(second_table) do first_table[k] = v end\nend\n\nfunction buttonClick_add()\n fresh = false\n combineTables(memoryList, memoryListBackup)\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\nend\n\nfunction buttonClick_remove()\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n memoryListBackup[guid] = nil\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\nfunction buttonClick_setNew()\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for _, obj in ipairs(getAllObjects()) do\n guid = obj.guid\n if memoryListBackup[guid] ~= nil then\n count = count + 1\n memoryListBackup[guid].pos = obj.getPosition()\n memoryListBackup[guid].rot = obj.getRotation()\n memoryListBackup[guid].lock = obj.getLock()\n end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\n--Resets bag to starting status\nfunction buttonClick_reset()\n fresh = true\n memoryList = {}\n self.clearButtons()\n createSetupButton()\n removeAllHighlights()\n broadcastToAll(\"Tool Reset\", {1,1,1})\n updateSave()\nend\n\n\n--After Setup\n\n\n--Creates recall and place buttons\nfunction createMemoryActionButtons()\n self.createButton({\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\n position={1.35,1,6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\n position={-1.25,1,6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n--- self.createButton({\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\n--- })\nend\n\n--Sends objects from bag/table to their saved position/rotation\nfunction buttonClick_place()\n local bagObjList = self.getObjects()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n --If obj is out on the table, move it to the saved pos/rot\n if obj ~= nil then\n obj.setPositionSmooth(entry.pos)\n obj.setRotationSmooth(entry.rot)\n obj.setLock(entry.lock)\n else\n --If obj is inside of the bag\n for _, bagObj in ipairs(bagObjList) do\n if bagObj.guid == guid then\n local item = self.takeObject({\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\n })\n item.setLock(entry.lock)\n break\n end\n end\n end\n end\n broadcastToAll(\"Objects Placed\", {1,1,1})\nend\n\n--Recalls objects to bag from table\nfunction buttonClick_recall()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then self.putObject(obj) end\n end\n broadcastToAll(\"Objects Recalled\", {1,1,1})\nend\n\n\n--Utility functions\n\n\n--Find delta (difference) between 2 x/y/z coordinates\nfunction findOffsetDistance(p1, p2, obj)\n local yOffset = 0\n if obj ~= nil then\n local bounds = obj.getBounds()\n yOffset = (bounds.size.y - bounds.offset.y)\n end\n local deltaPos = {}\n deltaPos.x = (p2.x-p1.x)\n deltaPos.y = (p2.y-p1.y) + yOffset\n deltaPos.z = (p2.z-p1.z)\n return deltaPos\nend\n\n--Used to rotate a set of coordinates by an angle\nfunction rotateLocalCoordinates(desiredPos, obj)\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\n local angle = math.rad(objRot.y)\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\n return {x=x, y=desiredPos.y, z=z}\nend\n\nfunction rotateMyCoordinates(desiredPos, obj)\n\tlocal angle = math.rad(obj.getRotation().y)\n local x = desiredPos.x * math.sin(angle)\n\tlocal z = desiredPos.z * math.cos(angle)\n return {x=x, y=desiredPos.y, z=z}\nend\n\n--Coroutine delay, in seconds\nfunction wait(time)\n local start = os.time()\n repeat coroutine.yield(0) until os.time() \u003e start + time\nend\n\n--Duplicates a table (needed to prevent it making reference to the same objects)\nfunction duplicateTable(oldTable)\n local newTable = {}\n for k, v in pairs(oldTable) do\n newTable[k] = v\n end\n return newTable\nend\n\n--Moves scripted highlight from all objects\nfunction removeAllHighlights()\n for _, obj in ipairs(getAllObjects()) do\n obj.highlightOff()\n end\nend\n\n--Round number (num) to the Nth decimal (dec)\nfunction round(num, dec)\n local mult = 10^(dec or 0)\n return math.floor(num * mult + 0.5) / mult\nend", + "LuaScriptState": "{\"ml\":{\"01d780\":{\"lock\":false,\"pos\":{\"x\":12.252,\"y\":1.4815,\"z\":11.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"0dce91\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-28.014},\"rot\":{\"x\":0,\"y\":269.9792,\"z\":0}},\"23dd51\":{\"lock\":false,\"pos\":{\"x\":12.249,\"y\":1.4815,\"z\":35.986},\"rot\":{\"x\":0,\"y\":270,\"z\":0}},\"3c4f3c\":{\"lock\":false,\"pos\":{\"x\":12.251,\"y\":1.4815,\"z\":-20.014},\"rot\":{\"x\":0,\"y\":269.9867,\"z\":0}},\"4c173f\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":3.986},\"rot\":{\"x\":0,\"y\":269.9998,\"z\":0}},\"4dee5a\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-4.014},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"d02940\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-36.014},\"rot\":{\"x\":0,\"y\":270.0045,\"z\":0}},\"db7039\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":27.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"ee987d\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":19.986},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}},\"fc7674\":{\"lock\":false,\"pos\":{\"x\":12.247,\"y\":1.4815,\"z\":-12.016},\"rot\":{\"x\":0,\"y\":270.0001,\"z\":0}}}}", "MaterialIndex": -1, "MeasureMovement": false, "MeshIndex": -1, @@ -22728,7 +21502,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655600953066192972/8A5939900FCA8E2A2772CEDE6A03594A68961C4C/", + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/2299716459828640802/A224024254ABCFB818F12B50C1E5E0B32060F972/", "MaterialIndex": 3, "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", "NormalURL": "", @@ -22736,11 +21510,11 @@ }, "Description": "Challenge Scenario", "DragSelectable": true, - "GMNotes": "scenarios/challenge_all_or_nothing.json", - "GUID": "72ab92", + "GMNotes": "scenarios/challenge_relics_of_the_past.json", + "GUID": "0d6da1", "Grid": true, "GridProjection": false, - "Hands": true, + "Hands": false, "HideWhenFaceDown": false, "IgnoreFoW": false, "LayoutGroupSortIndex": 0, @@ -22749,14 +21523,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", - "Nickname": "All or Nothing", + "Nickname": "Relics of the Past", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { "posX": 12.25, "posY": 1.481, - "posZ": 19.986, + "posZ": -28.014, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -22814,7 +21588,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655599785039299268/52DB5C3A0E600D6AECB0B851ECF90C5B3D016421/", + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1849293764610824071/BD70BFDA6DED25221D6DC1BE60C8CE11B165F848/", "MaterialIndex": 3, "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", "NormalURL": "", @@ -22822,11 +21596,11 @@ }, "Description": "Challenge Scenario", "DragSelectable": true, - "GMNotes": "scenarios/challenge_bad_blood.json", - "GUID": "451eaa", + "GMNotes": "scenarios/challenge_red_tide_rising.json", + "GUID": "5302f2", "Grid": true, "GridProjection": false, - "Hands": true, + "Hands": false, "HideWhenFaceDown": false, "IgnoreFoW": false, "LayoutGroupSortIndex": 0, @@ -22835,14 +21609,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", - "Nickname": "Bad Blood", + "Nickname": "Red Tide Rising", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 12.252, + "posX": 12.25, "posY": 1.481, - "posZ": 11.986, + "posZ": -20.014, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -22900,7 +21674,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1719794129200879643/47A3BC15C8C8ADB45137A2258B86C1D2DB9C2B03/", + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655599785039304850/852232605656B7DD6577C475A1988491D3378506/", "MaterialIndex": 3, "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", "NormalURL": "", @@ -22908,8 +21682,8 @@ }, "Description": "Challenge Scenario", "DragSelectable": true, - "GMNotes": "scenarios/challenge_by_the_book.json", - "GUID": "cc7eb3", + "GMNotes": "scenarios/challenge_read_or_die.json", + "GUID": "9e73fa", "Grid": true, "GridProjection": false, "Hands": true, @@ -22921,14 +21695,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", - "Nickname": "By the Book", + "Nickname": "Read or Die", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { "posX": 12.25, "posY": 1.481, - "posZ": 3.986, + "posZ": -12.014, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -23072,7 +21846,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655599785039304850/852232605656B7DD6577C475A1988491D3378506/", + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1719794129200879643/47A3BC15C8C8ADB45137A2258B86C1D2DB9C2B03/", "MaterialIndex": 3, "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", "NormalURL": "", @@ -23080,8 +21854,8 @@ }, "Description": "Challenge Scenario", "DragSelectable": true, - "GMNotes": "scenarios/challenge_read_or_die.json", - "GUID": "9e73fa", + "GMNotes": "scenarios/challenge_by_the_book.json", + "GUID": "cc7eb3", "Grid": true, "GridProjection": false, "Hands": true, @@ -23093,14 +21867,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", - "Nickname": "Read or Die", + "Nickname": "By the Book", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { "posX": 12.25, "posY": 1.481, - "posZ": -12.014, + "posZ": 3.986, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -23158,7 +21932,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1849293764610824071/BD70BFDA6DED25221D6DC1BE60C8CE11B165F848/", + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655599785039299268/52DB5C3A0E600D6AECB0B851ECF90C5B3D016421/", "MaterialIndex": 3, "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", "NormalURL": "", @@ -23166,11 +21940,11 @@ }, "Description": "Challenge Scenario", "DragSelectable": true, - "GMNotes": "scenarios/challenge_red_tide_rising.json", - "GUID": "5302f2", + "GMNotes": "scenarios/challenge_bad_blood.json", + "GUID": "451eaa", "Grid": true, "GridProjection": false, - "Hands": false, + "Hands": true, "HideWhenFaceDown": false, "IgnoreFoW": false, "LayoutGroupSortIndex": 0, @@ -23179,14 +21953,100 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", - "Nickname": "Red Tide Rising", + "Nickname": "Bad Blood", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 12.252, + "posY": 1.481, + "posZ": 11.986, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 2.21, + "scaleY": 0.46, + "scaleZ": 2.42 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "AttachedDecals": [ + { + "CustomDecal": { + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/", + "Name": "dunwich_back", + "Size": 7.4 + }, + "Transform": { + "posX": -0.0021877822, + "posY": -0.08963572, + "posZ": -0.00288731651, + "rotX": 270, + "rotY": 359.869568, + "rotZ": 0, + "scaleX": 2.00000215, + "scaleY": 2.00000238, + "scaleZ": 2.00000262 + } + } + ], + "Autoraise": true, + "ColorDiffuse": { + "a": 0.27451, + "b": 1, + "g": 1, + "r": 1 + }, + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1655600953066192972/8A5939900FCA8E2A2772CEDE6A03594A68961C4C/", + "MaterialIndex": 3, + "MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj", + "NormalURL": "", + "TypeIndex": 0 + }, + "Description": "Challenge Scenario", + "DragSelectable": true, + "GMNotes": "scenarios/challenge_all_or_nothing.json", + "GUID": "72ab92", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Model", + "Nickname": "All or Nothing", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { "posX": 12.25, "posY": 1.481, - "posZ": -20.014, + "posZ": 19.986, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -23229,8 +22089,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Utility memory bag by Directsun\r\n-- Version 2.5.2\r\n-- Fork of Memory Bag 2.0 by MrStump\r\n\r\nfunction updateSave()\r\n local data_to_save = {[\"ml\"]=memoryList}\r\n saved_data = JSON.encode(data_to_save)\r\n self.script_state = saved_data\r\nend\r\n\r\nfunction combineMemoryFromBagsWithin()\r\n local bagObjList = self.getObjects()\r\n for _, bagObj in ipairs(bagObjList) do\r\n local data = bagObj.lua_script_state\r\n if data ~= nil then\r\n local j = JSON.decode(data)\r\n if j ~= nil and j.ml ~= nil then\r\n for guid, entry in pairs(j.ml) do\r\n memoryList[guid] = entry\r\n end\r\n end\r\n end\r\n end\r\nend\r\n\r\nfunction updateMemoryWithMoves()\r\n memoryList = memoryListBackup\r\n --get the first transposed object's coordinates\r\n local obj = getObjectFromGUID(moveGuid)\r\n\r\n -- p1 is where needs to go, p2 is where it was\r\n local refObjPos = memoryList[moveGuid].pos\r\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\r\n local movedRotation = obj.getRotation()\r\n for guid, entry in pairs(memoryList) do\r\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\r\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\r\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\r\n -- memoryList[guid].rot.x = movedRotation.x\r\n -- memoryList[guid].rot.y = movedRotation.y\r\n -- memoryList[guid].rot.z = movedRotation.z\r\n end\r\n\r\n --theList[obj.getGUID()] = {\r\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n -- lock=obj.getLock()\r\n --}\r\n moveList = {}\r\nend\r\n\r\nfunction onload(saved_data)\r\n fresh = true\r\n if saved_data ~= \"\" then\r\n local loaded_data = JSON.decode(saved_data)\r\n --Set up information off of loaded_data\r\n memoryList = loaded_data.ml\r\n else\r\n --Set up information for if there is no saved saved data\r\n memoryList = {}\r\n end\r\n\r\n moveList = {}\r\n moveGuid = nil\r\n\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n fresh = false\r\n createMemoryActionButtons()\r\n end\r\nend\r\n\r\n\r\n--Beginning Setup\r\n\r\n\r\n--Make setup button\r\nfunction createSetupButton()\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n--Triggered by Transpose button\r\nfunction buttonClick_transpose()\r\n moveGuid = nil\r\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n moveList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(true)\r\n createSetupActionButtons(true)\r\nend\r\n\r\n--Triggered by setup button,\r\nfunction buttonClick_setup()\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(false)\r\n createSetupActionButtons(false)\r\nend\r\n\r\nfunction getAllObjectsInMemory()\r\n local objTable = {}\r\n local curObj = {}\r\n\r\n for guid in pairs(memoryListBackup) do\r\n curObj = getObjectFromGUID(guid)\r\n table.insert(objTable, curObj)\r\n end\r\n\r\n return objTable\r\n -- return getAllObjects()\r\nend\r\n\r\n--Creates selection buttons on objects\r\nfunction createButtonsOnAllObjects(move)\r\n local howManyButtons = 0\r\n\r\n local objsToHaveButtons = {}\r\n if move == true then\r\n objsToHaveButtons = getAllObjectsInMemory()\r\n else\r\n objsToHaveButtons = getAllObjects()\r\n end\r\n\r\n for _, obj in ipairs(objsToHaveButtons) do\r\n if obj ~= self then\r\n local dummyIndex = howManyButtons\r\n --On a normal bag, the button positions aren't the same size as the bag.\r\n globalScaleFactor = 1 * 1/self.getScale().x\r\n --Super sweet math to set button positions\r\n local selfPos = self.getPosition()\r\n local objPos = obj.getPosition()\r\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\r\n local objPos = rotateLocalCoordinates(deltaPos, self)\r\n objPos.x = -objPos.x * globalScaleFactor\r\n objPos.y = objPos.y * globalScaleFactor + 4\r\n objPos.z = objPos.z * globalScaleFactor\r\n --Offset rotation of bag\r\n local rot = self.getRotation()\r\n rot.y = -rot.y + 180\r\n --Create function\r\n local funcName = \"selectButton_\" .. howManyButtons\r\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\r\n local color = {0.75,0.25,0.25,0.6}\r\n local colorMove = {0,0,1,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n click_function=funcName, function_owner=self,\r\n position=objPos, rotation=rot, height=1000, width=1000,\r\n color=color,\r\n })\r\n howManyButtons = howManyButtons + 1\r\n end\r\n end\r\nend\r\n\r\n--Creates submit and cancel buttons\r\nfunction createSetupActionButtons(move)\r\n self.createButton({\r\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\r\n position={-1.25,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n self.createButton({\r\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\r\n position={-1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n if move == false then\r\n self.createButton({\r\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\r\n position={1.25,0.3,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={0.25,1,0.25}\r\n })\r\n\r\n if fresh == false then\r\n self.createButton({\r\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\r\n position={1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={0.75,0.75,1}\r\n })\r\n self.createButton({\r\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\r\n position={1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,0.25,0.25}\r\n })\r\n end\r\n end\r\n\r\n self.createButton({\r\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\r\n position={-1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n\r\n--During Setup\r\n\r\n\r\n--Checks or unchecks buttons\r\nfunction buttonClick_selection(index, obj, move)\r\n local colorMove = {0,0,1,0.6}\r\n local color = {0,1,0,0.6}\r\n\r\n previousGuid = selectedGuid\r\n selectedGuid = obj.getGUID()\r\n\r\n theList = memoryList\r\n if move == true then\r\n theList = moveList\r\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\r\n local prevObj = getObjectFromGUID(previousGuid)\r\n prevObj.highlightOff()\r\n self.editButton({index=previousIndex, color=colorMove})\r\n theList[previousGuid] = nil\r\n end\r\n previousIndex = index\r\n end\r\n\r\n if theList[selectedGuid] == nil then\r\n self.editButton({index=index, color=color})\r\n --Adding pos/rot to memory table\r\n local pos, rot = obj.getPosition(), obj.getRotation()\r\n --I need to add it like this or it won't save due to indexing issue\r\n theList[obj.getGUID()] = {\r\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n lock=obj.getLock()\r\n }\r\n obj.highlightOn({0,1,0})\r\n else\r\n color = {0.75,0.25,0.25,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.editButton({index=index, color=color})\r\n theList[obj.getGUID()] = nil\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Cancels selection process\r\nfunction buttonClick_cancel()\r\n memoryList = memoryListBackup\r\n moveList = {}\r\n self.clearButtons()\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n createMemoryActionButtons()\r\n end\r\n removeAllHighlights()\r\n broadcastToAll(\"Selection Canceled\", {1,1,1})\r\n moveGuid = nil\r\nend\r\n\r\n--Saves selections\r\nfunction buttonClick_submit()\r\n fresh = false\r\n if next(moveList) ~= nil then\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n end\r\n if memoryListBackup[moveGuid] == nil then\r\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\r\n else\r\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n updateMemoryWithMoves()\r\n updateSave()\r\n buttonClick_place()\r\n end\r\n elseif next(memoryList) == nil and moveGuid == nil then\r\n memoryList = memoryListBackup\r\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\r\n end\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\n moveGuid = nil\r\nend\r\n\r\nfunction combineTables(first_table, second_table)\r\n for k,v in pairs(second_table) do first_table[k] = v end\r\nend\r\n\r\nfunction buttonClick_add()\r\n fresh = false\r\n combineTables(memoryList, memoryListBackup)\r\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_remove()\r\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n memoryListBackup[guid] = nil\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_setNew()\r\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for _, obj in ipairs(getAllObjects()) do\r\n guid = obj.guid\r\n if memoryListBackup[guid] ~= nil then\r\n count = count + 1\r\n memoryListBackup[guid].pos = obj.getPosition()\r\n memoryListBackup[guid].rot = obj.getRotation()\r\n memoryListBackup[guid].lock = obj.getLock()\r\n end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\n--Resets bag to starting status\r\nfunction buttonClick_reset()\r\n fresh = true\r\n memoryList = {}\r\n self.clearButtons()\r\n createSetupButton()\r\n removeAllHighlights()\r\n broadcastToAll(\"Tool Reset\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\n\r\n--After Setup\r\n\r\n\r\n--Creates recall and place buttons\r\nfunction createMemoryActionButtons()\r\n self.createButton({\r\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\r\n position={1.35,1,6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\r\n position={-1.25,1,6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\n--- self.createButton({\r\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\r\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\r\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\r\n--- })\r\nend\r\n\r\n--Sends objects from bag/table to their saved position/rotation\r\nfunction buttonClick_place()\r\n local bagObjList = self.getObjects()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n --If obj is out on the table, move it to the saved pos/rot\r\n if obj ~= nil then\r\n obj.setPositionSmooth(entry.pos)\r\n obj.setRotationSmooth(entry.rot)\r\n obj.setLock(entry.lock)\r\n else\r\n --If obj is inside of the bag\r\n for _, bagObj in ipairs(bagObjList) do\r\n if bagObj.guid == guid then\r\n local item = self.takeObject({\r\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\r\n })\r\n item.setLock(entry.lock)\r\n break\r\n end\r\n end\r\n end\r\n end\r\n broadcastToAll(\"Objects Placed\", {1,1,1})\r\nend\r\n\r\n--Recalls objects to bag from table\r\nfunction buttonClick_recall()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then self.putObject(obj) end\r\n end\r\n broadcastToAll(\"Objects Recalled\", {1,1,1})\r\nend\r\n\r\n\r\n--Utility functions\r\n\r\n\r\n--Find delta (difference) between 2 x/y/z coordinates\r\nfunction findOffsetDistance(p1, p2, obj)\r\n local yOffset = 0\r\n if obj ~= nil then\r\n local bounds = obj.getBounds()\r\n yOffset = (bounds.size.y - bounds.offset.y)\r\n end\r\n local deltaPos = {}\r\n deltaPos.x = (p2.x-p1.x)\r\n deltaPos.y = (p2.y-p1.y) + yOffset\r\n deltaPos.z = (p2.z-p1.z)\r\n return deltaPos\r\nend\r\n\r\n--Used to rotate a set of coordinates by an angle\r\nfunction rotateLocalCoordinates(desiredPos, obj)\r\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\r\n local angle = math.rad(objRot.y)\r\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\r\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\r\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\nfunction rotateMyCoordinates(desiredPos, obj)\r\n\tlocal angle = math.rad(obj.getRotation().y)\r\n local x = desiredPos.x * math.sin(angle)\r\n\tlocal z = desiredPos.z * math.cos(angle)\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\n--Coroutine delay, in seconds\r\nfunction wait(time)\r\n local start = os.time()\r\n repeat coroutine.yield(0) until os.time() \u003e start + time\r\nend\r\n\r\n--Duplicates a table (needed to prevent it making reference to the same objects)\r\nfunction duplicateTable(oldTable)\r\n local newTable = {}\r\n for k, v in pairs(oldTable) do\r\n newTable[k] = v\r\n end\r\n return newTable\r\nend\r\n\r\n--Moves scripted highlight from all objects\r\nfunction removeAllHighlights()\r\n for _, obj in ipairs(getAllObjects()) do\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Round number (num) to the Nth decimal (dec)\r\nfunction round(num, dec)\r\n local mult = 10^(dec or 0)\r\n return math.floor(num * mult + 0.5) / mult\r\nend\r", - "LuaScriptState": "{\"ml\":{\"451eaa\":{\"lock\":false,\"pos\":{\"x\":12.252,\"y\":1.4815,\"z\":11.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"5302f2\":{\"lock\":false,\"pos\":{\"x\":12.2505,\"y\":1.4815,\"z\":-20.0137},\"rot\":{\"x\":0,\"y\":270.0014,\"z\":0}},\"72ab92\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":19.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"9e73fa\":{\"lock\":false,\"pos\":{\"x\":12.2501,\"y\":1.4815,\"z\":-12.0137},\"rot\":{\"x\":0,\"y\":269.9998,\"z\":0}},\"cc7eb3\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":3.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"e2dd57\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-4.014},\"rot\":{\"x\":0,\"y\":270,\"z\":0}}}}", + "LuaScript": "-- Utility memory bag by Directsun\n-- Version 2.5.2\n-- Fork of Memory Bag 2.0 by MrStump\n\nfunction updateSave()\n local data_to_save = {[\"ml\"]=memoryList}\n saved_data = JSON.encode(data_to_save)\n self.script_state = saved_data\nend\n\nfunction combineMemoryFromBagsWithin()\n local bagObjList = self.getObjects()\n for _, bagObj in ipairs(bagObjList) do\n local data = bagObj.lua_script_state\n if data ~= nil then\n local j = JSON.decode(data)\n if j ~= nil and j.ml ~= nil then\n for guid, entry in pairs(j.ml) do\n memoryList[guid] = entry\n end\n end\n end\n end\nend\n\nfunction updateMemoryWithMoves()\n memoryList = memoryListBackup\n --get the first transposed object's coordinates\n local obj = getObjectFromGUID(moveGuid)\n\n -- p1 is where needs to go, p2 is where it was\n local refObjPos = memoryList[moveGuid].pos\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\n local movedRotation = obj.getRotation()\n for guid, entry in pairs(memoryList) do\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\n -- memoryList[guid].rot.x = movedRotation.x\n -- memoryList[guid].rot.y = movedRotation.y\n -- memoryList[guid].rot.z = movedRotation.z\n end\n\n --theList[obj.getGUID()] = {\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n -- lock=obj.getLock()\n --}\n moveList = {}\nend\n\nfunction onload(saved_data)\n fresh = true\n if saved_data ~= \"\" then\n local loaded_data = JSON.decode(saved_data)\n --Set up information off of loaded_data\n memoryList = loaded_data.ml\n else\n --Set up information for if there is no saved saved data\n memoryList = {}\n end\n\n moveList = {}\n moveGuid = nil\n\n if next(memoryList) == nil then\n createSetupButton()\n else\n fresh = false\n createMemoryActionButtons()\n end\nend\n\n\n--Beginning Setup\n\n\n--Make setup button\nfunction createSetupButton()\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n--Triggered by Transpose button\nfunction buttonClick_transpose()\n moveGuid = nil\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n moveList = {}\n self.clearButtons()\n createButtonsOnAllObjects(true)\n createSetupActionButtons(true)\nend\n\n--Triggered by setup button,\nfunction buttonClick_setup()\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n self.clearButtons()\n createButtonsOnAllObjects(false)\n createSetupActionButtons(false)\nend\n\nfunction getAllObjectsInMemory()\n local objTable = {}\n local curObj = {}\n\n for guid in pairs(memoryListBackup) do\n curObj = getObjectFromGUID(guid)\n table.insert(objTable, curObj)\n end\n\n return objTable\n -- return getAllObjects()\nend\n\n--Creates selection buttons on objects\nfunction createButtonsOnAllObjects(move)\n local howManyButtons = 0\n\n local objsToHaveButtons = {}\n if move == true then\n objsToHaveButtons = getAllObjectsInMemory()\n else\n objsToHaveButtons = getAllObjects()\n end\n\n for _, obj in ipairs(objsToHaveButtons) do\n if obj ~= self then\n local dummyIndex = howManyButtons\n --On a normal bag, the button positions aren't the same size as the bag.\n globalScaleFactor = 1 * 1/self.getScale().x\n --Super sweet math to set button positions\n local selfPos = self.getPosition()\n local objPos = obj.getPosition()\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\n local objPos = rotateLocalCoordinates(deltaPos, self)\n objPos.x = -objPos.x * globalScaleFactor\n objPos.y = objPos.y * globalScaleFactor + 4\n objPos.z = objPos.z * globalScaleFactor\n --Offset rotation of bag\n local rot = self.getRotation()\n rot.y = -rot.y + 180\n --Create function\n local funcName = \"selectButton_\" .. howManyButtons\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\n local color = {0.75,0.25,0.25,0.6}\n local colorMove = {0,0,1,0.6}\n if move == true then\n color = colorMove\n end\n self.setVar(funcName, func)\n self.createButton({\n click_function=funcName, function_owner=self,\n position=objPos, rotation=rot, height=1000, width=1000,\n color=color,\n })\n howManyButtons = howManyButtons + 1\n end\n end\nend\n\n--Creates submit and cancel buttons\nfunction createSetupActionButtons(move)\n self.createButton({\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\n position={-1.25,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n\n self.createButton({\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\n position={-1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n\n if move == false then\n self.createButton({\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\n position={1.25,0.3,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={0.25,1,0.25}\n })\n\n if fresh == false then\n self.createButton({\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\n position={1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={0.75,0.75,1}\n })\n self.createButton({\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\n position={1.25,0.3,-7}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,0.25,0.25}\n })\n end\n end\n\n self.createButton({\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\n position={-1.25,0.3,-8}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n\n--During Setup\n\n\n--Checks or unchecks buttons\nfunction buttonClick_selection(index, obj, move)\n local colorMove = {0,0,1,0.6}\n local color = {0,1,0,0.6}\n\n previousGuid = selectedGuid\n selectedGuid = obj.getGUID()\n\n theList = memoryList\n if move == true then\n theList = moveList\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\n local prevObj = getObjectFromGUID(previousGuid)\n prevObj.highlightOff()\n self.editButton({index=previousIndex, color=colorMove})\n theList[previousGuid] = nil\n end\n previousIndex = index\n end\n\n if theList[selectedGuid] == nil then\n self.editButton({index=index, color=color})\n --Adding pos/rot to memory table\n local pos, rot = obj.getPosition(), obj.getRotation()\n --I need to add it like this or it won't save due to indexing issue\n theList[obj.getGUID()] = {\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n lock=obj.getLock()\n }\n obj.highlightOn({0,1,0})\n else\n color = {0.75,0.25,0.25,0.6}\n if move == true then\n color = colorMove\n end\n self.editButton({index=index, color=color})\n theList[obj.getGUID()] = nil\n obj.highlightOff()\n end\nend\n\n--Cancels selection process\nfunction buttonClick_cancel()\n memoryList = memoryListBackup\n moveList = {}\n self.clearButtons()\n if next(memoryList) == nil then\n createSetupButton()\n else\n createMemoryActionButtons()\n end\n removeAllHighlights()\n broadcastToAll(\"Selection Canceled\", {1,1,1})\n moveGuid = nil\nend\n\n--Saves selections\nfunction buttonClick_submit()\n fresh = false\n if next(moveList) ~= nil then\n for guid in pairs(moveList) do\n moveGuid = guid\n end\n if memoryListBackup[moveGuid] == nil then\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\n else\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(moveList) do\n moveGuid = guid\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n updateMemoryWithMoves()\n updateSave()\n buttonClick_place()\n end\n elseif next(memoryList) == nil and moveGuid == nil then\n memoryList = memoryListBackup\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\n end\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\n moveGuid = nil\nend\n\nfunction combineTables(first_table, second_table)\n for k,v in pairs(second_table) do first_table[k] = v end\nend\n\nfunction buttonClick_add()\n fresh = false\n combineTables(memoryList, memoryListBackup)\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\nend\n\nfunction buttonClick_remove()\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n memoryListBackup[guid] = nil\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\nfunction buttonClick_setNew()\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for _, obj in ipairs(getAllObjects()) do\n guid = obj.guid\n if memoryListBackup[guid] ~= nil then\n count = count + 1\n memoryListBackup[guid].pos = obj.getPosition()\n memoryListBackup[guid].rot = obj.getRotation()\n memoryListBackup[guid].lock = obj.getLock()\n end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\n--Resets bag to starting status\nfunction buttonClick_reset()\n fresh = true\n memoryList = {}\n self.clearButtons()\n createSetupButton()\n removeAllHighlights()\n broadcastToAll(\"Tool Reset\", {1,1,1})\n updateSave()\nend\n\n\n--After Setup\n\n\n--Creates recall and place buttons\nfunction createMemoryActionButtons()\n self.createButton({\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\n position={1.35,1,6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\n position={-1.25,1,6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\n--- self.createButton({\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\n--- })\nend\n\n--Sends objects from bag/table to their saved position/rotation\nfunction buttonClick_place()\n local bagObjList = self.getObjects()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n --If obj is out on the table, move it to the saved pos/rot\n if obj ~= nil then\n obj.setPositionSmooth(entry.pos)\n obj.setRotationSmooth(entry.rot)\n obj.setLock(entry.lock)\n else\n --If obj is inside of the bag\n for _, bagObj in ipairs(bagObjList) do\n if bagObj.guid == guid then\n local item = self.takeObject({\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\n })\n item.setLock(entry.lock)\n break\n end\n end\n end\n end\n broadcastToAll(\"Objects Placed\", {1,1,1})\nend\n\n--Recalls objects to bag from table\nfunction buttonClick_recall()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then self.putObject(obj) end\n end\n broadcastToAll(\"Objects Recalled\", {1,1,1})\nend\n\n\n--Utility functions\n\n\n--Find delta (difference) between 2 x/y/z coordinates\nfunction findOffsetDistance(p1, p2, obj)\n local yOffset = 0\n if obj ~= nil then\n local bounds = obj.getBounds()\n yOffset = (bounds.size.y - bounds.offset.y)\n end\n local deltaPos = {}\n deltaPos.x = (p2.x-p1.x)\n deltaPos.y = (p2.y-p1.y) + yOffset\n deltaPos.z = (p2.z-p1.z)\n return deltaPos\nend\n\n--Used to rotate a set of coordinates by an angle\nfunction rotateLocalCoordinates(desiredPos, obj)\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\n local angle = math.rad(objRot.y)\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\n return {x=x, y=desiredPos.y, z=z}\nend\n\nfunction rotateMyCoordinates(desiredPos, obj)\n\tlocal angle = math.rad(obj.getRotation().y)\n local x = desiredPos.x * math.sin(angle)\n\tlocal z = desiredPos.z * math.cos(angle)\n return {x=x, y=desiredPos.y, z=z}\nend\n\n--Coroutine delay, in seconds\nfunction wait(time)\n local start = os.time()\n repeat coroutine.yield(0) until os.time() \u003e start + time\nend\n\n--Duplicates a table (needed to prevent it making reference to the same objects)\nfunction duplicateTable(oldTable)\n local newTable = {}\n for k, v in pairs(oldTable) do\n newTable[k] = v\n end\n return newTable\nend\n\n--Moves scripted highlight from all objects\nfunction removeAllHighlights()\n for _, obj in ipairs(getAllObjects()) do\n obj.highlightOff()\n end\nend\n\n--Round number (num) to the Nth decimal (dec)\nfunction round(num, dec)\n local mult = 10^(dec or 0)\n return math.floor(num * mult + 0.5) / mult\nend", + "LuaScriptState": "{\"ml\":{\"0d6da1\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-28.014},\"rot\":{\"x\":0,\"y\":270.0014,\"z\":0}},\"451eaa\":{\"lock\":false,\"pos\":{\"x\":12.252,\"y\":1.4815,\"z\":11.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"5302f2\":{\"lock\":false,\"pos\":{\"x\":12.2505,\"y\":1.4815,\"z\":-20.0137},\"rot\":{\"x\":0,\"y\":270.0014,\"z\":0}},\"72ab92\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":19.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"9e73fa\":{\"lock\":false,\"pos\":{\"x\":12.2501,\"y\":1.4815,\"z\":-12.0137},\"rot\":{\"x\":0,\"y\":269.9998,\"z\":0}},\"cc7eb3\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":3.986},\"rot\":{\"x\":0,\"y\":269.9999,\"z\":0}},\"e2dd57\":{\"lock\":false,\"pos\":{\"x\":12.25,\"y\":1.4815,\"z\":-4.014},\"rot\":{\"x\":0,\"y\":270,\"z\":0}}}}", "MaterialIndex": -1, "MeasureMovement": false, "MeshIndex": -1, @@ -23270,7 +22130,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1758068588410895356/0B5F0CCD29DEC12514840D7B9CD2329B635A79A6/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 6 }, @@ -23285,8 +22145,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Utility memory bag by Directsun\r\n-- Version 2.5.2\r\n-- Fork of Memory Bag 2.0 by MrStump\r\n\r\nfunction updateSave()\r\n local data_to_save = {[\"ml\"]=memoryList}\r\n saved_data = JSON.encode(data_to_save)\r\n self.script_state = saved_data\r\nend\r\n\r\nfunction combineMemoryFromBagsWithin()\r\n local bagObjList = self.getObjects()\r\n for _, bagObj in ipairs(bagObjList) do\r\n local data = bagObj.lua_script_state\r\n if data ~= nil then\r\n local j = JSON.decode(data)\r\n if j ~= nil and j.ml ~= nil then\r\n for guid, entry in pairs(j.ml) do\r\n memoryList[guid] = entry\r\n end\r\n end\r\n end\r\n end\r\nend\r\n\r\nfunction updateMemoryWithMoves()\r\n memoryList = memoryListBackup\r\n --get the first transposed object's coordinates\r\n local obj = getObjectFromGUID(moveGuid)\r\n\r\n -- p1 is where needs to go, p2 is where it was\r\n local refObjPos = memoryList[moveGuid].pos\r\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\r\n local movedRotation = obj.getRotation()\r\n for guid, entry in pairs(memoryList) do\r\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\r\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\r\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\r\n -- memoryList[guid].rot.x = movedRotation.x\r\n -- memoryList[guid].rot.y = movedRotation.y\r\n -- memoryList[guid].rot.z = movedRotation.z\r\n end\r\n\r\n --theList[obj.getGUID()] = {\r\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n -- lock=obj.getLock()\r\n --}\r\n moveList = {}\r\nend\r\n\r\nfunction onload(saved_data)\r\n fresh = true\r\n if saved_data ~= \"\" then\r\n local loaded_data = JSON.decode(saved_data)\r\n --Set up information off of loaded_data\r\n memoryList = loaded_data.ml\r\n else\r\n --Set up information for if there is no saved saved data\r\n memoryList = {}\r\n end\r\n\r\n moveList = {}\r\n moveGuid = nil\r\n\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n fresh = false\r\n createMemoryActionButtons()\r\n end\r\nend\r\n\r\n\r\n--Beginning Setup\r\n\r\n\r\n--Make setup button\r\nfunction createSetupButton()\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\r\n font_size=350, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n--Triggered by Transpose button\r\nfunction buttonClick_transpose()\r\n moveGuid = nil\r\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n moveList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(true)\r\n createSetupActionButtons(true)\r\nend\r\n\r\n--Triggered by setup button,\r\nfunction buttonClick_setup()\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n self.clearButtons()\r\n createButtonsOnAllObjects(false)\r\n createSetupActionButtons(false)\r\nend\r\n\r\nfunction getAllObjectsInMemory()\r\n local objTable = {}\r\n local curObj = {}\r\n\r\n for guid in pairs(memoryListBackup) do\r\n curObj = getObjectFromGUID(guid)\r\n table.insert(objTable, curObj)\r\n end\r\n\r\n return objTable\r\n -- return getAllObjects()\r\nend\r\n\r\n--Creates selection buttons on objects\r\nfunction createButtonsOnAllObjects(move)\r\n local howManyButtons = 0\r\n\r\n local objsToHaveButtons = {}\r\n if move == true then\r\n objsToHaveButtons = getAllObjectsInMemory()\r\n else\r\n objsToHaveButtons = getAllObjects()\r\n end\r\n\r\n for _, obj in ipairs(objsToHaveButtons) do\r\n if obj ~= self then\r\n local dummyIndex = howManyButtons\r\n --On a normal bag, the button positions aren't the same size as the bag.\r\n globalScaleFactor = 1 * 1/self.getScale().x\r\n --Super sweet math to set button positions\r\n local selfPos = self.getPosition()\r\n local objPos = obj.getPosition()\r\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\r\n local objPos = rotateLocalCoordinates(deltaPos, self)\r\n objPos.x = -objPos.x * globalScaleFactor\r\n objPos.y = objPos.y * globalScaleFactor + 4\r\n objPos.z = objPos.z * globalScaleFactor\r\n --Offset rotation of bag\r\n local rot = self.getRotation()\r\n rot.y = -rot.y + 180\r\n --Create function\r\n local funcName = \"selectButton_\" .. howManyButtons\r\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\r\n local color = {0.75,0.25,0.25,0.6}\r\n local colorMove = {0,0,1,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n click_function=funcName, function_owner=self,\r\n position=objPos, rotation=rot, height=1000, width=1000,\r\n color=color,\r\n })\r\n howManyButtons = howManyButtons + 1\r\n end\r\n end\r\nend\r\n\r\n--Creates submit and cancel buttons\r\nfunction createSetupActionButtons(move)\r\n self.createButton({\r\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\r\n position={0,1,-2}, rotation={0,0,0}, height=240, width=550,\r\n font_size=150, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n self.createButton({\r\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\r\n position={-1.2,1,-2}, rotation={0,0,0}, height=240, width=570,\r\n font_size=150, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n if move == false then\r\n self.createButton({\r\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\r\n position={-1.2,1,2}, rotation={0,0,0}, height=240, width=550,\r\n font_size=150, color={0,0,0}, font_color={0.25,1,0.25}\r\n })\r\n\r\n if fresh == false then\r\n self.createButton({\r\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\r\n position={0,1,2}, rotation={0,0,0}, height=240, width=600,\r\n font_size=150, color={0,0,0}, font_color={0.75,0.75,1}\r\n })\r\n self.createButton({\r\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\r\n position={1.3,1,2}, rotation={0,0,0}, height=240, width=600,\r\n font_size=150, color={0,0,0}, font_color={1,0.25,0.25}\r\n })\r\n end\r\n end\r\n\r\n self.createButton({\r\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\r\n position={1.2,1,-2}, rotation={0,0,0}, height=240, width=500,\r\n font_size=150, color={0,0,0}, font_color={1,1,1}\r\n })\r\nend\r\n\r\n\r\n--During Setup\r\n\r\n\r\n--Checks or unchecks buttons\r\nfunction buttonClick_selection(index, obj, move)\r\n local colorMove = {0,0,1,0.6}\r\n local color = {0,1,0,0.6}\r\n\r\n previousGuid = selectedGuid\r\n selectedGuid = obj.getGUID()\r\n\r\n theList = memoryList\r\n if move == true then\r\n theList = moveList\r\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\r\n local prevObj = getObjectFromGUID(previousGuid)\r\n prevObj.highlightOff()\r\n self.editButton({index=previousIndex, color=colorMove})\r\n theList[previousGuid] = nil\r\n end\r\n previousIndex = index\r\n end\r\n\r\n if theList[selectedGuid] == nil then\r\n self.editButton({index=index, color=color})\r\n --Adding pos/rot to memory table\r\n local pos, rot = obj.getPosition(), obj.getRotation()\r\n --I need to add it like this or it won't save due to indexing issue\r\n theList[obj.getGUID()] = {\r\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n lock=obj.getLock()\r\n }\r\n obj.highlightOn({0,1,0})\r\n else\r\n color = {0.75,0.25,0.25,0.6}\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.editButton({index=index, color=color})\r\n theList[obj.getGUID()] = nil\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Cancels selection process\r\nfunction buttonClick_cancel()\r\n memoryList = memoryListBackup\r\n moveList = {}\r\n self.clearButtons()\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n createMemoryActionButtons()\r\n end\r\n removeAllHighlights()\r\n broadcastToAll(\"Selection Canceled\", {1,1,1})\r\n moveGuid = nil\r\nend\r\n\r\n--Saves selections\r\nfunction buttonClick_submit()\r\n fresh = false\r\n if next(moveList) ~= nil then\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n end\r\n if memoryListBackup[moveGuid] == nil then\r\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\r\n else\r\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n updateMemoryWithMoves()\r\n updateSave()\r\n buttonClick_place()\r\n end\r\n elseif next(memoryList) == nil and moveGuid == nil then\r\n memoryList = memoryListBackup\r\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\r\n end\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\n moveGuid = nil\r\nend\r\n\r\nfunction combineTables(first_table, second_table)\r\n for k,v in pairs(second_table) do first_table[k] = v end\r\nend\r\n\r\nfunction buttonClick_add()\r\n fresh = false\r\n combineTables(memoryList, memoryListBackup)\r\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_remove()\r\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n memoryListBackup[guid] = nil\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_setNew()\r\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\r\n self.clearButtons()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for _, obj in ipairs(getAllObjects()) do\r\n guid = obj.guid\r\n if memoryListBackup[guid] ~= nil then\r\n count = count + 1\r\n memoryListBackup[guid].pos = obj.getPosition()\r\n memoryListBackup[guid].rot = obj.getRotation()\r\n memoryListBackup[guid].lock = obj.getLock()\r\n end\r\n end\r\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\n--Resets bag to starting status\r\nfunction buttonClick_reset()\r\n fresh = true\r\n memoryList = {}\r\n self.clearButtons()\r\n createSetupButton()\r\n removeAllHighlights()\r\n broadcastToAll(\"Tool Reset\", {1,1,1})\r\n updateSave()\r\nend\r\n\r\n\r\n--After Setup\r\n\r\n\r\n--Creates recall and place buttons\r\nfunction createMemoryActionButtons()\r\n self.createButton({\r\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\r\n position={0.7,1,2}, rotation={0,0,0}, height=280, width=600,\r\n font_size=200, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\r\n position={-0.7,1,2}, rotation={0,0,0}, height=280, width=650,\r\n font_size=200, color={0,0,0}, font_color={1,1,1}\r\n })\r\n self.createButton({\r\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\r\n position={0,1,-2}, rotation={0,0,0}, height=240, width=500,\r\n font_size=150, color={0,0,0}, font_color={1,1,1}\r\n })\r\n\r\n--- self.createButton({\r\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\r\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\r\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\r\n--- })\r\nend\r\n\r\n--Sends objects from bag/table to their saved position/rotation\r\nfunction buttonClick_place()\r\n local bagObjList = self.getObjects()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n --If obj is out on the table, move it to the saved pos/rot\r\n if obj ~= nil then\r\n obj.setPositionSmooth(entry.pos)\r\n obj.setRotationSmooth(entry.rot)\r\n obj.setLock(entry.lock)\r\n else\r\n --If obj is inside of the bag\r\n for _, bagObj in ipairs(bagObjList) do\r\n if bagObj.guid == guid then\r\n local item = self.takeObject({\r\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\r\n })\r\n item.setLock(entry.lock)\r\n break\r\n end\r\n end\r\n end\r\n end\r\n broadcastToAll(\"Objects Placed\", {1,1,1})\r\nend\r\n\r\n--Recalls objects to bag from table\r\nfunction buttonClick_recall()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then self.putObject(obj) end\r\n end\r\n broadcastToAll(\"Objects Recalled\", {1,1,1})\r\nend\r\n\r\n\r\n--Utility functions\r\n\r\n\r\n--Find delta (difference) between 2 x/y/z coordinates\r\nfunction findOffsetDistance(p1, p2, obj)\r\n local yOffset = 0\r\n if obj ~= nil then\r\n local bounds = obj.getBounds()\r\n yOffset = (bounds.size.y - bounds.offset.y)\r\n end\r\n local deltaPos = {}\r\n deltaPos.x = (p2.x-p1.x)\r\n deltaPos.y = (p2.y-p1.y) + yOffset\r\n deltaPos.z = (p2.z-p1.z)\r\n return deltaPos\r\nend\r\n\r\n--Used to rotate a set of coordinates by an angle\r\nfunction rotateLocalCoordinates(desiredPos, obj)\r\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\r\n local angle = math.rad(objRot.y)\r\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\r\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\r\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\nfunction rotateMyCoordinates(desiredPos, obj)\r\n\tlocal angle = math.rad(obj.getRotation().y)\r\n local x = desiredPos.x * math.sin(angle)\r\n\tlocal z = desiredPos.z * math.cos(angle)\r\n return {x=x, y=desiredPos.y, z=z}\r\nend\r\n\r\n--Coroutine delay, in seconds\r\nfunction wait(time)\r\n local start = os.time()\r\n repeat coroutine.yield(0) until os.time() \u003e start + time\r\nend\r\n\r\n--Duplicates a table (needed to prevent it making reference to the same objects)\r\nfunction duplicateTable(oldTable)\r\n local newTable = {}\r\n for k, v in pairs(oldTable) do\r\n newTable[k] = v\r\n end\r\n return newTable\r\nend\r\n\r\n--Moves scripted highlight from all objects\r\nfunction removeAllHighlights()\r\n for _, obj in ipairs(getAllObjects()) do\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Round number (num) to the Nth decimal (dec)\r\nfunction round(num, dec)\r\n local mult = 10^(dec or 0)\r\n return math.floor(num * mult + 0.5) / mult\r\nend\r", - "LuaScriptState": "{\"ml\":{\"77a5f9\":{\"lock\":false,\"pos\":{\"x\":-9,\"y\":1.4815,\"z\":-66},\"rot\":{\"x\":0,\"y\":270,\"z\":0}},\"9f6801\":{\"lock\":false,\"pos\":{\"x\":-9,\"y\":1.4815,\"z\":-76},\"rot\":{\"x\":0,\"y\":270,\"z\":0}}}}\r", + "LuaScript": "-- Utility memory bag by Directsun\n-- Version 2.5.2\n-- Fork of Memory Bag 2.0 by MrStump\n\nfunction updateSave()\n local data_to_save = {[\"ml\"]=memoryList}\n saved_data = JSON.encode(data_to_save)\n self.script_state = saved_data\nend\n\nfunction combineMemoryFromBagsWithin()\n local bagObjList = self.getObjects()\n for _, bagObj in ipairs(bagObjList) do\n local data = bagObj.lua_script_state\n if data ~= nil then\n local j = JSON.decode(data)\n if j ~= nil and j.ml ~= nil then\n for guid, entry in pairs(j.ml) do\n memoryList[guid] = entry\n end\n end\n end\n end\nend\n\nfunction updateMemoryWithMoves()\n memoryList = memoryListBackup\n --get the first transposed object's coordinates\n local obj = getObjectFromGUID(moveGuid)\n\n -- p1 is where needs to go, p2 is where it was\n local refObjPos = memoryList[moveGuid].pos\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\n local movedRotation = obj.getRotation()\n for guid, entry in pairs(memoryList) do\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\n -- memoryList[guid].rot.x = movedRotation.x\n -- memoryList[guid].rot.y = movedRotation.y\n -- memoryList[guid].rot.z = movedRotation.z\n end\n\n --theList[obj.getGUID()] = {\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n -- lock=obj.getLock()\n --}\n moveList = {}\nend\n\nfunction onload(saved_data)\n fresh = true\n if saved_data ~= \"\" then\n local loaded_data = JSON.decode(saved_data)\n --Set up information off of loaded_data\n memoryList = loaded_data.ml\n else\n --Set up information for if there is no saved saved data\n memoryList = {}\n end\n\n moveList = {}\n moveGuid = nil\n\n if next(memoryList) == nil then\n createSetupButton()\n else\n fresh = false\n createMemoryActionButtons()\n end\nend\n\n\n--Beginning Setup\n\n\n--Make setup button\nfunction createSetupButton()\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,\n font_size=350, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n--Triggered by Transpose button\nfunction buttonClick_transpose()\n moveGuid = nil\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", {0.75, 0.75, 1})\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n moveList = {}\n self.clearButtons()\n createButtonsOnAllObjects(true)\n createSetupActionButtons(true)\nend\n\n--Triggered by setup button,\nfunction buttonClick_setup()\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n self.clearButtons()\n createButtonsOnAllObjects(false)\n createSetupActionButtons(false)\nend\n\nfunction getAllObjectsInMemory()\n local objTable = {}\n local curObj = {}\n\n for guid in pairs(memoryListBackup) do\n curObj = getObjectFromGUID(guid)\n table.insert(objTable, curObj)\n end\n\n return objTable\n -- return getAllObjects()\nend\n\n--Creates selection buttons on objects\nfunction createButtonsOnAllObjects(move)\n local howManyButtons = 0\n\n local objsToHaveButtons = {}\n if move == true then\n objsToHaveButtons = getAllObjectsInMemory()\n else\n objsToHaveButtons = getAllObjects()\n end\n\n for _, obj in ipairs(objsToHaveButtons) do\n if obj ~= self then\n local dummyIndex = howManyButtons\n --On a normal bag, the button positions aren't the same size as the bag.\n globalScaleFactor = 1 * 1/self.getScale().x\n --Super sweet math to set button positions\n local selfPos = self.getPosition()\n local objPos = obj.getPosition()\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\n local objPos = rotateLocalCoordinates(deltaPos, self)\n objPos.x = -objPos.x * globalScaleFactor\n objPos.y = objPos.y * globalScaleFactor + 4\n objPos.z = objPos.z * globalScaleFactor\n --Offset rotation of bag\n local rot = self.getRotation()\n rot.y = -rot.y + 180\n --Create function\n local funcName = \"selectButton_\" .. howManyButtons\n local func = function() buttonClick_selection(dummyIndex, obj, move) end\n local color = {0.75,0.25,0.25,0.6}\n local colorMove = {0,0,1,0.6}\n if move == true then\n color = colorMove\n end\n self.setVar(funcName, func)\n self.createButton({\n click_function=funcName, function_owner=self,\n position=objPos, rotation=rot, height=1000, width=1000,\n color=color,\n })\n howManyButtons = howManyButtons + 1\n end\n end\nend\n\n--Creates submit and cancel buttons\nfunction createSetupActionButtons(move)\n self.createButton({\n label=\"Cancel\", click_function=\"buttonClick_cancel\", function_owner=self,\n position={0,1,-2}, rotation={0,0,0}, height=240, width=550,\n font_size=150, color={0,0,0}, font_color={1,1,1}\n })\n\n self.createButton({\n label=\"Submit\", click_function=\"buttonClick_submit\", function_owner=self,\n position={-1.2,1,-2}, rotation={0,0,0}, height=240, width=570,\n font_size=150, color={0,0,0}, font_color={1,1,1}\n })\n\n if move == false then\n self.createButton({\n label=\"Add\", click_function=\"buttonClick_add\", function_owner=self,\n position={-1.2,1,2}, rotation={0,0,0}, height=240, width=550,\n font_size=150, color={0,0,0}, font_color={0.25,1,0.25}\n })\n\n if fresh == false then\n self.createButton({\n label=\"Set New\", click_function=\"buttonClick_setNew\", function_owner=self,\n position={0,1,2}, rotation={0,0,0}, height=240, width=600,\n font_size=150, color={0,0,0}, font_color={0.75,0.75,1}\n })\n self.createButton({\n label=\"Remove\", click_function=\"buttonClick_remove\", function_owner=self,\n position={1.3,1,2}, rotation={0,0,0}, height=240, width=600,\n font_size=150, color={0,0,0}, font_color={1,0.25,0.25}\n })\n end\n end\n\n self.createButton({\n label=\"Reset\", click_function=\"buttonClick_reset\", function_owner=self,\n position={1.2,1,-2}, rotation={0,0,0}, height=240, width=500,\n font_size=150, color={0,0,0}, font_color={1,1,1}\n })\nend\n\n\n--During Setup\n\n\n--Checks or unchecks buttons\nfunction buttonClick_selection(index, obj, move)\n local colorMove = {0,0,1,0.6}\n local color = {0,1,0,0.6}\n\n previousGuid = selectedGuid\n selectedGuid = obj.getGUID()\n\n theList = memoryList\n if move == true then\n theList = moveList\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\n local prevObj = getObjectFromGUID(previousGuid)\n prevObj.highlightOff()\n self.editButton({index=previousIndex, color=colorMove})\n theList[previousGuid] = nil\n end\n previousIndex = index\n end\n\n if theList[selectedGuid] == nil then\n self.editButton({index=index, color=color})\n --Adding pos/rot to memory table\n local pos, rot = obj.getPosition(), obj.getRotation()\n --I need to add it like this or it won't save due to indexing issue\n theList[obj.getGUID()] = {\n pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n lock=obj.getLock()\n }\n obj.highlightOn({0,1,0})\n else\n color = {0.75,0.25,0.25,0.6}\n if move == true then\n color = colorMove\n end\n self.editButton({index=index, color=color})\n theList[obj.getGUID()] = nil\n obj.highlightOff()\n end\nend\n\n--Cancels selection process\nfunction buttonClick_cancel()\n memoryList = memoryListBackup\n moveList = {}\n self.clearButtons()\n if next(memoryList) == nil then\n createSetupButton()\n else\n createMemoryActionButtons()\n end\n removeAllHighlights()\n broadcastToAll(\"Selection Canceled\", {1,1,1})\n moveGuid = nil\nend\n\n--Saves selections\nfunction buttonClick_submit()\n fresh = false\n if next(moveList) ~= nil then\n for guid in pairs(moveList) do\n moveGuid = guid\n end\n if memoryListBackup[moveGuid] == nil then\n broadcastToAll(\"Item selected for moving is not already in memory\", {1, 0.25, 0.25})\n else\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(moveList) do\n moveGuid = guid\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n updateMemoryWithMoves()\n updateSave()\n buttonClick_place()\n end\n elseif next(memoryList) == nil and moveGuid == nil then\n memoryList = memoryListBackup\n broadcastToAll(\"No selections made.\", {0.75, 0.25, 0.25})\n end\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\n moveGuid = nil\nend\n\nfunction combineTables(first_table, second_table)\n for k,v in pairs(second_table) do first_table[k] = v end\nend\n\nfunction buttonClick_add()\n fresh = false\n combineTables(memoryList, memoryListBackup)\n broadcastToAll(\"Adding internal bags and selections to existing memory\", {0.25, 0.75, 0.25})\n combineMemoryFromBagsWithin()\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n updateSave()\nend\n\nfunction buttonClick_remove()\n broadcastToAll(\"Removing Selected Entries From Memory\", {1.0, 0.25, 0.25})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n memoryListBackup[guid] = nil\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count..\" Objects Removed\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\nfunction buttonClick_setNew()\n broadcastToAll(\"Setting new position relative to items in memory\", {0.75, 0.75, 1})\n self.clearButtons()\n createMemoryActionButtons()\n local count = 0\n for _, obj in ipairs(getAllObjects()) do\n guid = obj.guid\n if memoryListBackup[guid] ~= nil then\n count = count + 1\n memoryListBackup[guid].pos = obj.getPosition()\n memoryListBackup[guid].rot = obj.getRotation()\n memoryListBackup[guid].lock = obj.getLock()\n end\n end\n broadcastToAll(count..\" Objects Saved\", {1,1,1})\n memoryList = memoryListBackup\n updateSave()\nend\n\n--Resets bag to starting status\nfunction buttonClick_reset()\n fresh = true\n memoryList = {}\n self.clearButtons()\n createSetupButton()\n removeAllHighlights()\n broadcastToAll(\"Tool Reset\", {1,1,1})\n updateSave()\nend\n\n\n--After Setup\n\n\n--Creates recall and place buttons\nfunction createMemoryActionButtons()\n self.createButton({\n label=\"Place\", click_function=\"buttonClick_place\", function_owner=self,\n position={0.7,1,2}, rotation={0,0,0}, height=280, width=600,\n font_size=200, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Recall\", click_function=\"buttonClick_recall\", function_owner=self,\n position={-0.7,1,2}, rotation={0,0,0}, height=280, width=650,\n font_size=200, color={0,0,0}, font_color={1,1,1}\n })\n self.createButton({\n label=\"Setup\", click_function=\"buttonClick_setup\", function_owner=self,\n position={0,1,-2}, rotation={0,0,0}, height=240, width=500,\n font_size=150, color={0,0,0}, font_color={1,1,1}\n })\n\n--- self.createButton({\n--- label=\"Move\", click_function=\"buttonClick_transpose\", function_owner=self,\n--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,\n--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}\n--- })\nend\n\n--Sends objects from bag/table to their saved position/rotation\nfunction buttonClick_place()\n local bagObjList = self.getObjects()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n --If obj is out on the table, move it to the saved pos/rot\n if obj ~= nil then\n obj.setPositionSmooth(entry.pos)\n obj.setRotationSmooth(entry.rot)\n obj.setLock(entry.lock)\n else\n --If obj is inside of the bag\n for _, bagObj in ipairs(bagObjList) do\n if bagObj.guid == guid then\n local item = self.takeObject({\n guid=guid, position=entry.pos, rotation=entry.rot, smooth=false\n })\n item.setLock(entry.lock)\n break\n end\n end\n end\n end\n broadcastToAll(\"Objects Placed\", {1,1,1})\nend\n\n--Recalls objects to bag from table\nfunction buttonClick_recall()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then self.putObject(obj) end\n end\n broadcastToAll(\"Objects Recalled\", {1,1,1})\nend\n\n\n--Utility functions\n\n\n--Find delta (difference) between 2 x/y/z coordinates\nfunction findOffsetDistance(p1, p2, obj)\n local yOffset = 0\n if obj ~= nil then\n local bounds = obj.getBounds()\n yOffset = (bounds.size.y - bounds.offset.y)\n end\n local deltaPos = {}\n deltaPos.x = (p2.x-p1.x)\n deltaPos.y = (p2.y-p1.y) + yOffset\n deltaPos.z = (p2.z-p1.z)\n return deltaPos\nend\n\n--Used to rotate a set of coordinates by an angle\nfunction rotateLocalCoordinates(desiredPos, obj)\n\tlocal objPos, objRot = obj.getPosition(), obj.getRotation()\n local angle = math.rad(objRot.y)\n\tlocal x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\n\tlocal z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\n\t--return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\n return {x=x, y=desiredPos.y, z=z}\nend\n\nfunction rotateMyCoordinates(desiredPos, obj)\n\tlocal angle = math.rad(obj.getRotation().y)\n local x = desiredPos.x * math.sin(angle)\n\tlocal z = desiredPos.z * math.cos(angle)\n return {x=x, y=desiredPos.y, z=z}\nend\n\n--Coroutine delay, in seconds\nfunction wait(time)\n local start = os.time()\n repeat coroutine.yield(0) until os.time() \u003e start + time\nend\n\n--Duplicates a table (needed to prevent it making reference to the same objects)\nfunction duplicateTable(oldTable)\n local newTable = {}\n for k, v in pairs(oldTable) do\n newTable[k] = v\n end\n return newTable\nend\n\n--Moves scripted highlight from all objects\nfunction removeAllHighlights()\n for _, obj in ipairs(getAllObjects()) do\n obj.highlightOff()\n end\nend\n\n--Round number (num) to the Nth decimal (dec)\nfunction round(num, dec)\n local mult = 10^(dec or 0)\n return math.floor(num * mult + 0.5) / mult\nend", + "LuaScriptState": "{\"ml\":{\"77a5f9\":{\"lock\":false,\"pos\":{\"x\":-9,\"y\":1.4815,\"z\":-66},\"rot\":{\"x\":0,\"y\":270,\"z\":0}},\"9f6801\":{\"lock\":false,\"pos\":{\"x\":-9,\"y\":1.4815,\"z\":-76},\"rot\":{\"x\":0,\"y\":270,\"z\":0}}}}", "MaterialIndex": -1, "MeasureMovement": false, "MeshIndex": -1, @@ -23473,7 +22333,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -23531,7 +22391,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -23647,7 +22507,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -23821,7 +22681,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -24517,7 +23377,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -24951,7 +23811,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -25531,7 +24391,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -25647,7 +24507,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/Tarotcard\")\nend)\n__bundle_register(\"playercards/Tarotcard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- context menu to manually fix rotation\nfunction onLoad()\n self.addContextMenuItem(\"Rotate Preview\", rotatePreview)\n self.addContextMenuItem(\"Rotate Card+Preview\", rotateSelfAndPreview)\nend\n\n-- rotates the alt_view_angle\nfunction rotatePreview()\n local angle = self.alt_view_angle\n if angle.y == 0 then\n angle.y = 180\n else\n angle.y = 0\n end\n self.alt_view_angle = angle\nend\n\n-- rotates this card and the preview\nfunction rotateSelfAndPreview()\n self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))\n rotatePreview()\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -45284,7 +44144,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- edit the \"tokenData\" table to change the preset difficulties\r\n-- list of valid ids: 'p1', '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8',\r\n-- 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue', 'bless', 'curse', 'frost'\r\n\r\nlocal tokenData = {\r\n Easy = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'red', 'blue' },\r\n Standard = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'red', 'blue' },\r\n Hard = { '0', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'red', 'blue' },\r\n Expert = { '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm4', 'm5', 'm6', 'm8', 'skull', 'skull', 'cultist', 'red', 'blue' }\r\n}\r\n\r\n-- create buttons on startup\r\nfunction onLoad()\r\n local z_offset = -0.15\r\n for difficulty, _ in pairs(tokenData) do\r\n local clickFunction = difficulty:lower() .. \"Click\"\r\n self.setVar(clickFunction, function() clickFun(difficulty) end)\r\n\r\n self.createButton({\r\n label = difficulty,\r\n function_owner = self,\r\n click_function = clickFunction,\r\n position = { 0, 0.1, z_offset },\r\n rotation = { 0, 0, 0 },\r\n scale = { 0.47, 1, 0.47 },\r\n height = 200,\r\n width = 1150,\r\n font_size = 100,\r\n color = { 0.87, 0.8, 0.70 },\r\n font_color = { 0, 0, 0 }\r\n })\r\n z_offset = z_offset + 0.20\r\n end\r\nend\r\n\r\nfunction clickFun(difficulty)\r\n Global.call(\"setChaosBagState\", tokenData[difficulty])\r\nend\r", + "LuaScript": "-- edit the \"tokenData\" table to change the preset difficulties\n-- list of valid ids: 'p1', '0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8',\n-- 'skull', 'cultist', 'tablet', 'elder', 'red', 'blue', 'bless', 'curse', 'frost'\n\nlocal tokenData = {\n Easy = { 'p1', 'p1', '0', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'skull', 'skull', 'cultist', 'red', 'blue' },\n Standard = { 'p1', '0', '0', 'm1', 'm1', 'm1', 'm2', 'm2', 'm3', 'm4', 'skull', 'skull', 'cultist', 'red', 'blue' },\n Hard = { '0', '0', '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm5', 'skull', 'skull', 'cultist', 'red', 'blue' },\n Expert = { '0', 'm1', 'm1', 'm2', 'm2', 'm3', 'm3', 'm4', 'm4', 'm5', 'm6', 'm8', 'skull', 'skull', 'cultist', 'red', 'blue' }\n}\n\n-- create buttons on startup\nfunction onLoad()\n local z_offset = -0.15\n for difficulty, _ in pairs(tokenData) do\n local clickFunction = difficulty:lower() .. \"Click\"\n self.setVar(clickFunction, function() clickFun(difficulty) end)\n\n self.createButton({\n label = difficulty,\n function_owner = self,\n click_function = clickFunction,\n position = { 0, 0.1, z_offset },\n rotation = { 0, 0, 0 },\n scale = { 0.47, 1, 0.47 },\n height = 200,\n width = 1150,\n font_size = 100,\n color = { 0.87, 0.8, 0.70 },\n font_color = { 0, 0, 0 }\n })\n z_offset = z_offset + 0.20\n end\nend\n\nfunction clickFun(difficulty)\n Global.call(\"setChaosBagState\", tokenData[difficulty])\nend", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -48453,7 +47313,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "function onLoad()\r\n -- Add a button to the object\r\n local params = {}\r\n params.click_function = 'toPhaseTwo'\r\n params.function_owner = self\r\n params.tooltip = '1. Mythos Phase\\n\\n 1.1 Round begins. Mythos phase begins.\\n\\n 1.2 Place 1 doom on the current agenda.\\n\\n 1.3 Check doom threshold.\\n\\n 1.4 Each investigator draws 1\\n encounter card.\\n\\n\u003e PLAYER WINDOW \u003c\\n\\n 1.5 Mythos phase ends.'\r\n params.width = 600\r\n params.height = 600\r\n self.createButton(params)\r\nend\r\n\r\nfunction toPhaseTwo()\r\n self.setState(2)\r\nend\r", + "LuaScript": "function onLoad()\n -- Add a button to the object\n local params = {}\n params.click_function = 'toPhaseTwo'\n params.function_owner = self\n params.tooltip = '1. Mythos Phase\\n\\n 1.1 Round begins. Mythos phase begins.\\n\\n 1.2 Place 1 doom on the current agenda.\\n\\n 1.3 Check doom threshold.\\n\\n 1.4 Each investigator draws 1\\n encounter card.\\n\\n\u003e PLAYER WINDOW \u003c\\n\\n 1.5 Mythos phase ends.'\n params.width = 600\n params.height = 600\n self.createButton(params)\nend\n\nfunction toPhaseTwo()\n self.setState(2)\nend", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -48749,7 +47609,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/UnderworldMarketHelper\")\nend)\n__bundle_register(\"accessories/UnderworldMarketHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onload(saved_data)\n revealCardPositions = {\n Vector(3.5, 0.25, 0),\n Vector(-3.5, 0.25, 0)\n }\n\n revealCardPositionsSwap = {\n Vector(-3.5, 0.25, 0),\n Vector(3.5, 0.25, 0)\n }\n\n self.createButton({\n label = 'Underworld Market\\nHelper',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 145,\n font_color = {1,1,1}\n })\n\n hiddenCards = 10\n hiddenCardLabel = '-----'\n\n isSetup = false\n movingCards = false\n\n self.addContextMenuItem('Reset helper', resetHelper)\n\n if saved_data != '' then\n local loaded_data = JSON.decode(saved_data)\n hiddenCards = loaded_data.saved_hiddenCards\n\n isSetup = true\n refreshButtons()\n end\nend\n\nfunction onSave()\n return JSON.encode({\n saved_hiddenCards = hiddenCards\n })\nend\n\nfunction onObjectEnterContainer(container, object)\n if container ~= self then return end\n\n if isSetup and object.tag == \"Card\" then\n refreshButtons()\n end\n\n if object.tag == \"Deck\" then\n if validateDeck(object) then\n takeDeckOut(object.getGUID(), self.getPosition() + Vector(0, 0.1, 0))\n refreshButtons()\n \n isSetup = true\n end\n elseif object.tag ~= \"Card\" then\n broadcastToAll(\"The 'Underworld Market Helper' is meant to be used for cards.\", \"White\")\n end\nend\n\nfunction onObjectLeaveContainer(container, object)\n if container ~= self then return end\n \n if isSetup then\n refreshButtons()\n end\nend\n\nfunction validateDeck(deck)\n if deck.getQuantity() ~= 10 then\n print('Underworld Market Helper: Deck must include exactly 10 cards.')\n return false\n end\n\n local illicitCount = 0\n\n for _, card in ipairs(deck.getObjects()) do\n decodedGMNotes = JSON.decode(card.gm_notes)\n\n if decodedGMNotes ~= nil and string.find(decodedGMNotes.traits, \"Illicit\", 1, true) then\n illicitCount = illicitCount + 1\n end\n end\n\n if illicitCount ~= 10 then\n print('Underworld Market Helper: Deck must include 10 Illicit cards.')\n return false\n end\n\n return true\nend\n\nfunction refreshButtons()\n local cardsList = ''\n\n for i, card in ipairs(self.getObjects()) do\n local localCardName = card.name\n\n if i \u003c= hiddenCards then\n localCardName = hiddenCardLabel\n end\n\n cardsList = cardsList .. localCardName .. '\\n'\n end\n\n self.clearButtons()\n\n self.createButton({\n label = 'Market Deck:',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 150,\n font_color = {1,1,1}\n })\n\n self.createButton({\n label = cardsList,\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,0.15},\n height = 0,\n width = 0,\n font_size = 115,\n font_color = {1,1,1}\n })\n\n self.createButton({\n click_function = 'revealFirstTwoCards',\n function_owner = self,\n label = 'Reveal',\n position = {-0.85,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\n\n self.createButton({\n click_function = 'swap',\n function_owner = self,\n label = 'Swap',\n position = {0,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\n\n self.createButton({\n click_function = 'finish',\n function_owner = self,\n label = 'Finish',\n position = {0.85,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\nend\n\nfunction takeDeckOut(guid, pos)\n local deck = self.takeObject({ guid = guid, position = pos, smooth = false })\n\n for i = 1, #deck.getObjects() do\n self.putObject(deck.takeObject({ position = pos + Vector(0, 0.1 * i, 0), smooth = false }))\n end\n\n self.shuffle()\nend\n\nfunction getRevealedCards()\n local revealedCards = {}\n\n for _, pos in ipairs(revealCardPositions) do\n local hitList = Physics.cast({\n origin = self.positionToWorld(pos) + Vector(0, 0.25, 0),\n direction = {0,-1,0},\n type = 1,\n max_distance = 2\n })\n\n for _, hit in ipairs(hitList) do\n if hit.hit_object != self and hit.hit_object.tag == \"Card\" then\n table.insert(revealedCards, hit.hit_object.getGUID())\n end\n end\n end\n\n return revealedCards\nend\n\nfunction revealFirstTwoCards()\n if movingCards or #getRevealedCards() \u003e 0 then return end\n\n for i, card in ipairs(self.getObjects()) do\n movingCards = true\n\n self.takeObject({\n index = 0,\n rotation = self.getRotation(),\n position = self.positionToWorld(revealCardPositions[i]),\n callback_function = function(obj)\n obj.resting = true\n movingCards = false\n end\n })\n\n hiddenCards = hiddenCards - 1\n\n if i == 2 or #self.getObjects() == 0 then\n break\n end\n end\n\n refreshButtons()\nend\n\nfunction swap()\n if movingCards then return end\n\n local revealedCards = getRevealedCards()\n\n if #revealedCards == 2 then\n for i, revealedCardGUID in ipairs(revealedCards) do\n local revealedCard = getObjectFromGUID(revealedCardGUID)\n\n revealedCard.setPositionSmooth(self.positionToWorld(revealCardPositionsSwap[i]), false, false)\n end\n end\nend\n\nfunction finish()\n if movingCards then return end\n\n local revealedCards = getRevealedCards()\n\n movingCards = true\n\n for i, revealedCardGUID in ipairs(revealedCards) do\n self.putObject(getObjectFromGUID(revealedCardGUID))\n end\n\n Wait.time(\n function()\n movingCards = false\n end,\n 0.75)\nend\n\nfunction resetHelper()\n for i, card in ipairs(self.getObjects()) do\n self.takeObject({\n index = 0,\n smooth = false,\n rotation = self.getRotation(),\n position = self.positionToWorld(revealCardPositions[2])\n })\n end\n\n self.clearButtons()\n\n self.createButton({\n label = 'Underworld Market\\nHelper',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 145,\n font_color = {1,1,1}\n })\n\n hiddenCards = 10\n isSetup = false\n movingCards = false\n\n self.reset()\n\n print('Underworld Market Helper: Helper has been reset.')\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/UnderworldMarketHelper\")\nend)\n__bundle_register(\"accessories/UnderworldMarketHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\n\nfunction onload(savedData)\n revealCardPositions = {\n Vector(3.5, 0.25, 0),\n Vector(-3.5, 0.25, 0)\n }\n\n revealCardPositionsSwap = {\n Vector(-3.5, 0.25, 0),\n Vector(3.5, 0.25, 0)\n }\n\n self.createButton({\n label = 'Underworld Market\\nHelper',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 145,\n font_color = {1,1,1}\n })\n\n hiddenCards = 10\n hiddenCardLabel = '-----'\n\n isSetup = false\n movingCards = false\n\n self.addContextMenuItem('Reset helper', resetHelper)\n\n if savedData ~= '' then\n local loaded_data = JSON.decode(savedData)\n hiddenCards = loaded_data.saved_hiddenCards\n\n isSetup = true\n refreshButtons()\n end\nend\n\nfunction onSave()\n return JSON.encode({\n saved_hiddenCards = hiddenCards\n })\nend\n\nfunction onObjectEnterContainer(container, object)\n if container ~= self then return end\n\n if isSetup and object.tag == \"Card\" then\n refreshButtons()\n end\n\n if object.tag == \"Deck\" then\n if validateDeck(object) then\n takeDeckOut(object.getGUID(), self.getPosition() + Vector(0, 0.1, 0))\n refreshButtons()\n \n isSetup = true\n end\n elseif object.tag ~= \"Card\" then\n broadcastToAll(\"The 'Underworld Market Helper' is meant to be used for cards.\", \"White\")\n end\nend\n\nfunction onObjectLeaveContainer(container, object)\n if container ~= self then return end\n \n if isSetup then\n refreshButtons()\n end\nend\n\nfunction validateDeck(deck)\n if deck.getQuantity() ~= 10 then\n print('Underworld Market Helper: Deck must include exactly 10 cards.')\n return false\n end\n\n local illicitCount = 0\n\n for _, card in ipairs(deck.getObjects()) do\n decodedGMNotes = JSON.decode(card.gm_notes)\n\n if decodedGMNotes ~= nil and string.find(decodedGMNotes.traits, \"Illicit\", 1, true) then\n illicitCount = illicitCount + 1\n end\n end\n\n if illicitCount ~= 10 then\n print('Underworld Market Helper: Deck must include 10 Illicit cards.')\n return false\n end\n\n return true\nend\n\nfunction refreshButtons()\n local cardsList = ''\n\n for i, card in ipairs(self.getObjects()) do\n local localCardName = card.name\n\n if i \u003c= hiddenCards then\n localCardName = hiddenCardLabel\n end\n\n cardsList = cardsList .. localCardName .. '\\n'\n end\n\n self.clearButtons()\n\n self.createButton({\n label = 'Market Deck:',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 150,\n font_color = {1,1,1}\n })\n\n self.createButton({\n label = cardsList,\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,0.15},\n height = 0,\n width = 0,\n font_size = 115,\n font_color = {1,1,1}\n })\n\n self.createButton({\n click_function = 'revealFirstTwoCards',\n function_owner = self,\n label = 'Reveal',\n position = {-0.85,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\n\n self.createButton({\n click_function = 'swap',\n function_owner = self,\n label = 'Swap',\n position = {0,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\n\n self.createButton({\n click_function = 'finish',\n function_owner = self,\n label = 'Finish',\n position = {0.85,0,1.6},\n width = 375,\n height = 175,\n font_size = 90\n })\nend\n\nfunction takeDeckOut(guid, pos)\n local deck = self.takeObject({ guid = guid, position = pos, smooth = false })\n\n for i = 1, #deck.getObjects() do\n self.putObject(deck.takeObject({ position = pos + Vector(0, 0.1 * i, 0), smooth = false }))\n end\n\n self.shuffle()\nend\n\nfunction getRevealedCards()\n local revealedCards = {}\n\n for _, pos in ipairs(revealCardPositions) do\n for _, obj in ipairs(searchLib.atPosition(self.positionToWorld(pos), \"isCard\")) do\n table.insert(revealedCards, obj.getGUID())\n end\n end\n\n return revealedCards\nend\n\nfunction revealFirstTwoCards()\n if movingCards or #getRevealedCards() \u003e 0 then return end\n\n for i, card in ipairs(self.getObjects()) do\n movingCards = true\n\n self.takeObject({\n index = 0,\n rotation = self.getRotation(),\n position = self.positionToWorld(revealCardPositions[i]),\n callback_function = function(obj)\n obj.resting = true\n movingCards = false\n end\n })\n\n hiddenCards = hiddenCards - 1\n\n if i == 2 or #self.getObjects() == 0 then\n break\n end\n end\n\n refreshButtons()\nend\n\nfunction swap()\n if movingCards then return end\n\n local revealedCards = getRevealedCards()\n\n if #revealedCards == 2 then\n for i, revealedCardGUID in ipairs(revealedCards) do\n local revealedCard = getObjectFromGUID(revealedCardGUID)\n\n revealedCard.setPositionSmooth(self.positionToWorld(revealCardPositionsSwap[i]), false, false)\n end\n end\nend\n\nfunction finish()\n if movingCards then return end\n\n local revealedCards = getRevealedCards()\n\n movingCards = true\n\n for i, revealedCardGUID in ipairs(revealedCards) do\n self.putObject(getObjectFromGUID(revealedCardGUID))\n end\n\n Wait.time(\n function()\n movingCards = false\n end,\n 0.75)\nend\n\nfunction resetHelper()\n for i, card in ipairs(self.getObjects()) do\n self.takeObject({\n index = 0,\n smooth = false,\n rotation = self.getRotation(),\n position = self.positionToWorld(revealCardPositions[2])\n })\n end\n\n self.clearButtons()\n\n self.createButton({\n label = 'Underworld Market\\nHelper',\n click_function = \"none\",\n function_owner = self,\n position = {0,-0.1,-1.6},\n height = 0,\n width = 0,\n font_size = 145,\n font_color = {1,1,1}\n })\n\n hiddenCards = 10\n isSetup = false\n movingCards = false\n\n self.reset()\n\n print('Underworld Market Helper: Helper has been reset.')\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, @@ -48825,7 +47685,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/Subject5U-21Helper\")\nend)\n__bundle_register(\"accessories/Subject5U-21Helper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal classOrder = {\n \"Guardian\",\n \"Seeker\",\n \"Survivor\",\n \"Mystic\",\n \"Rogue\"\n}\n\nlocal bParam = {}\nbParam.width = 0\nbParam.height = 0\nbParam.function_owner = self\nbParam.click_function = \"none\"\nbParam.label = \"0\"\nbParam.position = {x = 0, y = 0.1, z = -0.7}\nbParam.scale = {x = 0.1, y = 0.1, z = 0.1}\nbParam.font_color = \"White\"\nbParam.font_size = 700\n\nfunction onLoad()\n self.createButton({\n width = 2750,\n height = 800,\n function_owner = self,\n click_function = \"updateDisplayButtons\",\n label = \"Update!\",\n tooltip = \"Count classes from cards on this tile\",\n position = {x = 0, y = 0.1, z = 0.875},\n scale = {x = 0.1, y = 0.1, z = 0.1},\n font_size = 500\n })\n createDisplayButtons()\nend\n\nfunction createDisplayButtons()\n local x_offset = 0.361\n bParam.position.x = -3 * x_offset\n for i = 1, 5 do\n bParam.position.x = bParam.position.x + x_offset\n self.createButton(bParam)\n end\nend\n\nfunction updateDisplayButtons(_, playerColor)\n local classCount = {\n Guardian = 0,\n Seeker = 0,\n Survivor = 0,\n Mystic = 0,\n Rogue = 0,\n uncounted = 0\n }\n\n -- loop through cards on this helper and count classes from metadata\n for _, notes in ipairs(getNotesFromCardsAndContainers()) do\n if notes.class then\n for str in string.gmatch(notes.class, \"([^|]+)\") do\n if not tonumber(classCount[str]) then\n str = \"uncounted\"\n end\n classCount[str] = classCount[str] + 1\n end\n end\n end\n\n -- edit button labels with index 1-5\n for i = 1, 5 do\n self.editButton({index = i, label = classCount[classOrder[i]]})\n end\n \n -- show message about uncounted cards\n if classCount.uncounted \u003e 0 then\n printToColor(\"Search included \" .. classCount.uncounted .. \" neutral/ununcounted card(s).\", playerColor, \"Orange\")\n end\nend\n\nfunction getNotesFromCardsAndContainers()\n local search = Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0,\n type = 3,\n size = self.getBounds().size:setAt(\"y\", 1),\n origin = self.getPosition() + Vector(0, 0.5, 0),\n })\n\n local notesList = {}\n for _, hit in ipairs(search) do\n local obj = hit.hit_object\n local notes = {}\n if obj.type == \"Card\" then\n notes = JSON.decode(obj.getGMNotes()) or {}\n table.insert(notesList, notes)\n elseif obj.type == \"Bag\" or obj.type == \"Deck\" then\n -- check if there are actually objects contained and loop through them\n local containedObjects = obj.getData().ContainedObjects\n if containedObjects then\n for _, deepObj in ipairs(containedObjects) do\n if deepObj.Name == \"Card\" or deepObj.Name == \"CardCustom\" then\n notes = JSON.decode(deepObj.GMNotes) or {}\n table.insert(notesList, notes)\n end\n end\n end\n end\n end\n return notesList\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/Subject5U-21Helper\")\nend)\n__bundle_register(\"accessories/Subject5U-21Helper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\n\nlocal classOrder = {\n \"Guardian\",\n \"Seeker\",\n \"Survivor\",\n \"Mystic\",\n \"Rogue\"\n}\n\nlocal bParam = {}\nbParam.width = 0\nbParam.height = 0\nbParam.function_owner = self\nbParam.click_function = \"none\"\nbParam.label = \"0\"\nbParam.position = {x = 0, y = 0.1, z = -0.7}\nbParam.scale = {x = 0.1, y = 0.1, z = 0.1}\nbParam.font_color = \"White\"\nbParam.font_size = 700\n\nfunction onLoad()\n self.createButton({\n width = 2750,\n height = 800,\n function_owner = self,\n click_function = \"updateDisplayButtons\",\n label = \"Update!\",\n tooltip = \"Count classes from cards on this tile\",\n position = {x = 0, y = 0.1, z = 0.875},\n scale = {x = 0.1, y = 0.1, z = 0.1},\n font_size = 500\n })\n createDisplayButtons()\nend\n\nfunction createDisplayButtons()\n local x_offset = 0.361\n bParam.position.x = -3 * x_offset\n for i = 1, 5 do\n bParam.position.x = bParam.position.x + x_offset\n self.createButton(bParam)\n end\nend\n\nfunction updateDisplayButtons(_, playerColor)\n local classCount = {\n Guardian = 0,\n Seeker = 0,\n Survivor = 0,\n Mystic = 0,\n Rogue = 0,\n uncounted = 0\n }\n\n -- loop through cards on this helper and count classes from metadata\n for _, notes in ipairs(getNotesFromCardsAndContainers()) do\n if notes.class then\n for str in string.gmatch(notes.class, \"([^|]+)\") do\n if not tonumber(classCount[str]) then\n str = \"uncounted\"\n end\n classCount[str] = classCount[str] + 1\n end\n end\n end\n\n -- edit button labels with index 1-5\n for i = 1, 5 do\n self.editButton({index = i, label = classCount[classOrder[i]]})\n end\n \n -- show message about uncounted cards\n if classCount.uncounted \u003e 0 then\n printToColor(\"Search included \" .. classCount.uncounted .. \" neutral/ununcounted card(s).\", playerColor, \"Orange\")\n end\nend\n\nfunction getNotesFromCardsAndContainers()\n local notesList = {}\n for _, obj in ipairs(searchLib.onObject(self)) do\n local notes = {}\n if obj.type == \"Card\" then\n notes = JSON.decode(obj.getGMNotes()) or {}\n table.insert(notesList, notes)\n elseif obj.type == \"Bag\" or obj.type == \"Deck\" then\n -- check if there are actually objects contained and loop through them\n local containedObjects = obj.getData().ContainedObjects\n if containedObjects then\n for _, deepObj in ipairs(containedObjects) do\n if deepObj.Name == \"Card\" or deepObj.Name == \"CardCustom\" then\n notes = JSON.decode(deepObj.GMNotes) or {}\n table.insert(notesList, notes)\n end\n end\n end\n end\n end\n return notesList\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -48850,66 +47710,6 @@ "Value": 0, "XmlUI": "" }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomImage": { - "CustomTile": { - "Stackable": false, - "Stretch": true, - "Thickness": 0.1, - "Type": 3 - }, - "ImageScalar": 1, - "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2115061845796985108/F0ADB7094641DA966FFA3AF0CC6987D33D2D9591/", - "WidthScale": 0 - }, - "Description": "Use the buttons to show / hide a playmat.", - "DragSelectable": true, - "GMNotes": "", - "GUID": "a758b2", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/PlayermatHider\")\nend)\n__bundle_register(\"accessories/PlayermatHider\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal objects\n\nfunction onClick_hideShow(player, matColor)\n objects = guidReferenceApi.getObjectsByOwner(matColor)\n local actionTokens = searchMat(objects.Playermat.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1}, isActionToken)\n local pos = objects.Playermat.getPosition()\n local mod = (pos.y \u003e 0) and -2 or 2\n\n -- move all objects\n for _, obj in pairs(objects) do\n obj.setPosition(obj.getPosition() + Vector(0, mod, 0))\n end\n\n -- move action tokens\n for _, obj in ipairs(actionTokens) do\n obj.setLock(pos.y \u003e 0)\n obj.setPosition(obj.getPosition() + Vector(0, mod, 0))\n end\nend\n\nfunction isActionToken(x) return x.getDescription() == 'Action Token' end\n\nfunction searchMat(origin, size, filter)\n local searchResult = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = objects.Playermat.getRotation(),\n type = 3,\n size = size,\n max_distance = 0\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or (filter and filter(v.hit_object)) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_Tile", - "Nickname": "PlayermatHider", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 0, - "posY": 2, - "posZ": 0, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 5, - "scaleY": 1, - "scaleZ": 5 - }, - "Value": 0, - "XmlUI": "\u003c!-- include accessories/PlayermatHider.xml --\u003e\n\u003cDefaults\u003e\n \u003cText color=\"White\"\n fontSize=\"110\"\n alignment=\"MiddleLeft\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton fontSize=\"110\"\n height=\"200\"\n width=\"600\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n selectClass=\"bWhite\"\n color=\"#aaaaaa\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"bGrey\"\n color=\"grey\"/\u003e\n \u003cButton class=\"bWhite\"\n color=\"white\"/\u003e\n \u003cButton class=\"activeTab\"\n color=\"#ffffff\"/\u003e\n \u003cRow preferredHeight=\"300\"/\u003e\n\u003c/Defaults\u003e\n\n\u003cTableLayout height=\"1600\"\n width=\"1800\"\n columnWidths=\"1000 800\"\n rotation=\"0 0 180\"\n position=\"0 0 -11\"\n scale=\"0.1 0.1 0.1\"\n cellBackgroundColor=\"none\"\u003e\n \u003cRow preferredHeight=\"400\"\u003e\n \u003cCell columnSpan=\"2\"\u003e\n \u003cText fontSize=\"200\"\n alignment=\"UpperCenter\"\u003ePlayermat Hider\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cText color=\"White\"\u003ePlayermat 1 (White)\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell\u003e\n \u003cPanel\u003e\n \u003cButton onClick=\"onClick_hideShow(White)\"\u003eShow / Hide\u003c/Button\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cText color=\"Orange\"\u003ePlayermat 2 (Orange)\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell\u003e\n \u003cPanel\u003e\n \u003cButton onClick=\"onClick_hideShow(Orange)\"\u003eShow / Hide\u003c/Button\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cText color=\"Green\"\u003ePlayermat 3 (Green)\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell\u003e\n \u003cPanel\u003e\n \u003cButton onClick=\"onClick_hideShow(Green)\"\u003eShow / Hide\u003c/Button\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cText color=\"Red\"\u003ePlayermat 4 (Red)\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell\u003e\n \u003cPanel\u003e\n \u003cButton onClick=\"onClick_hideShow(Red)\"\u003eShow / Hide\u003c/Button\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include accessories/PlayermatHider.xml --\u003e" - }, { "AltLookAngle": { "x": 0, @@ -49523,7 +48323,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/762723517667598054/18C06F0F20D9D4651E6736FB609E2D41F4D1964E/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 0 }, @@ -49592,7 +48392,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/762723517667592476/36D86649503A49A36AA97B7B72C6150E4C2BE333/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 0 }, @@ -49661,7 +48461,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/762723517667556656/9638E8CE7F209B50634B202C9EF4B0BDB4993BBB/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 0 }, @@ -49676,7 +48476,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -49730,7 +48530,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1474319121423613924/490D56D20C6AE0547D67D942513396E8D0584A4A/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 0 }, @@ -50744,9 +49544,9 @@ ], "Tooltip": true, "Transform": { - "posX": 1.598, + "posX": 1.6, "posY": 1.587, - "posZ": -13.746, + "posZ": -13.75, "rotX": 0, "rotY": 315, "rotZ": 0, @@ -50838,7 +49638,7 @@ "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2018214163835858903/EECF1C00C9A0C837DD40D7B5A3456B88DF0CEC08/", "WidthScale": 0 }, - "Description": "Left-Click: Add token\nRight-Click: Remove token\n\nContextmenu allows resetting the current state or removing all bless/curse tokens from play.\n\nSee Notebook for detailed instructions.", + "Description": "Left-Click: Add token\nRight-Click: Remove token\n\nContextmenu allows resetting the current state or removing all bless/curse tokens from play.\n\nCheck cards that seal tokens for a context menu.", "DragSelectable": true, "GMNotes": "", "GUID": "5933fb", @@ -50849,7 +49649,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"chaosbag/BlessCurseManager\")\nend)\n__bundle_register(\"chaosbag/BlessCurseManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\n-- common button parameters\nlocal buttonParamaters = {}\nbuttonParamaters.function_owner = self\nbuttonParamaters.color = { 0, 0, 0, 0 }\nbuttonParamaters.width = 700\nbuttonParamaters.height = 700\n\nlocal altState = false\nlocal MODE = {\n [false] = \"Add / Remove\",\n [true] = \"Take / Return\"\n}\nlocal BUTTON_COLOR = {\n [false] = { 0.4, 0.4, 0.4 },\n [true] = { 0.9, 0.9, 0.9 }\n}\nlocal FONT_COLOR = {\n [false] = { 1, 1, 1 },\n [true] = { 0, 0, 0 }\n}\nlocal whitespace = \" \"\nlocal updating\n\n---------------------------------------------------------\n-- creating buttons and menus + initializing tables\n---------------------------------------------------------\n\nfunction onSave() return JSON.encode(altState) end\n\nfunction onLoad(saved_state)\n if saved_state ~= nil then\n altState = JSON.decode(saved_state)\n end\n\n -- index: 0 - bless\n buttonParamaters.click_function = \"clickBless\"\n buttonParamaters.position = { -1.03, 0.05, 0.46 }\n self.createButton(buttonParamaters)\n\n -- index: 1 - curse\n buttonParamaters.click_function = \"clickCurse\"\n buttonParamaters.position[1] = -buttonParamaters.position[1]\n self.createButton(buttonParamaters)\n\n -- index: 2 - alternative mode (take / return)\n buttonParamaters.click_function = \"enableAlt\"\n buttonParamaters.width = 900\n buttonParamaters.height = 210\n buttonParamaters.position = { -1.03, 0.05, -0.85 }\n self.createButton(buttonParamaters)\n\n -- index: 3 - default mode (add / remove)\n buttonParamaters.click_function = \"enableDefault\"\n buttonParamaters.position[1] = -buttonParamaters.position[1]\n self.createButton(buttonParamaters)\n\n -- load labels, tooltips and colors\n updateButtons()\n\n -- context menu\n self.addContextMenuItem(\"Remove all\", doRemove)\n self.addContextMenuItem(\"Reset\", doReset)\n\n -- initializing tables \n initializeState()\n broadcastCount(\"Curse\")\n broadcastCount(\"Bless\")\nend\n\nfunction resetTables()\n numInPlay = { Bless = 0, Curse = 0 }\n tokensTaken = { Bless = {}, Curse = {} }\n sealedTokens = {}\nend\n\nfunction initializeState()\n resetTables()\n\n -- count tokens in the bag\n local chaosbag = chaosBagApi.findChaosBag()\n local tokens = {}\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == \"Bless\" then\n numInPlay.Bless = numInPlay.Bless + 1\n elseif v.name == \"Curse\" then\n numInPlay.Curse = numInPlay.Curse + 1\n end\n end\n\n -- find tokens in the play area\n for _, obj in ipairs(getObjects()) do\n local pos = obj.getPosition()\n if pos.x \u003e -65 and pos.x \u003c 10 and pos.z \u003e -35 and pos.z \u003c 35 then\n if obj.getName() == \"Bless\" then\n table.insert(tokensTaken.Bless, obj.getGUID())\n numInPlay.Bless = numInPlay.Bless + 1\n elseif obj.getName() == \"Curse\" then\n table.insert(tokensTaken.Curse, obj.getGUID())\n numInPlay.Curse = numInPlay.Curse + 1\n end\n end\n end\nend\n\nfunction broadcastCount(token)\n local count = formatTokenCount(token)\n if count == \"(0/0)\" then return end\n broadcastToAll(token .. \" Tokens \" .. count, \"White\")\nend\n\nfunction broadcastStatus(color)\n broadcastToColor(\"Curse Tokens \" .. formatTokenCount(\"Curse\"), color, \"White\")\n broadcastToColor(\"Bless Tokens \" .. formatTokenCount(\"Bless\"), color, \"White\")\nend\n\n-- context menu function 1\nfunction doRemove(color)\n local chaosbag = chaosBagApi.findChaosBag()\n\n -- remove tokens from chaos bag\n local count = { Bless = 0, Curse = 0 }\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == \"Bless\" or v.name == \"Curse\" then\n chaosbag.takeObject({\n guid = v.guid,\n position = { 0, 5, 0 },\n callback_function = function(obj) obj.destruct() end\n })\n count[v.name] = count[v.name] + 1\n end\n end\n\n broadcastToColor(\"Removed \" .. count.Bless .. \" Bless and \" ..\n count.Curse .. \" Curse tokens from the chaos bag.\", color, \"White\")\n broadcastToColor(\"Removed \" .. removeTakenTokens(\"Bless\") .. \" Bless and \" ..\n removeTakenTokens(\"Curse\") .. \" Curse tokens from play.\", color, \"White\")\n\n resetTables()\n tokenArrangerApi.layout()\nend\n\n-- context menu function 2\nfunction doReset(color)\n initializeState()\n broadcastCount(\"Curse\")\n broadcastCount(\"Bless\")\n tokenArrangerApi.layout()\nend\n\n-- removing tokens that were 'taken'\nfunction removeTakenTokens(type)\n local count = 0\n for _, guid in ipairs(tokensTaken[type]) do\n local token = getObjectFromGUID(guid)\n if token ~= nil then\n token.destruct()\n count = count + 1\n end\n end\n return count\nend\n\n---------------------------------------------------------\n-- click functions\n---------------------------------------------------------\n\n-- click function 1\nfunction clickBless(_, color, isRightClick)\n playerColor = color\n callFunctions(\"Bless\", isRightClick)\nend\n\n-- click function 2\nfunction clickCurse(_, color, isRightClick)\n playerColor = color\n callFunctions(\"Curse\", isRightClick)\nend\n\n-- click function 3\nfunction enableAlt()\n if altState then return end\n altState = not altState\n updateButtons()\nend\n\n-- click function 4\nfunction enableDefault()\n if not altState then return end\n altState = not altState\n updateButtons()\nend\n\n---------------------------------------------------------\n-- called functions\n---------------------------------------------------------\n\nfunction updateButtons()\n self.editButton({\n index = 0,\n tooltip = MODE[altState] .. \" Bless\"\n })\n\n self.editButton({\n index = 1,\n tooltip = MODE[altState] .. \" Curse\"\n })\n\n self.editButton({\n index = 2,\n label = whitespace .. MODE[true] .. (altState and \" ✓\" or whitespace) .. \" \",\n color = BUTTON_COLOR[not altState],\n font_color = FONT_COLOR[not altState]\n })\n\n self.editButton({\n index = 3,\n label = whitespace .. MODE[false] .. (altState and whitespace or \" ✓\") .. \" \",\n color = BUTTON_COLOR[altState],\n font_color = FONT_COLOR[altState]\n })\nend\n\n-- function that is called by click_functions 1+2 and calls the other functions\nfunction callFunctions(token, isRightClick)\n if not chaosBagApi.canTouchChaosTokens() then\n return\n end\n local success\n if not altState then\n if isRightClick then\n success = takeToken(token, true)\n else\n success = addToken(token)\n end\n else\n if isRightClick then\n success = returnToken(token)\n else\n success = takeToken(token, false)\n end\n end\n if success ~= 0 then tokenArrangerApi.layout() end\nend\n\n-- returns a formatted string with information about the provided token type (bless / curse)\nfunction formatTokenCount(type)\n if type == nil then type = mode end\n return \"(\" .. (numInPlay[type] - #tokensTaken[type]) .. \"/\" .. #tokensTaken[type] .. \")\"\nend\n\n-- called by cards that seal bless/curse tokens\n---@param param Table This contains the type and guid of the sealed token\nfunction sealedToken(param)\n table.insert(tokensTaken[param.type], param.guid)\n broadcastCount(param.type)\nend\n\n-- called by cards that seal bless/curse tokens\n---@param param Table This contains the type and guid of the released token\nfunction releasedToken(param)\n for i, v in ipairs(tokensTaken[param.type]) do\n if v == param.guid then\n table.remove(tokensTaken[param.type], i)\n break\n end\n end\n if not updating then\n updating = true\n Wait.frames(function()\n broadcastCount(param.type)\n updating = false\n end, 1)\n end\nend\n\n---------------------------------------------------------\n-- main functions: add, take and return\n---------------------------------------------------------\n\nfunction addToken(type)\n if numInPlay[type] == 10 then\n printToColor(\"10 tokens already in play, not adding any.\", playerColor)\n return 0\n end\n numInPlay[type] = numInPlay[type] + 1\n printToAll(\"Adding \" .. type .. \" token \" .. formatTokenCount(type))\n return chaosBagApi.spawnChaosToken(type)\nend\n\nfunction takeToken(type, remove)\n local chaosbag = chaosBagApi.findChaosBag()\n if not remove and not SEAL_CARD_MESSAGE then\n broadcastToColor(\"For sealing tokens on cards try right-clicking on the card for seal options.\", playerColor)\n SEAL_CARD_MESSAGE = true\n end\n local tokens = {}\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == type then\n table.insert(tokens, v.guid)\n end\n end\n if #tokens == 0 then\n printToColor(\"No \" .. type .. \" tokens in the chaos bag.\", playerColor)\n return 0\n end\n local pos = self.getPosition() + Vector(2.25, 0, 0.85)\n if type == \"Curse\" then pos[3] = pos[3] - 1.7 end\n chaosbag.takeObject({\n guid = table.remove(tokens),\n position = pos,\n smooth = false,\n callback_function = function(obj)\n if remove then\n numInPlay[type] = numInPlay[type] - 1\n printToAll(\"Removing \" .. type .. \" token \" .. formatTokenCount(type))\n obj.destruct()\n else\n table.insert(tokensTaken[type], obj.getGUID())\n printToAll(\"Taking \" .. type .. \" token \" .. formatTokenCount(type))\n end\n end\n })\nend\n\nfunction returnToken(type)\n local guid = table.remove(tokensTaken[type])\n if guid == nil then\n printToColor(\"No \" .. type .. \" tokens to return\", playerColor)\n return 0\n end\n local token = getObjectFromGUID(guid)\n if token == nil then\n printToColor(\"Couldn't find token \" .. guid .. \", not returning to bag\", playerColor)\n return 0\n end\n local chaosbag = chaosBagApi.findChaosBag()\n if chaosbag == nil then\n return 0\n end\n chaosbag.putObject(token)\n printToAll(\"Returning \" .. type .. \" token \" .. formatTokenCount(type))\nend\n\n---------------------------------------------------------\n-- Wendy Menu (context menu for cards on hotkey press)\n---------------------------------------------------------\n\nfunction addMenuOptions(parameters)\n local playerColor = parameters.playerColor\n local hoveredObject = parameters.hoveredObject\n if hoveredObject == nil or hoveredObject.getVar(\"MENU_ADDED\") == true then return end\n if hoveredObject.tag ~= \"Card\" then\n broadcastToColor(\"Right-click seal options can only be added to cards\", playerColor)\n return\n end\n\n hoveredObject.addContextMenuItem(\"Seal Bless\", function(color)\n sealToken(\"Bless\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Release Bless\", function(color)\n releaseToken(\"Bless\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Seal Curse\", function(color)\n sealToken(\"Curse\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Release Curse\", function(color)\n releaseToken(\"Curse\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n broadcastToColor(\"Right-click seal options added to \" .. hoveredObject.getName(), playerColor)\n hoveredObject.setVar(\"MENU_ADDED\", true)\n sealedTokens[hoveredObject.getGUID()] = {}\nend\n\nfunction sealToken(type, playerColor, enemy)\n local chaosbag = chaosBagApi.findChaosBag()\n if chaosbag == nil then return end\n local pos = enemy.getPosition()\n\n for i, token in ipairs(chaosbag.getObjects()) do\n if token.name == type then\n chaosbag.takeObject({\n position = { pos.x, pos.y + 1, pos.z },\n index = i - 1,\n smooth = false,\n callback_function = function(obj)\n Wait.frames(function()\n table.insert(sealedTokens[enemy.getGUID()], obj)\n table.insert(tokensTaken[type], obj.getGUID())\n printToColor(\"Sealing \" .. type .. \" token \" .. formatTokenCount(type), playerColor)\n end, 1)\n end\n })\n return\n end\n end\n printToColor(type .. \" token not found in bag\", playerColor)\nend\n\nfunction releaseToken(type, playerColor, enemy)\n local chaosbag = chaosBagApi.findChaosBag()\n if chaosbag == nil then return end\n local tokens = sealedTokens[enemy.getGUID()]\n if tokens == nil or #tokens == 0 then return end\n\n for i, token in ipairs(tokens) do\n if token ~= nil and token.getName() == type then\n local guid = token.getGUID()\n chaosbag.putObject(token)\n for j, v in ipairs(tokensTaken[type]) do\n if v == guid then\n table.remove(tokensTaken[type], j)\n table.remove(tokens, i)\n printToColor(\"Releasing \" .. type .. \" token\" .. formatTokenCount(type), playerColor)\n return\n end\n end\n end\n end\n printToColor(type .. \" token not sealed on \" .. enemy.getName(), playerColor)\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"chaosbag/BlessCurseManager\")\nend)\n__bundle_register(\"chaosbag/BlessCurseManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\n-- common button parameters\nlocal buttonParamaters = {}\nbuttonParamaters.function_owner = self\nbuttonParamaters.color = { 0, 0, 0, 0 }\nbuttonParamaters.width = 700\nbuttonParamaters.height = 700\n\nlocal updating\n\n---------------------------------------------------------\n-- creating buttons and menus + initializing tables\n---------------------------------------------------------\n\nfunction onLoad()\n -- index: 0 - bless\n buttonParamaters.click_function = \"clickBless\"\n buttonParamaters.position = { -1.03, 0, 0.46 }\n buttonParamaters.tooltip = \"Add / Remove Bless\"\n self.createButton(buttonParamaters)\n\n -- index: 1 - curse\n buttonParamaters.click_function = \"clickCurse\"\n buttonParamaters.position[1] = -buttonParamaters.position[1]\n buttonParamaters.tooltip = \"Add / Remove Curse\"\n self.createButton(buttonParamaters)\n\n -- index: 2 - bless count\n buttonParamaters.tooltip = \"\"\n buttonParamaters.click_function = \"none\"\n buttonParamaters.width = 0\n buttonParamaters.height = 0\n buttonParamaters.color = { 0.4, 0.4, 0.4 }\n buttonParamaters.font_color = { 1, 1, 1 }\n buttonParamaters.font_size = 235\n buttonParamaters.position = { -1.03, 0.06, -0.8 }\n self.createButton(buttonParamaters)\n\n -- index: 3 - curse count\n buttonParamaters.position[1] = -buttonParamaters.position[1]\n self.createButton(buttonParamaters)\n\n -- context menu\n self.addContextMenuItem(\"Remove all\", doRemove)\n self.addContextMenuItem(\"Reset\", doReset)\n\n -- initializing tables\n initializeState()\n broadcastCount(\"Curse\")\n broadcastCount(\"Bless\")\nend\n\nfunction resetTables()\n numInPlay = { Bless = 0, Curse = 0 }\n tokensTaken = { Bless = {}, Curse = {} }\n sealedTokens = {}\nend\n\nfunction initializeState()\n resetTables()\n\n -- count tokens in the bag\n local chaosBag = chaosBagApi.findChaosBag()\n local tokens = {}\n for _, v in ipairs(chaosBag.getObjects()) do\n if v.name == \"Bless\" then\n numInPlay.Bless = numInPlay.Bless + 1\n elseif v.name == \"Curse\" then\n numInPlay.Curse = numInPlay.Curse + 1\n end\n end\n\n -- find tokens in the play area\n for _, obj in ipairs(getObjects()) do\n local pos = obj.getPosition()\n if pos.x \u003e -65 and pos.x \u003c 10 and pos.z \u003e -35 and pos.z \u003c 35 then\n if obj.getName() == \"Bless\" then\n table.insert(tokensTaken.Bless, obj.getGUID())\n numInPlay.Bless = numInPlay.Bless + 1\n elseif obj.getName() == \"Curse\" then\n table.insert(tokensTaken.Curse, obj.getGUID())\n numInPlay.Curse = numInPlay.Curse + 1\n end\n end\n end\n\n updateButtonLabels()\nend\n\nfunction updateButtonLabels()\n self.editButton({ index = 2, label = formatTokenCount(\"Bless\", true)})\n self.editButton({ index = 3, label = formatTokenCount(\"Curse\", true)})\nend\n\nfunction broadcastCount(token)\n local count = formatTokenCount(token)\n if count == \"(0 + 0)\" then return end\n broadcastToAll(token .. \" Tokens \" .. count, \"White\")\nend\n\nfunction broadcastStatus(color)\n broadcastToColor(\"Curse Tokens \" .. formatTokenCount(\"Curse\"), color, \"White\")\n broadcastToColor(\"Bless Tokens \" .. formatTokenCount(\"Bless\"), color, \"White\")\nend\n\n---------------------------------------------------------\n-- TTS event handling\n---------------------------------------------------------\n\n-- enable tracking of bag changes for 1 second\nfunction onObjectDrop(_, object)\n if not isBlurseToken(object) then return end\n\n -- check if object was dropped in chaos bag area\n for _, zone in ipairs(object.getZones()) do\n if zone.getName() == \"ChaosBagZone\" then\n trackBagChange = true\n Wait.time(function() trackBagChange = false end, 1)\n return\n end\n end\nend\n\n-- handle manual returning of bless / curse tokens\nfunction onObjectEnterContainer(container, object)\n if not (trackBagChange and isChaosbag(container) and isBlurseToken(object)) then return end\n\n -- small delay to ensure token has entered bag\n Wait.time(doReset, 0.5)\nend\n\nfunction isChaosbag(obj)\n if obj.getDescription() ~= \"Chaos Bag\" then return end -- early exit for performance\n return obj == chaosBagApi.findChaosBag()\nend\n\nfunction isBlurseToken(obj)\n local name = obj.getName()\n return name == \"Bless\" or name == \"Curse\"\nend\n\n---------------------------------------------------------\n-- context menu functions\n---------------------------------------------------------\n\nfunction doRemove(color)\n local chaosBag = chaosBagApi.findChaosBag()\n\n -- remove tokens from chaos bag\n local count = { Bless = 0, Curse = 0 }\n for _, v in ipairs(chaosBag.getObjects()) do\n if v.name == \"Bless\" or v.name == \"Curse\" then\n chaosBag.takeObject({\n guid = v.guid,\n position = { 0, 5, 0 },\n callback_function = function(obj) obj.destruct() end\n })\n count[v.name] = count[v.name] + 1\n end\n end\n\n broadcastToColor(\"Removed \" .. count.Bless .. \" Bless and \" .. count.Curse .. \" Curse tokens from the chaos bag.\", color, \"White\")\n broadcastToColor(\"Removed \" .. removeTakenTokens(\"Bless\") .. \" Bless and \" .. removeTakenTokens(\"Curse\") .. \" Curse tokens from play.\", color, \"White\")\n\n resetTables()\n updateButtonLabels()\n tokenArrangerApi.layout()\nend\n\nfunction doReset()\n initializeState()\n broadcastCount(\"Curse\")\n broadcastCount(\"Bless\")\n tokenArrangerApi.layout()\nend\n\n---------------------------------------------------------\n-- click functions\n---------------------------------------------------------\n\nfunction clickBless(_, color, isRightClick)\n playerColor = color\n callFunctions(\"Bless\", isRightClick)\nend\n\nfunction clickCurse(_, color, isRightClick)\n playerColor = color\n callFunctions(\"Curse\", isRightClick)\nend\n\nfunction callFunctions(type, isRightClick)\n if not chaosBagApi.canTouchChaosTokens() then return end\n\n if isRightClick then\n removeToken(type)\n else\n addToken(type)\n end\n\n tokenArrangerApi.layout()\nend\n\n---------------------------------------------------------\n-- called functions\n---------------------------------------------------------\n\n-- returns a formatted string with information about the provided token type (bless / curse)\nfunction formatTokenCount(type, omitBrackets)\n if type == nil then type = mode end\n\n if omitBrackets then\n return (numInPlay[type] - #tokensTaken[type]) .. \" + \" .. #tokensTaken[type]\n else\n return \"(\" .. (numInPlay[type] - #tokensTaken[type]) .. \" + \" .. #tokensTaken[type] .. \")\"\n end\nend\n\n-- seals a token on a card (called by cards that seal bless/curse tokens)\n---@param param Table This contains the type and guid of the sealed token\nfunction sealedToken(param)\n table.insert(tokensTaken[param.type], param.guid)\n broadcastCount(param.type)\n updateButtonLabels()\nend\n\n-- returns a token to the bag (called by cards that seal bless/curse tokens)\n---@param param Table This contains the type and guid of the released token\nfunction releasedToken(param)\n for i, v in ipairs(tokensTaken[param.type]) do\n if v == param.guid then\n table.remove(tokensTaken[param.type], i)\n break\n end\n end\n updateDisplayAndBroadcast(param.type)\nend\n\n-- removes a token (called by cards that seal bless/curse tokens)\n---@param param Table This contains the type and guid of the released token\nfunction returnedToken(param)\n for i, v in ipairs(tokensTaken[param.type]) do\n if v == param.guid then\n table.remove(tokensTaken[param.type], i)\n numInPlay[param.type] = numInPlay[param.type] - 1\n break\n end\n end\n updateDisplayAndBroadcast(param.type)\nend\n\nfunction updateDisplayAndBroadcast(type)\n if not updating then\n updating = true\n Wait.frames(function()\n broadcastCount(type)\n updateButtonLabels()\n updating = false\n end, 5)\n end\nend\n\n---------------------------------------------------------\n-- main functions: add and remove\n---------------------------------------------------------\n\nfunction addToken(type)\n if numInPlay[type] == 10 then\n printToColor(\"10 tokens already in play, not adding any.\", playerColor)\n return\n end\n numInPlay[type] = numInPlay[type] + 1\n printToAll(\"Adding \" .. type .. \" token \" .. formatTokenCount(type))\n updateButtonLabels()\n return chaosBagApi.spawnChaosToken(type)\nend\n\nfunction removeToken(type)\n local chaosBag = chaosBagApi.findChaosBag()\n local tokens = {}\n\n for _, v in ipairs(chaosBag.getObjects()) do\n if v.name == type then\n table.insert(tokens, v.guid)\n end\n end\n\n if #tokens == 0 then\n printToColor(\"No \" .. type .. \" tokens in the chaos bag.\", playerColor)\n return\n end\n\n chaosBag.takeObject({\n guid = table.remove(tokens),\n smooth = false,\n callback_function = function(obj)\n numInPlay[type] = numInPlay[type] - 1\n printToAll(\"Removing \" .. type .. \" token \" .. formatTokenCount(type))\n updateButtonLabels()\n obj.destruct()\n end\n })\nend\n\n-- removing tokens that were 'taken'\nfunction removeTakenTokens(type)\n local count = 0\n for _, guid in ipairs(tokensTaken[type]) do\n local token = getObjectFromGUID(guid)\n if token ~= nil then\n token.destruct()\n count = count + 1\n end\n end\n return count\nend\n\n---------------------------------------------------------\n-- Wendy's Menu (context menu for cards on hotkey press)\n---------------------------------------------------------\n\nfunction addMenuOptions(parameters)\n local playerColor = parameters.playerColor\n local hoveredObject = parameters.hoveredObject\n if hoveredObject == nil or hoveredObject.type ~= \"Card\" then\n broadcastToColor(\"Right-click seal options can only be added to cards.\", playerColor)\n return\n elseif hoveredObject.hasTag(\"CardThatSeals\") or hoveredObject.getVar(\"MENU_ADDED\") == true then\n broadcastToColor(\"This card already has a sealing context menu.\", playerColor)\n return\n end\n\n hoveredObject.addContextMenuItem(\"Seal Bless\", function(color)\n sealToken(\"Bless\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Release Bless\", function(color)\n releaseToken(\"Bless\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Seal Curse\", function(color)\n sealToken(\"Curse\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n hoveredObject.addContextMenuItem(\"Release Curse\", function(color)\n releaseToken(\"Curse\", color, hoveredObject)\n tokenArrangerApi.layout()\n end, true)\n\n broadcastToColor(\"Right-click seal options added to \" .. hoveredObject.getName(), playerColor)\n hoveredObject.setVar(\"MENU_ADDED\", true)\n sealedTokens[hoveredObject.getGUID()] = {}\nend\n\nfunction sealToken(type, playerColor, hoveredObject)\n local chaosBag = chaosBagApi.findChaosBag()\n\n for i, token in ipairs(chaosBag.getObjects()) do\n if token.name == type then\n return chaosBag.takeObject({\n position = hoveredObject.getPosition() + Vector(0, 1, 0),\n index = i - 1,\n smooth = false,\n callback_function = function(obj)\n table.insert(sealedTokens[hoveredObject.getGUID()], obj)\n table.insert(tokensTaken[type], obj.getGUID())\n tokenArrangerApi.layout()\n updateDisplayAndBroadcast(type)\n end\n })\n end\n end\n printToColor(type .. \" token not found in bag\", playerColor)\nend\n\nfunction releaseToken(type, playerColor, hoveredObject)\n local chaosBag = chaosBagApi.findChaosBag()\n local tokens = sealedTokens[hoveredObject.getGUID()]\n if tokens == nil or #tokens == 0 then return end\n\n for i, token in ipairs(tokens) do\n if token ~= nil and token.getName() == type then\n local guid = token.getGUID()\n chaosBag.putObject(token)\n for j, v in ipairs(tokensTaken[type]) do\n if v == guid then\n table.remove(tokensTaken[type], j)\n table.remove(tokens, i)\n tokenArrangerApi.layout()\n updateDisplayAndBroadcast(type)\n return\n end\n end\n end\n end\n printToColor(type .. \" token not sealed on \" .. hoveredObject.getName(), playerColor)\nend\n\nfunction none() end\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "false", "MeasureMovement": false, "Name": "Custom_Token", @@ -51133,7 +49933,7 @@ }, "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1697277388086852852/6FD56D74FDDDA5626A3B72E788993EC651AD25E1/", "MaterialIndex": 3, - "MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2", + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/2278324073260846176/33EFCAF30567F8756F665BE5A2A6502E9C61C7F7/", "NormalURL": "", "TypeIndex": 0 }, @@ -51148,7 +49948,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -51208,7 +50008,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DoomInPlayCounter\")\nend)\n__bundle_register(\"core/DoomInPlayCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal ZONE, TRASH, loopID\nlocal doomURL = \"https://i.imgur.com/EoL7yaZ.png\"\nlocal IGNORE_TAG = \"DoomCounter_ignore\"\nlocal TOTAL_PLAY_AREA = {\n upperLeft = {\n x = -10,\n z = -35\n },\n lowerRight = {\n x = -60,\n z = 35\n }\n}\n\n-- create button, context menu and start loop\nfunction onLoad()\n self.createButton({\n label = \"0\",\n click_function = \"none\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 0,\n width = 0,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n TRASH = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n ZONE = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n loopID = Wait.time(countDoom, 2, -1)\nend\n\n-- main function\nfunction countDoom()\n local count = 0\n\n -- get doom in play\n for _, obj in ipairs(getObjects()) do\n count = count + getDoomAmount(obj)\n end\n\n self.editButton({ index = 0, label = tostring(count) })\nend\n\n-- gets quantity (for stacks) of doom\nfunction getDoomAmount(obj)\n if (obj.is_face_down and obj.getCustomObject().image_bottom == doomURL)\n and not obj.hasTag(IGNORE_TAG)\n and inArea(obj.getPosition(), TOTAL_PLAY_AREA) then\n return math.abs(obj.getQuantity())\n else\n return 0\n end\nend\n\n-- removes doom from playermats / playarea\nfunction removeDoom(options)\n local count = 0\n\n if options.Playermats then\n count = removeDoomFromList(playmatApi.searchAroundPlaymat(\"All\"))\n broadcastToAll(count .. \" doom removed from Playermats.\", \"White\")\n end\n\n if options.Playarea then\n count = removeDoomFromList(ZONE.getObjects())\n broadcastToAll(count .. \" doom removed from Playerarea.\", \"White\")\n end\nend\n\n-- removes doom from provided object list and returns the removed amount\nfunction removeDoomFromList(objList)\n local count = 0\n for _, obj in ipairs(objList) do\n local amount = getDoomAmount(obj)\n if amount \u003e 0 then\n TRASH.putObject(obj)\n count = count + amount\n end\n end\n return count\nend\n\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003e bounds.upperLeft.z\n and point.z \u003c bounds.lowerRight.z)\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DoomInPlayCounter\")\nend)\n__bundle_register(\"core/DoomInPlayCounter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal ZONE, TRASH, loopID\nlocal doomURL = \"https://i.imgur.com/EoL7yaZ.png\"\nlocal IGNORE_TAG = \"DoomCounter_ignore\"\nlocal TOTAL_PLAY_AREA = {\n upperLeft = {\n x = -9,\n z = -35\n },\n lowerRight = {\n x = -60,\n z = 35\n }\n}\n\n-- create button, context menu and start loop\nfunction onLoad()\n self.createButton({\n label = \"0\",\n click_function = \"none\",\n function_owner = self,\n position = { 0, 0.06, 0 },\n height = 0,\n width = 0,\n scale = { 1.5, 1.5, 1.5 },\n font_size = 600,\n font_color = { 1, 1, 1, 100 },\n color = { 0, 0, 0, 0 }\n })\n\n TRASH = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n ZONE = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n loopID = Wait.time(updateCounter, 2, -1)\nend\n\n-- main function\nfunction updateCounter()\n local count = countDoomInPlay()\n self.editButton({ index = 0, label = tostring(count) })\nend\n\n-- get doom in play\nfunction countDoomInPlay()\n local count = 0\n\n for _, obj in ipairs(getObjects()) do\n count = count + getDoomAmount(obj)\n end\n\n return count\nend\n\n-- gets quantity (for stacks) of doom\nfunction getDoomAmount(obj)\n if (obj.is_face_down and obj.getCustomObject().image_bottom == doomURL)\n and not obj.hasTag(IGNORE_TAG)\n and inArea(obj.getPosition(), TOTAL_PLAY_AREA) then\n return math.abs(obj.getQuantity())\n else\n return 0\n end\nend\n\n-- removes doom from playermats / playarea\nfunction removeDoom(options)\n if options.Playermats then\n local count = removeDoomFromList(playmatApi.searchAroundPlaymat(\"All\"))\n if count \u003e 0 then \n broadcastToAll(count .. \" doom removed from playermats.\", \"White\")\n end\n end\n\n if options.Playarea then\n local count = removeDoomFromList(ZONE.getObjects())\n if count \u003e 0 then \n broadcastToAll(count .. \" doom removed from play area.\", \"White\")\n end\n end\nend\n\n-- removes doom from provided object list and returns the removed amount\nfunction removeDoomFromList(objList)\n local count = 0\n for _, obj in ipairs(objList) do\n local amount = getDoomAmount(obj)\n if amount \u003e 0 then\n TRASH.putObject(obj)\n count = count + amount\n end\n end\n return count\nend\n\n-- helper function to check if a position is inside an area\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003e bounds.upperLeft.z\n and point.z \u003c bounds.lowerRight.z)\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", @@ -51578,7 +50378,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- set true to enable debug logging and show Physics.cast()\nlocal DEBUG = false\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- position offsets relative to mat [x, y, z]\nlocal DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}\nlocal DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.25, -0.58}\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for \"inArea()\" and \"Physics.cast()\"\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = DEBUG\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n local searchResult = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = self.getRotation(),\n type = 3,\n size = size,\n max_distance = 0\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or (filter and filter(v.hit_object)) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\nend\n\n-- filter functions for searchArea()\nfunction isCard(x) return x.type == 'Card' end\nfunction isDeck(x) return x.type == 'Deck' end\nfunction isCardOrDeck(x) return x.type == 'Card' or x.type == 'Deck' end\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if isCardOrDeck(obj) then\n if obj.hasTag(\"PlayerCard\") then\n placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- places a card/deck at a position or merges into an existing deck\n-- rotation is optional\nfunction placeOrMergeIntoDeck(obj, pos, rot)\n if not pos then return end\n\n local offset = 0.5\n \n -- search the new position for existing card/deck\n local searchResult = searchArea(pos, { 1, 1, 1 }, isCardOrDeck)\n\n -- get new position\n local newPos\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n -- right-click allow color changing\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(isCardOrDeck)) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(isCard)) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(isCard)) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if not isCard(object) then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if not isCard(object) then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, obj in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" and\n not tokenChecker.isChaosToken(obj) then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n local pos = self.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET)\n local rotY = self.getRotation().y\n mythosAreaApi.drawEncounterCard(pos, rotY, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckLib = require(\"util/DeckLib\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for object searching\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = false\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n return searchLib.inArea(origin, self.getRotation(), size, filter)\nend\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if obj.type == \"Card\" or obj.type == \"Deck\" then\n if obj.hasTag(\"PlayerCard\") then\n deckLib.placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n deckLib.placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(\"isCardOrDeck\")) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(\"isCard\")) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(\"isCard\")) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if object.type ~= \"Card\" then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if object.type ~= \"Card\" then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n if object.hasTag(\"CardThatSeals\") then\n local func = object.getVar(\"resetSealedTokens\") -- check if function exists (it won't for older custom content)\n if func ~= nil then\n object.call(\"resetSealedTokens\")\n end\n end\n\n for _, obj in ipairs(searchLib.onObject(object)) do\n if tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n elseif obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n mythosAreaApi.drawEncounterCard(self, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"util/DeckLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckLib = {}\n local searchLib = require(\"util/SearchLib\")\n\n -- places a card/deck at a position or merges into an existing deck\n ---@param obj TTSObject Object to move\n ---@param pos Table New position for the object\n ---@param rot Table New rotation for the object (optional)\n DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)\n if obj == nil or pos == nil then return end\n\n -- search the new position for existing card/deck\n local searchResult = searchLib.atPosition(pos, \"isCardOrDeck\")\n\n -- get new position\n local newPos\n local offset = 0.5\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\n end\n\n return DeckLib\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"activeInvestigatorId\":\"00000\",\"isDrawButtonVisible\":false,\"playerColor\":\"White\"}", "MeasureMovement": false, "Memo": "White", @@ -51946,7 +50746,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- set true to enable debug logging and show Physics.cast()\nlocal DEBUG = false\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- position offsets relative to mat [x, y, z]\nlocal DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}\nlocal DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.25, -0.58}\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for \"inArea()\" and \"Physics.cast()\"\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = DEBUG\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n local searchResult = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = self.getRotation(),\n type = 3,\n size = size,\n max_distance = 0\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or (filter and filter(v.hit_object)) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\nend\n\n-- filter functions for searchArea()\nfunction isCard(x) return x.type == 'Card' end\nfunction isDeck(x) return x.type == 'Deck' end\nfunction isCardOrDeck(x) return x.type == 'Card' or x.type == 'Deck' end\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if isCardOrDeck(obj) then\n if obj.hasTag(\"PlayerCard\") then\n placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- places a card/deck at a position or merges into an existing deck\n-- rotation is optional\nfunction placeOrMergeIntoDeck(obj, pos, rot)\n if not pos then return end\n\n local offset = 0.5\n \n -- search the new position for existing card/deck\n local searchResult = searchArea(pos, { 1, 1, 1 }, isCardOrDeck)\n\n -- get new position\n local newPos\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n -- right-click allow color changing\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(isCardOrDeck)) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(isCard)) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(isCard)) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if not isCard(object) then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if not isCard(object) then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, obj in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" and\n not tokenChecker.isChaosToken(obj) then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n local pos = self.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET)\n local rotY = self.getRotation().y\n mythosAreaApi.drawEncounterCard(pos, rotY, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n return NavigationOverlayApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"util/DeckLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckLib = {}\n local searchLib = require(\"util/SearchLib\")\n\n -- places a card/deck at a position or merges into an existing deck\n ---@param obj TTSObject Object to move\n ---@param pos Table New position for the object\n ---@param rot Table New rotation for the object (optional)\n DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)\n if obj == nil or pos == nil then return end\n\n -- search the new position for existing card/deck\n local searchResult = searchLib.atPosition(pos, \"isCardOrDeck\")\n\n -- get new position\n local newPos\n local offset = 0.5\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\n end\n\n return DeckLib\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckLib = require(\"util/DeckLib\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for object searching\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = false\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n return searchLib.inArea(origin, self.getRotation(), size, filter)\nend\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if obj.type == \"Card\" or obj.type == \"Deck\" then\n if obj.hasTag(\"PlayerCard\") then\n deckLib.placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n deckLib.placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(\"isCardOrDeck\")) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(\"isCard\")) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(\"isCard\")) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if object.type ~= \"Card\" then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if object.type ~= \"Card\" then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n if object.hasTag(\"CardThatSeals\") then\n local func = object.getVar(\"resetSealedTokens\") -- check if function exists (it won't for older custom content)\n if func ~= nil then\n object.call(\"resetSealedTokens\")\n end\n end\n\n for _, obj in ipairs(searchLib.onObject(object)) do\n if tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n elseif obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n mythosAreaApi.drawEncounterCard(self, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"activeInvestigatorId\":\"00000\",\"isDrawButtonVisible\":false,\"playerColor\":\"Orange\"}", "MeasureMovement": false, "Memo": "Orange", @@ -52314,7 +51114,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- set true to enable debug logging and show Physics.cast()\nlocal DEBUG = false\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- position offsets relative to mat [x, y, z]\nlocal DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}\nlocal DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.25, -0.58}\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for \"inArea()\" and \"Physics.cast()\"\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = DEBUG\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n local searchResult = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = self.getRotation(),\n type = 3,\n size = size,\n max_distance = 0\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or (filter and filter(v.hit_object)) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\nend\n\n-- filter functions for searchArea()\nfunction isCard(x) return x.type == 'Card' end\nfunction isDeck(x) return x.type == 'Deck' end\nfunction isCardOrDeck(x) return x.type == 'Card' or x.type == 'Deck' end\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if isCardOrDeck(obj) then\n if obj.hasTag(\"PlayerCard\") then\n placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- places a card/deck at a position or merges into an existing deck\n-- rotation is optional\nfunction placeOrMergeIntoDeck(obj, pos, rot)\n if not pos then return end\n\n local offset = 0.5\n \n -- search the new position for existing card/deck\n local searchResult = searchArea(pos, { 1, 1, 1 }, isCardOrDeck)\n\n -- get new position\n local newPos\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n -- right-click allow color changing\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(isCardOrDeck)) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(isCard)) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(isCard)) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if not isCard(object) then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if not isCard(object) then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, obj in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" and\n not tokenChecker.isChaosToken(obj) then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n local pos = self.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET)\n local rotY = self.getRotation().y\n mythosAreaApi.drawEncounterCard(pos, rotY, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"util/DeckLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckLib = {}\n local searchLib = require(\"util/SearchLib\")\n\n -- places a card/deck at a position or merges into an existing deck\n ---@param obj TTSObject Object to move\n ---@param pos Table New position for the object\n ---@param rot Table New rotation for the object (optional)\n DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)\n if obj == nil or pos == nil then return end\n\n -- search the new position for existing card/deck\n local searchResult = searchLib.atPosition(pos, \"isCardOrDeck\")\n\n -- get new position\n local newPos\n local offset = 0.5\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\n end\n\n return DeckLib\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckLib = require(\"util/DeckLib\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for object searching\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = false\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n return searchLib.inArea(origin, self.getRotation(), size, filter)\nend\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if obj.type == \"Card\" or obj.type == \"Deck\" then\n if obj.hasTag(\"PlayerCard\") then\n deckLib.placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n deckLib.placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(\"isCardOrDeck\")) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(\"isCard\")) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(\"isCard\")) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if object.type ~= \"Card\" then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if object.type ~= \"Card\" then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n if object.hasTag(\"CardThatSeals\") then\n local func = object.getVar(\"resetSealedTokens\") -- check if function exists (it won't for older custom content)\n if func ~= nil then\n object.call(\"resetSealedTokens\")\n end\n end\n\n for _, obj in ipairs(searchLib.onObject(object)) do\n if tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n elseif obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n mythosAreaApi.drawEncounterCard(self, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"activeInvestigatorId\":\"00000\",\"isDrawButtonVisible\":false,\"playerColor\":\"Green\"}", "MeasureMovement": false, "Memo": "Green", @@ -52682,7 +51482,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- set true to enable debug logging and show Physics.cast()\nlocal DEBUG = false\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- position offsets relative to mat [x, y, z]\nlocal DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}\nlocal DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.25, -0.58}\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for \"inArea()\" and \"Physics.cast()\"\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = DEBUG\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n local searchResult = Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = self.getRotation(),\n type = 3,\n size = size,\n max_distance = 0\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or (filter and filter(v.hit_object)) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\nend\n\n-- filter functions for searchArea()\nfunction isCard(x) return x.type == 'Card' end\nfunction isDeck(x) return x.type == 'Deck' end\nfunction isCardOrDeck(x) return x.type == 'Card' or x.type == 'Deck' end\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if isCardOrDeck(obj) then\n if obj.hasTag(\"PlayerCard\") then\n placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- places a card/deck at a position or merges into an existing deck\n-- rotation is optional\nfunction placeOrMergeIntoDeck(obj, pos, rot)\n if not pos then return end\n\n local offset = 0.5\n \n -- search the new position for existing card/deck\n local searchResult = searchArea(pos, { 1, 1, 1 }, isCardOrDeck)\n\n -- get new position\n local newPos\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n -- right-click allow color changing\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(isCardOrDeck)) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(isCard)) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(isCard)) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if not isCard(object) then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if not isCard(object) then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n for _, obj in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do\n if obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" and\n not tokenChecker.isChaosToken(obj) then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n local pos = self.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET)\n local rotY = self.getRotation().y\n mythosAreaApi.drawEncounterCard(pos, rotY, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"playermat/Playmat\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckLib = require(\"util/DeckLib\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\n-- we use this to turn off collision handling until onLoad() is complete\nlocal collisionEnabled = false\n\n-- x-Values for discard buttons\nlocal DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}\n\nlocal SEARCH_AROUND_SELF_X_BUFFER = 8\n\n-- defined areas for object searching\nlocal MAIN_PLAY_AREA = {\n upperLeft = {\n x = 1.98,\n z = 0.736\n },\n lowerRight = {\n x = -0.79,\n z = -0.39\n }\n}\nlocal INVESTIGATOR_AREA = {\n upperLeft = {\n x = -1.084,\n z = 0.06517\n },\n lowerRight = {\n x = -1.258,\n z = -0.0805\n }\n}\nlocal THREAT_AREA = {\n upperLeft = {\n x = 1.53,\n z = -0.34\n },\n lowerRight = {\n x = -1.13,\n z = -0.92\n }\n}\nlocal DECK_DISCARD_AREA = {\n upperLeft = {\n x = -1.62,\n z = 0.855\n },\n lowerRight = {\n x = -2.02,\n z = -0.245\n },\n center = {\n x = -1.82,\n y = 0.5,\n z = 0.305\n },\n size = {\n x = 0.4,\n y = 3,\n z = 1.1\n }\n}\n\n-- local position of draw and discard pile\nlocal DRAW_DECK_POSITION = { x = -1.82, y = 0.1, z = 0 }\nlocal DISCARD_PILE_POSITION = { x = -1.82, y = 0.1, z = 0.61 }\n\n-- global position of encounter discard pile\nlocal ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38}\n\n-- global variable so it can be reset by the Clean Up Helper\nactiveInvestigatorId = \"00000\"\n\n-- table of type-object reference pairs of all owned objects\nlocal ownedObjects = {}\nlocal matColor = self.getMemo()\n\n-- variable to track the status of the \"Show Draw Button\" option\nlocal isDrawButtonVisible = false\n\n-- global variable to report \"Dream-Enhancing Serum\" status\nisDES = false\n\nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n activeInvestigatorId = activeInvestigatorId,\n isDrawButtonVisible = isDrawButtonVisible\n })\nend\n\nfunction onLoad(saveState)\n self.interactable = false\n\n -- get object references to owned objects\n ownedObjects = guidReferenceApi.getObjectsByOwner(matColor)\n\n -- button creation\n for i = 1, 6 do\n makeDiscardButton(DISCARD_BUTTON_OFFSETS[i], i)\n end\n\n self.createButton({\n click_function = \"drawEncounterCard\",\n function_owner = self,\n position = {-1.84, 0, -0.65},\n rotation = {0, 80, 0},\n width = 265,\n height = 190\n })\n\n self.createButton({\n click_function = \"drawChaosTokenButton\",\n function_owner = self,\n position = {1.85, 0, -0.74},\n rotation = {0, -45, 0},\n width = 135,\n height = 135\n })\n\n self.createButton({\n label = \"Upkeep\",\n click_function = \"doUpkeep\",\n function_owner = self,\n position = {1.84, 0.1, -0.44},\n scale = {0.12, 0.12, 0.12},\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- save state loading\n local state = JSON.decode(saveState)\n if state ~= nil then\n playerColor = state.playerColor\n activeInvestigatorId = state.activeInvestigatorId\n isDrawButtonVisible = state.isDrawButtonVisible\n end\n\n showDrawButton(isDrawButtonVisible)\n collisionEnabled = true\n math.randomseed(os.time())\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches an area and optionally filters the result\nfunction searchArea(origin, size, filter)\n return searchLib.inArea(origin, self.getRotation(), size, filter)\nend\n\n-- finds all objects on the playmat and associated set aside zone.\nfunction searchAroundSelf(filter)\n local bounds = self.getBoundsNormalized()\n -- Increase the width to cover the set aside zone\n bounds.size.x = bounds.size.x + SEARCH_AROUND_SELF_X_BUFFER\n bounds.size.y = 1\n -- Since the cast is centered on the position, shift left or right to keep the non-set aside edge\n -- of the cast at the edge of the playmat\n -- setAsideDirection accounts for the set aside zone being on the left or right, depending on the\n -- table position of the playmat\n local setAsideDirection = bounds.center.z \u003e 0 and 1 or -1\n local localCenter = self.positionToLocal(bounds.center)\n localCenter.x = localCenter.x + setAsideDirection * SEARCH_AROUND_SELF_X_BUFFER / 2 / self.getScale().x\n return searchArea(self.positionToWorld(localCenter), bounds.size, filter)\nend\n\n-- searches the area around the draw deck and discard pile\nfunction searchDeckAndDiscardArea(filter)\n local pos = self.positionToWorld(DECK_DISCARD_AREA.center)\n local scale = self.getScale()\n local size = {\n x = DECK_DISCARD_AREA.size.x * scale.x,\n y = DECK_DISCARD_AREA.size.y, \n z = DECK_DISCARD_AREA.size.z * scale.z\n }\n return searchArea(pos, size, filter)\nend\n\nfunction doNotReady(card)\n return card.getVar(\"do_not_ready\") or false\nend\n\n-- rounds a number to the specified amount of decimal places\n---@param num Number Initial value\n---@param numDecimalPlaces Number Amount of decimal places\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n---------------------------------------------------------\n-- Discard buttons\n---------------------------------------------------------\n\n-- handles discarding for a list of objects\n---@param objList Table List of objects to discard\nfunction discardListOfObjects(objList)\n for _, obj in ipairs(objList) do\n if obj.type == \"Card\" or obj.type == \"Deck\" then\n if obj.hasTag(\"PlayerCard\") then\n deckLib.placeOrMergeIntoDeck(obj, returnGlobalDiscardPosition(), self.getRotation())\n else\n deckLib.placeOrMergeIntoDeck(obj, ENCOUNTER_DISCARD_POSITION, {x = 0, y = -90, z = 0})\n end\n -- put chaos tokens back into bag (e.g. Unrelenting)\n elseif tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n -- don't touch locked objects (like the table etc.)\n elseif not obj.getLock() then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n-- build a discard button to discard from searchPosition (number must be unique)\nfunction makeDiscardButton(xValue, number)\n local position = { xValue, 0.1, -0.94}\n local searchPosition = {-position[1], position[2], position[3] + 0.32}\n local handlerName = 'handler' .. number\n self.setVar(handlerName, function()\n local cardSizeSearch = {2, 1, 3.2}\n local globalSearchPosition = self.positionToWorld(searchPosition)\n local searchResult = searchArea(globalSearchPosition, cardSizeSearch)\n return discardListOfObjects(searchResult)\n end)\n self.createButton({\n label = \"Discard\",\n click_function = handlerName,\n function_owner = self,\n position = position,\n scale = {0.12, 0.12, 0.12},\n width = 900,\n height = 350,\n font_size = 220\n })\nend\n\n---------------------------------------------------------\n-- Upkeep button\n---------------------------------------------------------\n\n-- calls the Upkeep function with correct parameter\nfunction doUpkeepFromHotkey(color)\n doUpkeep(_, color)\nend\n\nfunction doUpkeep(_, clickedByColor, isRightClick)\n if isRightClick then\n changeColor(clickedByColor)\n return\n end\n\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or clickedByColor\n\n -- unexhaust cards in play zone, flip action tokens and find forcedLearning\n local forcedLearning = false\n local rot = self.getRotation()\n for _, obj in ipairs(searchAroundSelf()) do\n if obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n elseif obj.type == \"Card\" and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then\n local cardMetadata = JSON.decode(obj.getGMNotes()) or {}\n if not doNotReady(obj) then\n local cardRotation = round(obj.getRotation().y, 0) - rot.y\n local yRotDiff = 0\n\n if cardRotation \u003c 0 then\n cardRotation = cardRotation + 360\n end\n\n -- rotate cards to the next multiple of 90° towards 0°\n if cardRotation \u003e 90 and cardRotation \u003c= 180 then\n yRotDiff = 90\n elseif cardRotation \u003c 270 and cardRotation \u003e 180 then\n yRotDiff = 270\n end\n\n -- set correct rotation for face-down cards\n rot.z = obj.is_face_down and 180 or 0\n obj.setRotation({rot.x, rot.y + yRotDiff, rot.z})\n end\n if cardMetadata.id == \"08031\" then\n forcedLearning = true\n end\n if cardMetadata.uses ~= nil then\n tokenManager.maybeReplenishCard(obj, cardMetadata.uses, self)\n end\n end\n end\n\n -- flip investigator mini-card and summoned servitor mini-card\n -- (all characters allowed to account for custom IDs - e.g. 'Z0000' for TTS Zoop generated IDs)\n if activeInvestigatorId ~= nil then\n local miniId = string.match(activeInvestigatorId, \".....\") .. \"-m\"\n for _, obj in ipairs(getObjects()) do\n if obj.type == \"Card\" and obj.is_face_down then\n local notes = JSON.decode(obj.getGMNotes())\n if notes ~= nil and notes.type == \"Minicard\" and (notes.id == miniId or notes.id == \"09080-m\") then\n obj.flip()\n end\n end\n end\n end\n\n -- gain a resource (or two if playing Jenny Barnes)\n if string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"02003\" then\n updateCounter({type = \"ResourceCounter\", modifier = 2})\n printToColor(\"Gaining 2 resources (Jenny)\", messageColor)\n else\n updateCounter({type = \"ResourceCounter\", modifier = 1})\n end\n\n -- draw a card (with handling for Patrice and Forced Learning)\n if activeInvestigatorId == \"06005\" then\n if forcedLearning then\n printToColor(\"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.\", messageColor)\n else\n local handSize = #Player[playerColor].getHandObjects()\n if handSize \u003c 5 then\n local cardsToDraw = 5 - handSize\n printToColor(\"Drawing \" .. cardsToDraw .. \" cards (Patrice)\", messageColor)\n drawCardsWithReshuffle(cardsToDraw)\n end\n end\n elseif forcedLearning then\n printToColor(\"Drawing 2 cards, discard 1 (Forced Learning)\", messageColor)\n drawCardsWithReshuffle(2)\n elseif activeInvestigatorId == \"89001\" then\n printToColor(\"Drawing 2 cards (Subject 5U-21)\", messageColor)\n drawCardsWithReshuffle(2)\n else\n drawCardsWithReshuffle(1)\n end\nend\n\n-- function for \"draw 1 button\" (that can be added via option panel)\nfunction doDrawOne(_, color)\n -- send messages to player who clicked button if no seated player found\n messageColor = Player[playerColor].seated and playerColor or color\n drawCardsWithReshuffle(1)\nend\n\n-- draw X cards (shuffle discards if necessary)\nfunction drawCardsWithReshuffle(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n\n -- Norman Withers handling\n local harbinger = false\n if deckAreaObjects.topCard and deckAreaObjects.topCard.getName() == \"The Harbinger\" then\n harbinger = true\n elseif deckAreaObjects.draw and not deckAreaObjects.draw.is_face_down then\n local cards = deckAreaObjects.draw.getObjects()\n if cards[#cards].name == \"The Harbinger\" then\n harbinger = true\n end\n end\n\n if harbinger then\n printToColor(\"The Harbinger is on top of your deck, not drawing cards\", messageColor)\n return\n end\n\n local topCardDetected = false\n if deckAreaObjects.topCard ~= nil then\n deckAreaObjects.topCard.deal(1, playerColor)\n topCardDetected = true\n numCards = numCards - 1\n if numCards == 0 then\n flipTopCardFromDeck()\n return\n end\n end\n\n local deckSize = 1\n if deckAreaObjects.draw == nil then\n deckSize = 0\n elseif deckAreaObjects.draw.type == \"Deck\" then\n deckSize = #deckAreaObjects.draw.getObjects()\n end\n\n if deckSize \u003e= numCards then\n drawCards(numCards)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n else\n drawCards(deckSize)\n if deckAreaObjects.discard ~= nil then\n shuffleDiscardIntoDeck()\n Wait.time(function()\n drawCards(numCards - deckSize)\n -- flip top card again for Norman\n if topCardDetected and string.match(activeInvestigatorId, \"%d%d%d%d%d\") == \"08004\" then\n flipTopCardFromDeck()\n end\n end, 1)\n end\n printToColor(\"Take 1 horror (drawing card from empty deck)\", messageColor)\n end\nend\n\n-- get the draw deck and discard pile objects and returns the references\nfunction getDeckAreaObjects()\n local deckAreaObjects = {}\n for _, object in ipairs(searchDeckAndDiscardArea(\"isCardOrDeck\")) do\n if self.positionToLocal(object.getPosition()).z \u003e 0.5 then\n deckAreaObjects.discard = object\n -- Norman Withers handling\n elseif object.type == \"Card\" and not object.is_face_down then\n deckAreaObjects.topCard = object\n else\n deckAreaObjects.draw = object\n end\n end\n return deckAreaObjects\nend\n\nfunction drawCards(numCards)\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.draw then\n deckAreaObjects.draw.deal(numCards, playerColor)\n end\nend\n\nfunction shuffleDiscardIntoDeck()\n local deckAreaObjects = getDeckAreaObjects()\n if not deckAreaObjects.discard.is_face_down then\n deckAreaObjects.discard.flip()\n end\n deckAreaObjects.discard.shuffle()\n deckAreaObjects.discard.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)\nend\n\n-- utility function for Norman Withers to flip the top card to the revealed side\nfunction flipTopCardFromDeck()\n Wait.time(function()\n local deckAreaObjects = getDeckAreaObjects()\n if deckAreaObjects.topCard then\n return\n elseif deckAreaObjects.draw then\n if deckAreaObjects.draw.type == \"Card\" then\n deckAreaObjects.draw.flip()\n else\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n local pos = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n deckAreaObjects.draw.takeObject({ position = pos, flip = true })\n end\n end\n end, 0.1)\nend\n\n-- discard a random non-hidden card from hand\nfunction doDiscardOne()\n local hand = Player[playerColor].getHandObjects()\n if #hand == 0 then\n broadcastToAll(\"Cannot discard from empty hand!\", \"Red\")\n else\n local choices = {}\n for i = 1, #hand do\n local notes = JSON.decode(hand[i].getGMNotes())\n if notes ~= nil then\n if notes.hidden ~= true then\n table.insert(choices, i)\n end\n else\n table.insert(choices, i)\n end\n end\n\n if #choices == 0 then\n broadcastToAll(\"Hidden cards can't be randomly discarded.\", \"Orange\")\n return\n end\n\n -- get a random non-hidden card (from the \"choices\" table)\n local num = math.random(1, #choices)\n deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())\n broadcastToAll(playerColor .. \" randomly discarded card \" .. choices[num] .. \"/\" .. #hand .. \".\", \"White\")\n end\nend\n\n---------------------------------------------------------\n-- color related functions\n---------------------------------------------------------\n\n-- changes the player color\nfunction changeColor(clickedByColor)\n local colorList = {\n \"White\",\n \"Brown\",\n \"Red\",\n \"Orange\",\n \"Yellow\",\n \"Green\",\n \"Teal\",\n \"Blue\",\n \"Purple\",\n \"Pink\"\n }\n\n -- remove existing colors from the list of choices\n for _, existingColor in ipairs(Player.getAvailableColors()) do\n for i, newColor in ipairs(colorList) do\n if existingColor == newColor then\n table.remove(colorList, i)\n end\n end\n end\n\n -- show the option dialog for color selection to the player that triggered this\n Player[clickedByColor].showOptionsDialog(\"Select a new color:\", colorList, _, function(color)\n -- update the color of the hand zone\n local handZone = ownedObjects.HandZone\n handZone.setValue(color)\n\n -- if the seated player clicked this, reseat him to the new color\n if clickedByColor == playerColor then\n navigationOverlayApi.copyVisibility(playerColor, color)\n Player[playerColor].changeColor(color)\n end\n\n -- update the internal variable\n playerColor = color\n end)\nend\n\n---------------------------------------------------------\n-- playmat token spawning\n---------------------------------------------------------\n\n-- Finds all customizable cards in this play area and updates their metadata based on the selections\n-- on the matching upgrade sheet.\n-- This method is theoretically O(n^2), and should be used sparingly. In practice it will only be\n-- called when a checkbox is added or removed in-game (which should be rare), and is bounded by the\n-- number of customizable cards in play.\nfunction syncAllCustomizableCards()\n for _, card in ipairs(searchAroundSelf(\"isCard\")) do\n syncCustomizableMetadata(card)\n end\nend\n\nfunction syncCustomizableMetadata(card)\n local cardMetadata = JSON.decode(card.getGMNotes()) or { }\n if cardMetadata == nil or cardMetadata.customizations == nil then\n return\n end\n for _, upgradeSheet in ipairs(searchAroundSelf(\"isCard\")) do\n local upgradeSheetMetadata = JSON.decode(upgradeSheet.getGMNotes()) or { }\n if upgradeSheetMetadata.id == (cardMetadata.id .. \"-c\") then\n for i, customization in ipairs(cardMetadata.customizations) do\n if customization.replaces ~= nil and customization.replaces.uses ~= nil then\n -- Allowed use of call(), no APIs for individual cards\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n cardMetadata.uses = customization.replaces.uses\n card.setGMNotes(JSON.encode(cardMetadata))\n else\n -- TODO: Get the original metadata to restore it... maybe. This should only be\n -- necessary in the very unlikely case that a user un-checks a previously-full upgrade\n -- row while the card is in play. It will be much easier once the AllPlayerCardsApi is\n -- in place, so defer until it is\n end\n end\n end\n end\n end\nend\n\nfunction spawnTokensFor(object)\n local extraUses = { }\n if activeInvestigatorId == \"03004\" then\n extraUses[\"Charge\"] = 1\n end\n\n tokenManager.spawnForCard(object, extraUses)\nend\n\nfunction onCollisionEnter(collisionInfo)\n local object = collisionInfo.collision_object\n\n -- only continue if loading is completed\n if not collisionEnabled then return end\n\n -- only continue for cards\n if object.type ~= \"Card\" then return end\n\n -- detect if \"Dream-Enhancing Serum\" is placed\n if object.getName() == \"Dream-Enhancing Serum\" then isDES = true end\n\n maybeUpdateActiveInvestigator(object)\n syncCustomizableMetadata(object)\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n elseif shouldSpawnTokens(object) then\n spawnTokensFor(object)\n end\nend\n\n-- detect if \"Dream-Enhancing Serum\" is removed\nfunction onCollisionExit(collisionInfo)\n if collisionInfo.collision_object.getName() == \"Dream-Enhancing Serum\" then isDES = false end\nend\n\n-- checks if tokens should be spawned for the provided card\nfunction shouldSpawnTokens(card)\n if card.is_face_down then\n return false\n end\n\n local localCardPos = self.positionToLocal(card.getPosition())\n local metadata = JSON.decode(card.getGMNotes())\n\n -- If no metadata we don't know the type, so only spawn in the main area\n if metadata == nil then\n return inArea(localCardPos, MAIN_PLAY_AREA)\n end\n\n -- Spawn tokens for assets and events on the main area\n if inArea(localCardPos, MAIN_PLAY_AREA)\n and (metadata.type == \"Asset\"\n or metadata.type == \"Event\") then\n return true\n end\n\n -- Spawn tokens for all encounter types in the threat area\n if inArea(localCardPos, THREAT_AREA)\n and (metadata.type == \"Treachery\"\n or metadata.type == \"Enemy\"\n or metadata.weakness) then\n return true\n end\n\n return false\nend\n\nfunction onObjectEnterContainer(container, object)\n if object.type ~= \"Card\" then return end\n\n local localCardPos = self.positionToLocal(object.getPosition())\n if inArea(localCardPos, DECK_DISCARD_AREA) then\n tokenManager.resetTokensSpawned(object)\n removeTokensFromObject(object)\n end\nend\n\n-- removes tokens from the provided card/deck\nfunction removeTokensFromObject(object)\n if object.hasTag(\"CardThatSeals\") then\n local func = object.getVar(\"resetSealedTokens\") -- check if function exists (it won't for older custom content)\n if func ~= nil then\n object.call(\"resetSealedTokens\")\n end\n end\n\n for _, obj in ipairs(searchLib.onObject(object)) do\n if tokenChecker.isChaosToken(obj) then\n chaosBagApi.returnChaosTokenToBag(obj)\n elseif obj.getGUID() ~= \"4ee1f2\" and -- table\n obj ~= self and\n obj.type ~= \"Deck\" and\n obj.type ~= \"Card\" and\n obj.memo ~= nil and\n obj.getLock() == false and\n obj.getDescription() ~= \"Action Token\" then\n ownedObjects.Trash.putObject(obj)\n end\n end\nend\n\n---------------------------------------------------------\n-- investigator ID grabbing and skill tracker\n---------------------------------------------------------\n\nfunction maybeUpdateActiveInvestigator(card)\n if not inArea(self.positionToLocal(card.getPosition()), INVESTIGATOR_AREA) then return end\n\n local notes = JSON.decode(card.getGMNotes())\n local class\n\n if notes ~= nil and notes.type == \"Investigator\" and notes.id ~= nil then\n if notes.id == activeInvestigatorId then return end\n class = notes.class\n activeInvestigatorId = notes.id\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {\n notes.willpowerIcons,\n notes.intellectIcons,\n notes.combatIcons,\n notes.agilityIcons\n })\n elseif activeInvestigatorId ~= \"00000\" then\n class = \"Neutral\"\n activeInvestigatorId = \"00000\"\n ownedObjects.InvestigatorSkillTracker.call(\"updateStats\", {1, 1, 1, 1})\n else\n return\n end\n\n -- change state of action tokens\n local search = searchArea(self.positionToWorld({-1.1, 0.05, -0.27}), {4, 1, 1})\n local smallToken = nil\n local STATE_TABLE = {\n [\"Guardian\"] = 1,\n [\"Seeker\"] = 2,\n [\"Rogue\"] = 3,\n [\"Mystic\"] = 4,\n [\"Survivor\"] = 5,\n [\"Neutral\"] = 6\n }\n\n for _, obj in ipairs(search) do\n if obj.getDescription() == \"Action Token\" and obj.getStateId() \u003e 0 then\n if obj.getScale().x \u003c 0.4 then\n smallToken = obj\n else\n setObjectState(obj, STATE_TABLE[class])\n end\n end\n end\n\n -- update the small token with special action for certain investigators\n local SPECIAL_ACTIONS = {\n [\"04002\"] = 8, -- Ursula Downs\n [\"01002\"] = 9, -- Daisy Walker\n [\"01502\"] = 9, -- Daisy Walker\n [\"01002-pb\"] = 9, -- Daisy Walker\n [\"06003\"] = 10, -- Tony Morgan\n [\"04003\"] = 11, -- Finn Edwards\n [\"08016\"] = 14 -- Bob Jenkins\n }\n\n if smallToken ~= nil then\n setObjectState(smallToken, SPECIAL_ACTIONS[activeInvestigatorId] or STATE_TABLE[class])\n end\nend\n\nfunction setObjectState(obj, stateId)\n if obj.getStateId() ~= stateId then obj.setState(stateId) end\nend\n\n---------------------------------------------------------\n-- manipulation of owned objects\n---------------------------------------------------------\n\n-- updates the specific owned counter\n---@param param Table Contains the information to update:\n--- type: String Counter to target\n--- newValue: Number Value to set the counter to\n--- modifier: Number If newValue is not provided, the existing value will be adjusted by this modifier\nfunction updateCounter(param)\n local counter = ownedObjects[param.type]\n if counter ~= nil then\n counter.call(\"updateVal\", param.newValue or (counter.getVar(\"val\") + param.modifier))\n else\n printToAll(param.type .. \" for \" .. matColor .. \" could not be found.\", \"Yellow\")\n end\nend\n\n-- returns the resource counter amount\n---@param type String Counter to target\nfunction getCounterValue(type)\n return ownedObjects[type].getVar(\"val\")\nend\n\n-- set investigator skill tracker to \"1, 1, 1, 1\"\nfunction resetSkillTracker()\n local obj = ownedObjects.InvestigatorSkillTracker\n if obj ~= nil then\n obj.call(\"updateStats\", { 1, 1, 1, 1 })\n else\n printToAll(\"Skill tracker for \" .. matColor .. \" playmat could not be found.\", \"Yellow\")\n end\nend\n\n---------------------------------------------------------\n-- calls to 'Global' / functions for calls from outside\n---------------------------------------------------------\n\nfunction drawChaosTokenButton(_, _, isRightClick)\n chaosBagApi.drawChaosToken(self, isRightClick)\nend\n\nfunction drawEncounterCard(_, _, isRightClick)\n mythosAreaApi.drawEncounterCard(self, isRightClick)\nend\n\nfunction returnGlobalDiscardPosition()\n return self.positionToWorld(DISCARD_PILE_POSITION)\nend\n\n-- Sets this playermat's draw 1 button to visible\n---@param visible Boolean. Whether the draw 1 button should be visible\nfunction showDrawButton(visible)\n isDrawButtonVisible = visible\n\n -- create the \"Draw 1\" button\n if isDrawButtonVisible then\n self.createButton({\n label = \"Draw 1\",\n click_function = \"doDrawOne\",\n function_owner = self,\n position = { 1.84, 0.1, -0.36 },\n scale = { 0.12, 0.12, 0.12 },\n width = 800,\n height = 280,\n font_size = 180\n })\n\n -- remove the \"Draw 1\" button\n else\n local buttons = self.getButtons()\n for i = 1, #buttons do\n if buttons[i].label == \"Draw 1\" then\n self.removeButton(buttons[i].index)\n end\n end\n end\nend\n\n-- shows / hides a clickable clue counter for this playmat and sets the correct amount of clues\n---@param showCounter Boolean Whether the clickable clue counter should be visible\nfunction clickableClues(showCounter)\n local clickerPos = ownedObjects.ClickableClueCounter.getPosition()\n local clueCount = 0\n \n -- move clue counters\n local modY = showCounter and 0.525 or -0.525\n ownedObjects.ClickableClueCounter.setPosition(clickerPos + Vector(0, modY, 0))\n\n if showCounter then\n -- current clue count\n clueCount = ownedObjects.ClueCounter.getVar(\"exposedValue\")\n\n -- remove clues\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n\n -- set value for clue clickers\n ownedObjects.ClickableClueCounter.call(\"updateVal\", clueCount)\n else\n -- current clue count\n clueCount = ownedObjects.ClickableClueCounter.getVar(\"val\")\n\n -- spawn clues\n local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})\n for i = 1, clueCount do\n pos.y = pos.y + 0.045 * i\n tokenManager.spawnToken(pos, \"clue\", self.getRotation())\n end\n end\nend\n\n-- removes all clues (moving tokens to the trash and setting counters to 0)\nfunction removeClues()\n ownedObjects.ClueCounter.call(\"removeAllClues\", ownedObjects.Trash)\n ownedObjects.ClickableClueCounter.call(\"updateVal\", 0)\nend\n\n-- reports the clue count\n---@param useClickableCounters Boolean Controls which type of counter is getting checked\nfunction getClueCount(useClickableCounters)\n if useClickableCounters then\n return ownedObjects.ClickableClueCounter.getVar(\"val\")\n else\n return ownedObjects.ClueCounter.getVar(\"exposedValue\")\n end\nend\n\n-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes\n-- is true, the main card slot snap points will only snap assets, while the investigator area point\n-- will only snap Investigators. If matchTypes is false, snap points will be reset to snap all\n-- cards.\n---@param matchTypes Boolean. Whether snap points should only snap for the matching card types.\nfunction setLimitSnapsByType(matchTypes)\n local snaps = self.getSnapPoints()\n for i, snap in ipairs(snaps) do\n local snapPos = snap.position\n if inArea(snapPos, MAIN_PLAY_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Asset\" }\n else\n table.insert(snaps[i].tags, \"Asset\")\n end\n else\n snaps[i].tags = nil\n end\n end\n if inArea(snapPos, INVESTIGATOR_AREA) then\n local snapTags = snaps[i].tags\n if matchTypes then\n if snapTags == nil then\n snaps[i].tags = { \"Investigator\" }\n else\n table.insert(snaps[i].tags, \"Investigator\")\n end\n else\n snaps[i].tags = nil\n end\n end\n end\n self.setSnapPoints(snaps)\nend\n\n-- Simple method to check if the given point is in a specified area. Local use only,\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within. See MAIN_PLAY_AREA for sample\n-- bounds definition.\n---@return Boolean True if the point is in the area defined by bounds\nfunction inArea(point, bounds)\n return (point.x \u003c bounds.upperLeft.x\n and point.x \u003e bounds.lowerRight.x\n and point.z \u003c bounds.upperLeft.z\n and point.z \u003e bounds.lowerRight.z)\nend\n\n-- called by custom data helpers to add player card data\n---@param args table Contains only one entry, the GUID of the custom data helper\nfunction updatePlayerCards(args)\n local customDataHelper = getObjectFromGUID(args[1])\n local playerCardData = customDataHelper.getTable(\"PLAYER_CARD_DATA\")\n tokenManager.addPlayerCardData(playerCardData)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"util/DeckLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckLib = {}\n local searchLib = require(\"util/SearchLib\")\n\n -- places a card/deck at a position or merges into an existing deck\n ---@param obj TTSObject Object to move\n ---@param pos Table New position for the object\n ---@param rot Table New rotation for the object (optional)\n DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)\n if obj == nil or pos == nil then return end\n\n -- search the new position for existing card/deck\n local searchResult = searchLib.atPosition(pos, \"isCardOrDeck\")\n\n -- get new position\n local newPos\n local offset = 0.5\n if #searchResult == 1 then\n local bounds = searchResult[1].getBounds()\n newPos = Vector(pos):setAt(\"y\", bounds.center.y + bounds.size.y / 2 + offset)\n else\n newPos = Vector(pos) + Vector(0, offset, 0)\n end\n\n -- allow moving the objects smoothly out of the hand\n obj.use_hands = false\n\n if rot then\n obj.setRotationSmooth(rot, false, true)\n end\n obj.setPositionSmooth(newPos, false, true)\n\n -- continue if the card stops smooth moving\n Wait.condition(\n function()\n obj.use_hands = true\n -- this avoids a TTS bug that merges unrelated cards that are not resting\n if #searchResult == 1 and searchResult[1] ~= obj then\n -- call this with avoiding errors (physics is sometimes too fast so the object doesn't exist for the put)\n pcall(function() searchResult[1].putObject(obj) end)\n end\n end,\n function() return not obj.isSmoothMoving() end, 3)\n end\n\n return DeckLib\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/Playmat\")\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"activeInvestigatorId\":\"00000\",\"isDrawButtonVisible\":false,\"playerColor\":\"Red\"}", "MeasureMovement": false, "Memo": "Red", @@ -89346,7 +88146,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/DeckImporterMain\")\nend)\n__bundle_register(\"arkhamdb/DeckImporterMain\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/DeckImporterUi\")\nrequire(\"playercards/PlayerCardSpawner\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\nlocal arkhamDb = require(\"arkhamdb/ArkhamDb\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal zones = require(\"playermat/Zones\")\n\nfunction onLoad(script_state)\n initializeUi(JSON.decode(script_state))\n math.randomseed(os.time())\n arkhamDb.initialize()\nend\n\nfunction onSave() return JSON.encode(getUiState()) end\n\n-- Returns the zone name where the specified card should be placed, based on its metadata.\n---@param cardMetadata Table of card metadata.\n---@return Zone String Name of the zone such as \"Deck\", \"SetAside1\", etc.\n-- See Zones object documentation for a list of valid zones.\nfunction getDefaultCardZone(cardMetadata, bondedList)\n if (cardMetadata.id == \"09080-m\") then -- Have to check the Servitor before other minicards\n return \"SetAside6\"\n elseif (cardMetadata.id == \"09006\") then -- On The Mend is set aside\n return \"SetAside2\"\n elseif cardMetadata.type == \"Investigator\" then\n return \"Investigator\"\n elseif cardMetadata.type == \"Minicard\" then\n return \"Minicard\"\n elseif cardMetadata.type == \"UpgradeSheet\" then\n return \"SetAside4\"\n elseif cardMetadata.startsInPlay then\n return \"BlankTop\"\n elseif cardMetadata.permanent then\n return \"SetAside1\"\n elseif bondedList[cardMetadata.id] then\n return \"SetAside2\"\n -- SetAside3 is used for Ancestral Knowledge / Underworld Market\n else\n return \"Deck\"\n end\nend\n\nfunction buildDeck(playerColor, deckId)\n local uiState = getUiState()\n arkhamDb.getDecklist(\n playerColor,\n deckId,\n uiState.private,\n uiState.loadNewest,\n uiState.investigators,\n loadCards)\nend\n\n-- Process the slot list, which defines the card Ids and counts of cards to load. Spawn those cards\n-- at the appropriate zones and report an error to the user if any could not be loaded.\n-- This is a callback function which handles the results of ArkhamDb.getDecklist()\n-- This method uses an encapsulated coroutine with yields to make the card spawning cleaner.\n--\n---@param slots Table Key-Value table of cardId:count. cardId is the ArkhamDB ID of the card to spawn,\n-- and count is the number which should be spawned\n---@param investigatorId String ArkhamDB ID (code) for this deck's investigator.\n-- Investigator cards should already be added to the slots list if they\n-- should be spawned, but this value is separate to check for special\n-- handling for certain investigators\n---@param bondedList Table A table of cardID keys to meaningless values. Card IDs in this list were added\n-- from a parent bonded card.\n---@param customizations String ArkhamDB data for customizations on customizable cards\n---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n---@param loadAltInvestigator String Contains the name of alternative art for the investigator (\"normal\", \"revised\" or \"promo\")\nfunction loadCards(slots, investigatorId, bondedList, customizations, playerColor, loadAltInvestigator)\n function coinside()\n local yPos = {}\n local cardsToSpawn = {}\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if card ~= nil then\n local cardZone = getDefaultCardZone(card.metadata, bondedList)\n for i = 1, cardCount do\n table.insert(cardsToSpawn, { data = card.data, metadata = card.metadata, zone = cardZone })\n end\n\n slots[cardId] = 0\n end\n end\n\n handleAncestralKnowledge(cardsToSpawn)\n handleUnderworldMarket(cardsToSpawn, playerColor)\n handleHunchDeck(investigatorId, cardsToSpawn, playerColor)\n handleSpiritDeck(investigatorId, cardsToSpawn, playerColor)\n handleCustomizableUpgrades(cardsToSpawn, customizations)\n handlePeteSignatureAssets(investigatorId, cardsToSpawn)\n\n -- Split the card list into separate lists for each zone\n local zoneDecks = buildZoneLists(cardsToSpawn)\n -- Spawn the list for each zone\n for zone, zoneCards in pairs(zoneDecks) do\n local deckPos = zones.getZonePosition(playerColor, zone)\n deckPos.y = 3\n\n local callback = nil\n -- If cards are spread too close together TTS groups them weirdly, selecting multiples\n -- when hovering over a single card. This distance is the minimum to avoid that\n local spreadDistance = 1.15\n if (zone == \"SetAside4\") then\n -- SetAside4 is reserved for customization cards, and we want them spread on the table\n -- so their checkboxes are visible\n -- TO-DO: take into account that spreading will make multiple rows\n -- (this is affected by the user's local settings!)\n if (playerColor == \"White\") then\n deckPos.z = deckPos.z + (#zoneCards - 1) * spreadDistance\n elseif (playerColor == \"Green\") then\n deckPos.x = deckPos.x + (#zoneCards - 1) * spreadDistance\n end\n callback = function(deck) deck.spread(spreadDistance) end\n elseif zone == \"Deck\" then\n callback = function(deck) deckSpawned(deck, playerColor) end\n elseif zone == \"Investigator\" or zone == \"Minicard\" then\n callback = function(card) loadAltArt(card, loadAltInvestigator) end\n end\n Spawner.spawnCards(\n zoneCards,\n deckPos,\n zones.getDefaultCardRotation(playerColor, zone),\n true, -- Sort deck\n callback)\n\n coroutine.yield(0)\n end\n\n -- Look for any cards which haven't been loaded\n local hadError = false\n for cardId, remainingCount in pairs(slots) do\n if remainingCount \u003e 0 then\n hadError = true\n arkhamDb.logCardNotFound(cardId, playerColor)\n end\n end\n if (not hadError) then\n printToAll(\"Deck loaded successfully!\", playerColor)\n end\n return 1\n end\n\n startLuaCoroutine(self, \"coinside\")\nend\n\n-- Callback handler for the main deck spawning. Looks for cards which should start in hand, and\n-- draws them for the appropriate player.\n---@param deck Object Callback-provided spawned deck object\n---@param playerColor String Color of the player to draw the cards to\nfunction deckSpawned(deck, playerColor)\n local player = Player[playmatApi.getPlayerColor(playerColor)]\n local handPos = player.getHandTransform(1).position -- Only one hand zone per player\n local deckCards = deck.getData().ContainedObjects\n -- Process in reverse order so taking cards out doesn't upset the indexing\n for i = #deckCards, 1, -1 do\n local cardMetadata = JSON.decode(deckCards[i].GMNotes) or { }\n if cardMetadata.startsInHand then\n deck.takeObject({ index = i - 1, position = handPos, flip = true, smooth = true})\n end\n end\nend\n\n-- Converts the Raven Quill's selections from card IDs to card names. This could be more elegant\n-- but the inputs are very static so we're using some brute force.\n---@param selectionString String provided by ArkhamDB, indicates the customization selections\n-- Should be either a single card ID or two separated by a ^ (e.g. XXXXX^YYYYY)\nfunction convertRavenQuillSelections(selectionString)\n if (string.len(selectionString) == 5) then\n return getCardName(selectionString)\n elseif (string.len(selectionString) == 11) then\n return getCardName(string.sub(selectionString, 1, 5)) .. \", \" .. getCardName(string.sub(selectionString, 7))\n end\nend\n\n-- Converts Grizzled's selections from a single string with \"^\".\n---@param selectionString String provided by ArkhamDB, indicates the customization selections\n-- Should be two Traits separated by a ^ (e.g. XXXXX^YYYYY)\nfunction convertGrizzledSelections(selectionString)\n return selectionString:gsub(\"%^\", \", \")\nend\n\n-- Returns the simple name of a card given its ID. This will find the card and strip any trailing\n-- SCED-specific suffixes such as (Taboo) or (Level)\nfunction getCardName(cardId)\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil) then\n local name = card.data.Nickname\n if (string.find(name, \" %(\")) then\n return string.sub(name, 1, string.find(name, \" %(\") - 1)\n else\n return name\n end\n end\nend\n\n-- Split a single list of cards into a separate table of lists, keyed by the zone\n---@param cards: Table of {cardData, cardMetadata, zone}\n---@return: Table of {zoneName=card list}\nfunction buildZoneLists(cards)\n local zoneList = {}\n for _, card in ipairs(cards) do\n if zoneList[card.zone] == nil then\n zoneList[card.zone] = {}\n end\n table.insert(zoneList[card.zone], card)\n end\n\n return zoneList\nend\n\n-- Check to see if the deck list has Ancestral Knowledge. If it does, move 5 random skills to SetAside3\n---@param cardList Table Deck list being created\nfunction handleAncestralKnowledge(cardList)\n local hasAncestralKnowledge = false\n local skillList = {}\n -- Have to process the entire list to check for Ancestral Knowledge and get all possible skills, so do both in one pass\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"07303\" then\n hasAncestralKnowledge = true\n card.zone = \"SetAside3\"\n elseif (card.metadata.type == \"Skill\"\n and card.zone == \"Deck\"\n and not card.metadata.weakness) then\n table.insert(skillList, i)\n end\n end\n if hasAncestralKnowledge then\n for i = 1, 5 do\n -- Move 5 random skills to SetAside3\n local skillListIndex = math.random(#skillList)\n cardList[skillList[skillListIndex]].zone = \"UnderSetAside3\"\n table.remove(skillList, skillListIndex)\n end\n end\nend\n\n-- Check for and handle Underworld Market by moving all Illicit cards to UnderSetAside3\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleUnderworldMarket(cardList, playerColor)\n local hasMarket = false\n local illicitList = {}\n -- Process the entire list to check for Underworld Market and get all possible skills, doing both in one pass\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"09077\" then\n -- Underworld Market found\n hasMarket = true\n card.zone = \"SetAside3\"\n elseif card.metadata.traits ~= nil and string.find(card.metadata.traits, \"Illicit\", 1, true) and card.zone == \"Deck\" then\n table.insert(illicitList, i)\n end\n end\n\n if hasMarket then\n if #illicitList \u003c 10 then\n printToAll(\"Only \" .. #illicitList ..\n \" Illicit cards in your deck, you can't trigger Underworld Market's ability.\",\n playerColor)\n else\n -- Process cards to move them to the market deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #illicitList, 1, -1 do\n local moving = cardList[illicitList[i]]\n moving.zone = \"UnderSetAside3\"\n table.remove(cardList, illicitList[i])\n table.insert(cardList, moving)\n end\n\n if #illicitList \u003e 10 then\n printToAll(\"Moved all \" .. #illicitList ..\n \" Illicit cards to the Market deck, reduce it to 10\",\n playerColor)\n else\n printToAll(\"Built the Market deck\", playerColor)\n end\n end\n end\nend\n\n-- If the investigator is Joe Diamond, extract all Insight events to SetAside5 to build the Hunch\n-- Deck.\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleHunchDeck(investigatorId, cardList, playerColor)\n if investigatorId == \"05002\" then -- Joe Diamond\n local insightList = {}\n for i, card in ipairs(cardList) do\n if (card.metadata.type == \"Event\"\n and card.metadata.traits ~= nil\n and string.match(card.metadata.traits, \"Insight\")\n and card.metadata.bonded_to == nil) then\n table.insert(insightList, i)\n end\n end\n -- Process insights to move them to the hunch deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #insightList, 1, -1 do\n local moving = cardList[insightList[i]]\n moving.zone = \"SetAside5\"\n table.remove(cardList, insightList[i])\n table.insert(cardList, moving)\n end\n if #insightList \u003c 11 then\n printToAll(\"Joe's hunch deck must have 11 cards but the deck only has \" .. #insightList ..\n \" Insight events.\", playerColor)\n elseif #insightList \u003e 11 then\n printToAll(\"Moved all \" .. #insightList ..\n \" Insight events to the hunch deck, reduce it to 11.\", playerColor)\n else\n printToAll(\"Built Joe's hunch deck\", playerColor)\n end\n end\nend\n\n-- If the investigator is Parallel Jim Culver, extract all Ally assets to SetAside5 to build the Spirit\n-- Deck.\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleSpiritDeck(investigatorId, cardList, playerColor)\n if investigatorId == \"02004-p\" or investigatorId == \"02004-pb\" then -- Parallel Jim Culver\n local spiritList = {}\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"90053\" or (\n card.metadata.type == \"Asset\"\n and card.metadata.traits ~= nil\n and string.match(card.metadata.traits, \"Ally\")\n and card.metadata.level ~= nil\n and card.metadata.level \u003c 3) then\n table.insert(spiritList, i)\n end\n end\n -- Process allies to move them to the spirit deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #spiritList, 1, -1 do\n local moving = cardList[spiritList[i]]\n moving.zone = \"SetAside5\"\n table.remove(cardList, spiritList[i])\n table.insert(cardList, moving)\n end\n if #spiritList \u003c 10 then\n printToAll(\"Jim's spirit deck must have 9 Ally assets but the deck only has \" .. (#spiritList - 1) ..\n \" Ally assets.\", playerColor)\n elseif #spiritList \u003e 11 then\n printToAll(\"Moved all \" .. (#spiritList - 1) ..\n \" Ally assets to the spirit deck, reduce it to 10 (including Vengeful Shade).\", playerColor)\n else\n printToAll(\"Built Jim's spirit deck\", playerColor)\n end\n end\nend\n\n-- For any customization upgrade cards in the card list, process the metadata from the deck to\n-- set the save state to show the correct checkboxes/text field values\n---@param cardList Table Deck list being created\n---@param customizations Table Deck's meta table, extracted from ArkhamDB's deck structure\nfunction handleCustomizableUpgrades(cardList, customizations)\n for _, card in ipairs(cardList) do\n if card.metadata.type == \"UpgradeSheet\" then\n local baseId = string.sub(card.metadata.id, 1, 5)\n local upgrades = customizations[\"cus_\" .. baseId]\n\n if upgrades ~= nil then\n -- initialize tables\n -- markedBoxes: contains the amount of markedBoxes (left to right) per row (starting at row 1)\n -- inputValues: contains the amount of inputValues per row (starting at row 0)\n local selectedUpgrades = { }\n local index_xp = {}\n\n -- get the index and xp values (looks like this: X|X,X|X, ..)\n -- input string from ArkhamDB is split by \",\"\n for str in string.gmatch(customizations[\"cus_\" .. baseId], \"([^,]+)\") do\n table.insert(index_xp, str)\n end\n\n -- split each pair and assign it to the proper position in markedBoxes\n for _, entry in ipairs(index_xp) do\n -- counter increments from 1 to 3 and indicates the part of the string we are on\n -- usually: 1 = row, 2 = amount of check boxes, 3 = entry in inputfield\n local counter = 0\n local row = 0\n\n -- parsing the string for each row\n for str in entry:gmatch(\"([^|]+)\") do\n counter = counter + 1\n\n if counter == 1 then\n row = tonumber(str) + 1\n elseif counter == 2 then\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n end\n selectedUpgrades[row].xp = tonumber(str)\n elseif counter == 3 and str ~= \"\" then\n if baseId == \"09042\" then\n selectedUpgrades[row].text = convertRavenQuillSelections(str)\n elseif baseId == \"09101\" then\n selectedUpgrades[row].text = convertGrizzledSelections(str)\n elseif baseId == \"09079\" then -- Living Ink skill selection\n -- All skills, regardless of row, are placed in upgrade slot 1 as a comma-delimited\n -- list\n if selectedUpgrades[1].text == nil then\n selectedUpgrades[1].text = str\n else\n selectedUpgrades[1].text = selectedUpgrades[1].text .. \",\" .. str\n end\n else\n selectedUpgrades[row].text = str\n end\n end\n end\n end\n\n -- write the loaded values to the save_data of the sheets\n card.data[\"LuaScriptState\"] = JSON.encode({ selections = selectedUpgrades })\n end\n end\n end\nend\n\n-- Handles cards that start in play under specific conditions for Ashcan Pete (Regular Pete - Duke, Parallel Pete - Guitar)\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\nfunction handlePeteSignatureAssets(investigatorId, cardList)\n if investigatorId == \"02005\" or investigatorId == \"02005-pb\" then -- regular Pete's front\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"02014\" then -- Duke\n card.zone = \"BlankTop\"\n end\n end\n elseif investigatorId == \"02005-p\" or investigatorId == \"02005-pf\" then -- parallel Pete's front\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"90047\" then -- Pete's Guitar\n card.zone = \"BlankTop\"\n end\n end\n end\nend\n\n-- Callback function for investigator cards and minicards to set the correct state for alt art\n---@param card Object Card which needs to be set the state for\n---@param loadAltInvestigator String Contains the name of alternative art for the investigator (\"normal\", \"revised\" or \"promo\")\nfunction loadAltArt(card, loadAltInvestigator)\n -- states are set up this way:\n -- 1 - normal, 2 - revised/promo, 3 - promo (if 2 is revised)\n -- This means we can always load the 2nd state for revised and just get the last state for promo\n if loadAltInvestigator == \"normal\" then\n return\n elseif loadAltInvestigator == \"revised\" then\n card.setState(2)\n elseif loadAltInvestigator == \"promo\" then\n local states = card.getStates()\n card.setState(#states)\n end\nend\nend)\n__bundle_register(\"arkhamdb/DeckImporterUi\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\nlocal INPUT_FIELD_HEIGHT = 340\nlocal INPUT_FIELD_WIDTH = 1500\nlocal FIELD_COLOR = { 0.9, 0.7, 0.5 }\n\nlocal PRIVATE_TOGGLE_LABELS = {}\nPRIVATE_TOGGLE_LABELS[true] = \"Private\"\nPRIVATE_TOGGLE_LABELS[false] = \"Published\"\n\nlocal UPGRADED_TOGGLE_LABELS = {}\nUPGRADED_TOGGLE_LABELS[true] = \"Upgraded\"\nUPGRADED_TOGGLE_LABELS[false] = \"Specific\"\n\nlocal LOAD_INVESTIGATOR_TOGGLE_LABELS = {}\nLOAD_INVESTIGATOR_TOGGLE_LABELS[true] = \"Yes\"\nLOAD_INVESTIGATOR_TOGGLE_LABELS[false] = \"No\"\n\nlocal redDeckId = \"\"\nlocal orangeDeckId = \"\"\nlocal whiteDeckId = \"\"\nlocal greenDeckId = \"\"\n\nlocal privateDeck = true\nlocal loadNewestDeck = true\nlocal loadInvestigators = false\n\n-- Returns a table with the full state of the UI, including options and deck IDs.\n-- This can be used to persist via onSave(), or provide values for a load operation\n-- Table values:\n-- redDeck: Deck ID to load for the red player\n-- orangeDeck: Deck ID to load for the orange player\n-- whiteDeck: Deck ID to load for the white player\n-- greenDeck: Deck ID to load for the green player\n-- private: True to load a private deck, false to load a public deck\n-- loadNewest: True if the most upgraded version of the deck should be loaded\n-- investigators: True if investigator cards should be spawned\nfunction getUiState()\n return {\n redDeck = redDeckId,\n orangeDeck = orangeDeckId,\n whiteDeck = whiteDeckId,\n greenDeck = greenDeckId,\n private = privateDeck,\n loadNewest = loadNewestDeck,\n investigators = loadInvestigators\n }\nend\n\n-- Updates the state of the UI based on the provided table. Any values not provided will be left the same.\n---@param uiStateTable Table of values to update on importer\n-- Table values:\n-- redDeck: Deck ID to load for the red player\n-- orangeDeck: Deck ID to load for the orange player\n-- whiteDeck: Deck ID to load for the white player\n-- greenDeck: Deck ID to load for the green player\n-- private: True to load a private deck, false to load a public deck\n-- loadNewest: True if the most upgraded version of the deck should be loaded\n-- investigators: True if investigator cards should be spawned\nfunction setUiState(uiStateTable)\n self.clearButtons()\n self.clearInputs()\n initializeUi(uiStateTable)\nend\n\n-- Sets up the UI for the deck loader, populating fields from the given save state table decoded from onLoad()\nfunction initializeUi(savedUiState)\n if savedUiState ~= nil then\n redDeckId = savedUiState.redDeck\n orangeDeckId = savedUiState.orangeDeck\n whiteDeckId = savedUiState.whiteDeck\n greenDeckId = savedUiState.greenDeck\n privateDeck = savedUiState.private\n loadNewestDeck = savedUiState.loadNewest\n loadInvestigators = savedUiState.investigators\n end\n\n makeOptionToggles()\n makeDeckIdFields()\n makeBuildButton()\nend\n\nfunction makeOptionToggles()\n -- common parameters\n local checkbox_parameters = {}\n checkbox_parameters.function_owner = self\n checkbox_parameters.width = INPUT_FIELD_WIDTH\n checkbox_parameters.height = INPUT_FIELD_HEIGHT\n checkbox_parameters.scale = { 0.1, 0.1, 0.1 }\n checkbox_parameters.font_size = 240\n checkbox_parameters.hover_color = { 0.4, 0.6, 0.8 }\n checkbox_parameters.color = FIELD_COLOR\n\n -- public / private deck\n checkbox_parameters.click_function = \"publicPrivateChanged\"\n checkbox_parameters.position = { 0.25, 0.1, -0.102 }\n checkbox_parameters.tooltip = \"Published or private deck?\\n\\nPLEASE USE A PRIVATE DECK IF JUST FOR TTS TO AVOID FLOODING ARKHAMDB PUBLISHED DECK LISTS!\"\n checkbox_parameters.label = PRIVATE_TOGGLE_LABELS[privateDeck]\n self.createButton(checkbox_parameters)\n\n -- load upgraded?\n checkbox_parameters.click_function = \"loadUpgradedChanged\"\n checkbox_parameters.position = { 0.25, 0.1, -0.01 }\n checkbox_parameters.tooltip = \"Load newest upgrade or exact deck?\"\n checkbox_parameters.label = UPGRADED_TOGGLE_LABELS[loadNewestDeck]\n self.createButton(checkbox_parameters)\n\n -- load investigators?\n checkbox_parameters.click_function = \"loadInvestigatorsChanged\"\n checkbox_parameters.position = { 0.25, 0.1, 0.081 }\n checkbox_parameters.tooltip = \"Spawn investigator cards?\"\n checkbox_parameters.label = LOAD_INVESTIGATOR_TOGGLE_LABELS[loadInvestigators]\n self.createButton(checkbox_parameters)\nend\n\n-- Create the four deck ID entry fields\nfunction makeDeckIdFields()\n local input_parameters = {}\n -- Parameters common to all entry fields\n input_parameters.function_owner = self\n input_parameters.scale = { 0.1, 0.1, 0.1 }\n input_parameters.width = INPUT_FIELD_WIDTH\n input_parameters.height = INPUT_FIELD_HEIGHT\n input_parameters.font_size = 320\n input_parameters.tooltip = \"Deck ID from ArkhamDB URL of the deck\\nPublic URL: 'https://arkhamdb.com/decklist/view/101/knowledge-overwhelming-solo-deck-1.0' = '101'\\nPrivate URL: 'https://arkhamdb.com/deck/view/102' = '102'\"\n input_parameters.alignment = 3 -- Center\n input_parameters.color = FIELD_COLOR\n input_parameters.font_color = { 0, 0, 0 }\n input_parameters.validation = 2 -- Integer\n\n -- Green\n input_parameters.input_function = \"greenDeckChanged\"\n input_parameters.position = { -0.166, 0.1, 0.385 }\n input_parameters.value = greenDeckId\n self.createInput(input_parameters)\n -- Red\n input_parameters.input_function = \"redDeckChanged\"\n input_parameters.position = { 0.171, 0.1, 0.385 }\n input_parameters.value = redDeckId\n self.createInput(input_parameters)\n -- White\n input_parameters.input_function = \"whiteDeckChanged\"\n input_parameters.position = { -0.166, 0.1, 0.474 }\n input_parameters.value = whiteDeckId\n self.createInput(input_parameters)\n -- Orange\n input_parameters.input_function = \"orangeDeckChanged\"\n input_parameters.position = { 0.171, 0.1, 0.474 }\n input_parameters.value = orangeDeckId\n self.createInput(input_parameters)\nend\n\n-- Create the Build All button. This is a transparent button which covers the Build All portion of the background graphic\nfunction makeBuildButton()\n local button_parameters = {}\n button_parameters.click_function = \"loadDecks\"\n button_parameters.function_owner = self\n button_parameters.position = { 0, 0.1, 0.71 }\n button_parameters.width = 320\n button_parameters.height = 30\n button_parameters.color = { 0, 0, 0, 0 }\n button_parameters.tooltip = \"Click to build all four decks!\"\n self.createButton(button_parameters)\nend\n\n-- Event handlers for deck ID change\nfunction redDeckChanged(_, _, inputValue) redDeckId = inputValue end\n\nfunction orangeDeckChanged(_, _, inputValue) orangeDeckId = inputValue end\n\nfunction whiteDeckChanged(_, _, inputValue) whiteDeckId = inputValue end\n\nfunction greenDeckChanged(_, _, inputValue) greenDeckId = inputValue end\n\n-- Event handlers for toggle buttons\nfunction publicPrivateChanged()\n privateDeck = not privateDeck\n self.editButton { index = 0, label = PRIVATE_TOGGLE_LABELS[privateDeck] }\nend\n\nfunction loadUpgradedChanged()\n loadNewestDeck = not loadNewestDeck\n self.editButton { index = 1, label = UPGRADED_TOGGLE_LABELS[loadNewestDeck] }\nend\n\nfunction loadInvestigatorsChanged()\n loadInvestigators = not loadInvestigators\n self.editButton { index = 2, label = LOAD_INVESTIGATOR_TOGGLE_LABELS[loadInvestigators] }\nend\n\nfunction loadDecks()\n -- testLoadLotsOfDecks()\n -- Method in DeckImporterMain, visible due to inclusion\n\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n if (redDeckId ~= nil and redDeckId ~= \"\") then\n buildDeck(\"Red\", redDeckId)\n end\n if (orangeDeckId ~= nil and orangeDeckId ~= \"\") then\n buildDeck(\"Orange\", orangeDeckId)\n end\n if (whiteDeckId ~= nil and whiteDeckId ~= \"\") then\n buildDeck(\"White\", whiteDeckId)\n end\n if (greenDeckId ~= nil and greenDeckId ~= \"\") then\n buildDeck(\"Green\", greenDeckId)\n end\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param card: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\n__bundle_register(\"playermat/Zones\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Sets up and returns coordinates for all possible spawn zones. Because Lua assigns tables by reference\n-- and there is no built-in function to copy a table this is relatively brute force.\n--\n-- Positions are all relative to the player mat, and most are consistent. The\n-- exception are the SetAside# zones, which are placed to the left of the mat\n-- for White/Green, and the right of the mat for Orange/Red.\n--\n-- Investigator: Investigator card area.\n-- Minicard: Placement for the investigator's minicard, just above the player mat\n-- Deck, Discard: Standard locations for the deck and discard piles.\n-- BlankTop: used for assets that start in play (e.g. Duke)\n-- Tarot, Hand1, Hand2, Ally, BlankBottom, Accessory, Arcane1, Arcane2, Body: Asset slot positions\n-- Threat[1-4]: Threat area slots. Threat[1-3] correspond to the named threat area slots, and Threat4 is the blank threat area slot.\n-- SetAside[1-3]: Column closest to the player mat, with 1 at the top and 3 at the bottom.\n-- SetAside[4-6]: Column farther away from the mat, with 4 at the top and 6 at the bottom.\n-- SetAside1: Permanent cards\n-- SetAside2: Bonded cards\n-- SetAside3: Ancestral Knowledge / Underworld Market\n-- SetAside4: Upgrade sheets for customizable cards\n-- SetAside5: Hunch Deck for Joe Diamond\n-- SetAside6: currently unused\ndo\n local playmatApi = require(\"playermat/PlaymatApi\")\n local Zones = { }\n\n local commonZones = {}\n commonZones[\"Investigator\"] = { -1.177, 0, 0.002 }\n commonZones[\"Deck\"] = { -1.82, 0, 0 }\n commonZones[\"Discard\"] = { -1.82, 0, 0.61 }\n commonZones[\"Ally\"] = { -0.615, 0, 0.024 }\n commonZones[\"Body\"] = { -0.630, 0, 0.553 }\n commonZones[\"Hand1\"] = { 0.215, 0, 0.042 }\n commonZones[\"Hand2\"] = { -0.180, 0, 0.037 }\n commonZones[\"Arcane1\"] = { 0.212, 0, 0.559 }\n commonZones[\"Arcane2\"] = { -0.171, 0, 0.557 }\n commonZones[\"Tarot\"] = { 0.602, 0, 0.033 }\n commonZones[\"Accessory\"] = { 0.602, 0, 0.555 }\n commonZones[\"BlankTop\"] = { 1.758, 0, 0.040 }\n commonZones[\"BlankBottom\"] = { 1.754, 0, 0.563 }\n commonZones[\"Threat1\"] = { -0.911, 0, -0.625 }\n commonZones[\"Threat2\"] = { -0.454, 0, -0.625 }\n commonZones[\"Threat3\"] = { 0.002, 0, -0.625 }\n commonZones[\"Threat4\"] = { 0.459, 0, -0.625 }\n\n local zoneData = {}\n zoneData[\"White\"] = {}\n zoneData[\"White\"][\"Investigator\"] = commonZones[\"Investigator\"]\n zoneData[\"White\"][\"Deck\"] = commonZones[\"Deck\"]\n zoneData[\"White\"][\"Discard\"] = commonZones[\"Discard\"]\n zoneData[\"White\"][\"Ally\"] = commonZones[\"Ally\"]\n zoneData[\"White\"][\"Body\"] = commonZones[\"Body\"]\n zoneData[\"White\"][\"Hand1\"] = commonZones[\"Hand1\"]\n zoneData[\"White\"][\"Hand2\"] = commonZones[\"Hand2\"]\n zoneData[\"White\"][\"Arcane1\"] = commonZones[\"Arcane1\"]\n zoneData[\"White\"][\"Arcane2\"] = commonZones[\"Arcane2\"]\n zoneData[\"White\"][\"Tarot\"] = commonZones[\"Tarot\"]\n zoneData[\"White\"][\"Accessory\"] = commonZones[\"Accessory\"]\n zoneData[\"White\"][\"BlankTop\"] = commonZones[\"BlankTop\"]\n zoneData[\"White\"][\"BlankBottom\"] = commonZones[\"BlankBottom\"]\n zoneData[\"White\"][\"Threat1\"] = commonZones[\"Threat1\"]\n zoneData[\"White\"][\"Threat2\"] = commonZones[\"Threat2\"]\n zoneData[\"White\"][\"Threat3\"] = commonZones[\"Threat3\"]\n zoneData[\"White\"][\"Threat4\"] = commonZones[\"Threat4\"]\n zoneData[\"White\"][\"Minicard\"] = { -1, 0, -1.45 }\n zoneData[\"White\"][\"SetAside1\"] = { 2.35, 0, -0.520 }\n zoneData[\"White\"][\"SetAside2\"] = { 2.35, 0, 0.042 }\n zoneData[\"White\"][\"SetAside3\"] = { 2.35, 0, 0.605 }\n zoneData[\"White\"][\"UnderSetAside3\"] = { 2.50, 0, 0.805 }\n zoneData[\"White\"][\"SetAside4\"] = { 2.78, 0, -0.520 }\n zoneData[\"White\"][\"SetAside5\"] = { 2.78, 0, 0.042 }\n zoneData[\"White\"][\"SetAside6\"] = { 2.78, 0, 0.605 }\n zoneData[\"White\"][\"UnderSetAside6\"] = { 2.93, 0, 0.805 }\n\n zoneData[\"Orange\"] = {}\n zoneData[\"Orange\"][\"Investigator\"] = commonZones[\"Investigator\"]\n zoneData[\"Orange\"][\"Deck\"] = commonZones[\"Deck\"]\n zoneData[\"Orange\"][\"Discard\"] = commonZones[\"Discard\"]\n zoneData[\"Orange\"][\"Ally\"] = commonZones[\"Ally\"]\n zoneData[\"Orange\"][\"Body\"] = commonZones[\"Body\"]\n zoneData[\"Orange\"][\"Hand1\"] = commonZones[\"Hand1\"]\n zoneData[\"Orange\"][\"Hand2\"] = commonZones[\"Hand2\"]\n zoneData[\"Orange\"][\"Arcane1\"] = commonZones[\"Arcane1\"]\n zoneData[\"Orange\"][\"Arcane2\"] = commonZones[\"Arcane2\"]\n zoneData[\"Orange\"][\"Tarot\"] = commonZones[\"Tarot\"]\n zoneData[\"Orange\"][\"Accessory\"] = commonZones[\"Accessory\"]\n zoneData[\"Orange\"][\"BlankTop\"] = commonZones[\"BlankTop\"]\n zoneData[\"Orange\"][\"BlankBottom\"] = commonZones[\"BlankBottom\"]\n zoneData[\"Orange\"][\"Threat1\"] = commonZones[\"Threat1\"]\n zoneData[\"Orange\"][\"Threat2\"] = commonZones[\"Threat2\"]\n zoneData[\"Orange\"][\"Threat3\"] = commonZones[\"Threat3\"]\n zoneData[\"Orange\"][\"Threat4\"] = commonZones[\"Threat4\"]\n zoneData[\"Orange\"][\"Minicard\"] = { 1, 0, -1.45 }\n zoneData[\"Orange\"][\"SetAside1\"] = { -2.35, 0, -0.520 }\n zoneData[\"Orange\"][\"SetAside2\"] = { -2.35, 0, 0.042}\n zoneData[\"Orange\"][\"SetAside3\"] = { -2.35, 0, 0.605 }\n zoneData[\"Orange\"][\"UnderSetAside3\"] = { -2.50, 0, 0.805 }\n zoneData[\"Orange\"][\"SetAside4\"] = { -2.78, 0, -0.520 }\n zoneData[\"Orange\"][\"SetAside5\"] = { -2.78, 0, 0.042 }\n zoneData[\"Orange\"][\"SetAside6\"] = { -2.78, 0, 0.605 }\n zoneData[\"Orange\"][\"UnderSetAside6\"] = { -2.93, 0, 0.805 }\n\n -- Green positions are the same as White and Red the same as Orange\n zoneData[\"Red\"] = zoneData[\"Orange\"]\n zoneData[\"Green\"] = zoneData[\"White\"]\n\n -- Gets the global position for the given zone on the specified player mat.\n ---@param playerColor: Color name of the player mat to get the zone position for (e.g. \"Red\")\n ---@param zoneName: Name of the zone to get the position for. See Zones object documentation for a list of valid zones.\n ---@return: Global position table, or nil if an invalid player color or zone is specified\n Zones.getZonePosition = function(playerColor, zoneName)\n if (playerColor ~= \"Red\"\n and playerColor ~= \"Orange\"\n and playerColor ~= \"White\"\n and playerColor ~= \"Green\") then\n return nil\n end\n return playmatApi.transformLocalPosition(zoneData[playerColor][zoneName], playerColor)\n end\n\n -- Return the global rotation for a card on the given player mat, based on its metadata.\n ---@param playerColor: Color name of the player mat to get the rotation for (e.g. \"Red\")\n ---@param cardMetadata: Table of card metadata. Metadata fields type and permanent are required; all others are optional.\n ---@return: Global rotation vector for the given card. This will include the\n -- Y rotation to orient the card on the given player mat as well as a\n -- Z rotation to place the card face up or face down.\n Zones.getDefaultCardRotation = function(playerColor, zone)\n local cardRotation = playmatApi.returnRotation(playerColor)\n if zone == \"Deck\" then\n cardRotation = cardRotation + Vector(0, 0, 180)\n end\n return cardRotation\n end\n\n return Zones\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"arkhamdb/ArkhamDb\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n \n local ArkhamDb = { }\n local internal = { }\n\n local RANDOM_WEAKNESS_ID = \"01000\"\n\n local tabooList = { }\n --Forward declaration\n ---@type Request\n local Request = {}\n local configuration\n\n -- Sets up the ArkhamDb interface. Should be called from the parent object on load.\n ArkhamDb.initialize = function()\n configuration = internal.getConfiguration()\n Request.start({ configuration.api_uri, configuration.taboo }, function(status)\n local json = JSON.decode(internal.fixUtf16String(status.text))\n for _, taboo in pairs(json) do\n ---@type \u003cstring, boolean\u003e\n local cards = {}\n\n for _, card in pairs(JSON.decode(taboo.cards)) do\n cards[card.code] = true\n end\n\n tabooList[taboo.id] = {\n date = taboo.date_start,\n cards = cards\n }\n end\n return true, nil\n end)\n end\n\n -- Start the deck build process for the given player color and deck ID. This\n -- will retrieve the deck from ArkhamDB, and pass to a callback for processing.\n ---@param playerColor String. Color name of the player mat to place this deck on (e.g. \"Red\").\n ---@param deckId String. ArkhamDB deck id to be loaded\n ---@param isPrivate Boolean. Whether this deck is published or private on ArkhamDB\n ---@param loadNewest Boolean. Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean. Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function. Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n ArkhamDb.getDecklist = function(\n playerColor,\n deckId,\n isPrivate,\n loadNewest,\n loadInvestigators,\n callback)\n -- Get a simple card to see if the bag indexes are complete. If not, abort\n -- the deck load. The called method will handle player notification.\n local checkCard = allCardsBagApi.getCardById(\"01001\")\n if (checkCard ~= nil and checkCard.data == nil) then\n return\n end\n\n local deckUri = { configuration.api_uri,\n isPrivate and configuration.private_deck or configuration.public_deck, deckId }\n\n local deck = Request.start(deckUri, function(status)\n if string.find(status.text, \"\u003c!DOCTYPE html\u003e\") then\n internal.maybePrint(\"Private deck ID \" .. deckId .. \" is not shared\", playerColor)\n return false, table.concat({ \"Private deck \", deckId, \" is not shared\" })\n end\n local json = JSON.decode(status.text)\n\n if not json then\n internal.maybePrint(\"Deck ID \" .. deckId .. \" not found\", playerColor)\n return false, \"Deck not found!\"\n end\n\n return true, json\n end)\n\n deck:with(internal.onDeckResult, playerColor, loadNewest, loadInvestigators, callback)\n end\n\n -- Logs that a card could not be loaded in the mod by printing it to the console in the given\n -- color of the player owning the deck. Attempts to look up the name on ArkhamDB for clarity,\n -- but prints the card ID if the name cannot be retrieved.\n ---@param cardId String. ArkhamDB ID of the card that could not be found\n ---@param playerColor String. Color of the player's deck that had the problem\n ArkhamDb.logCardNotFound = function(cardId, playerColor)\n local request = Request.start({\n configuration.api_uri,\n configuration.cards,\n cardId\n },\n function(result)\n local adbCardInfo = JSON.decode(internal.fixUtf16String(result.text))\n local cardName = adbCardInfo.real_name\n if (cardName ~= nil) then\n if (adbCardInfo.xp ~= nil and adbCardInfo.xp \u003e 0) then\n cardName = cardName .. \" (\" .. adbCardInfo.xp .. \")\"\n end\n internal.maybePrint(\"Card not found: \" .. cardName .. \", ArkhamDB ID \" .. cardId, playerColor)\n else\n internal.maybePrint(\"Card not found in ArkhamDB, ID \" .. cardId, playerColor)\n end\n end)\n end\n\n -- Callback when the deck information is received from ArkhamDB. Parses the\n -- response then applies standard transformations to the deck such as adding\n -- random weaknesses and checking for taboos. Once the deck is processed,\n -- passes to loadCards to actually spawn the defined deck.\n ---@param deck ArkhamImportDeck\n ---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n ---@param loadNewest Boolean Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- bondedList A table of cardID keys to meaningless values. Card IDs in this list were\n --- added from a parent bonded card.\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n internal.onDeckResult = function(deck, playerColor, loadNewest, loadInvestigators, callback)\n -- Load the next deck in the upgrade path if the option is enabled\n if (loadNewest and deck.next_deck ~= nil and deck.next_deck ~= \"\") then\n buildDeck(playerColor, deck.next_deck)\n return\n end\n\n internal.maybePrint(table.concat({ \"Found decklist: \", deck.name }), playerColor)\n\n -- Initialize deck slot table and perform common transformations. The order of these should not\n -- be changed, as later steps may act on cards added in each. For example, a random weakness or\n -- investigator may have bonded cards or taboo entries, and should be present\n local slots = deck.slots\n internal.maybeDrawRandomWeakness(slots, playerColor)\n local loadAltInvestigator = \"normal\"\n if loadInvestigators then\n loadAltInvestigator = internal.addInvestigatorCards(deck, slots)\n end\n \n internal.maybeAddSummonedServitor(slots)\n internal.maybeAddOnTheMend(slots, playerColor)\n internal.maybeAddRealityAcidReference(slots)\n local bondList = internal.extractBondedCards(slots)\n internal.checkTaboos(deck.taboo_id, slots, playerColor)\n internal.maybeAddUpgradeSheets(slots)\n\n -- get upgrades for customizable cards\n local customizations = {}\n if deck.meta then\n customizations = JSON.decode(deck.meta)\n end\n\n callback(slots, deck.investigator_code, bondList, customizations, playerColor, loadAltInvestigator)\n end\n\n -- Checks to see if the slot list includes the random weakness ID. If it does,\n -- removes it from the deck and replaces it with the ID of a random basic weakness provided by the\n -- all cards bag\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n --- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast\n --- if a weakness is added.\n internal.maybeDrawRandomWeakness = function(slots, playerColor)\n local randomWeaknessAmount = slots[RANDOM_WEAKNESS_ID] or 0\n slots[RANDOM_WEAKNESS_ID] = nil\n\n if randomWeaknessAmount ~= 0 then\n for i=1, randomWeaknessAmount do\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n slots[weaknessId] = (slots[weaknessId] or 0) + 1\n end\n internal.maybePrint(\"Added \" .. randomWeaknessAmount .. \" random basic weakness(es) to deck\", playerColor)\n end\n end\n\n -- Adds both the investigator (XXXXX) and minicard (XXXXX-m) slots with one copy each\n ---@param deck Table The processed ArkhamDB deck response\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the\n --- number of those cards which will be spawned\n ---@return string: Contains the name of the art that should be loaded (\"normal\", \"promo\" or \"revised\")\n internal.addInvestigatorCards = function(deck, slots)\n local investigatorId = deck.investigator_code\n slots[investigatorId .. \"-m\"] = 1\n local deckMeta = JSON.decode(deck.meta)\n -- handling alternative investigator art and parallel investigators\n local loadAltInvestigator = \"normal\"\n if deckMeta ~= nil then\n local altFrontId = tonumber(deckMeta.alternate_front) or 0\n local altBackId = tonumber(deckMeta.alternate_back) or 0\n local altArt = { front = \"normal\", back = \"normal\" }\n\n -- translating front ID\n if altFrontId \u003e 90000 and altFrontId \u003c 90100 then\n altArt.front = \"parallel\"\n elseif altFrontId \u003e 01500 and altFrontId \u003c 01506 then\n altArt.front = \"revised\"\n elseif altFrontId \u003e 98000 then\n altArt.front = \"promo\"\n end\n\n -- translating back ID\n if altBackId \u003e 90000 and altBackId \u003c 90100 then\n altArt.back = \"parallel\"\n elseif altBackId \u003e 01500 and altBackId \u003c 01506 then\n altArt.back = \"revised\"\n elseif altBackId \u003e 98000 then\n altArt.back = \"promo\"\n end\n\n -- updating investigatorID based on alt investigator selection\n -- precedence: parallel \u003e promo \u003e revised\n if altArt.front == \"parallel\" then\n if altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-p\"\n else\n investigatorId = investigatorId .. \"-pf\"\n end\n elseif altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-pb\"\n elseif altArt.front == \"promo\" or altArt.back == \"promo\" then\n loadAltInvestigator = \"promo\"\n elseif altArt.front == \"revised\" or altArt.back == \"revised\" then\n loadAltInvestigator = \"revised\"\n end\n end\n slots[investigatorId] = 1\n deck.investigator_code = investigatorId\n return loadAltInvestigator\n end\n\n -- Process the card list looking for the customizable cards, and add their upgrade sheets if needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddUpgradeSheets = function(slots)\n for cardId, _ in pairs(slots) do\n -- upgrade sheets for customizable cards\n local upgradesheet = allCardsBagApi.getCardById(cardId .. \"-c\")\n if upgradesheet ~= nil then\n slots[cardId .. \"-c\"] = 1\n end\n end\n end\n\n -- Process the card list looking for the Summoned Servitor, and add its minicard to the list if\n -- needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddSummonedServitor = function(slots)\n if slots[\"09080\"] ~= nil then\n slots[\"09080-m\"] = 1\n end\n end\n\n -- On the Mend should have 1-per-investigator copies set aside, but ArkhamDB always sends 1. Update\n -- the count based on the investigator count\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast if an error occurs\n internal.maybeAddOnTheMend = function(slots, playerColor)\n if slots[\"09006\"] ~= nil then\n local investigatorCount = playAreaApi.getInvestigatorCount()\n if investigatorCount ~= nil then\n slots[\"09006\"] = investigatorCount\n else\n internal.maybePrint(\"Something went wrong with the load, adding 4 copies of On the Mend\", playerColor)\n slots[\"09006\"] = 4\n end\n end\n end\n\n -- Process the card list looking for Reality Acid and adds the reference sheet when needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddRealityAcidReference = function(slots)\n if slots[\"89004\"] ~= nil then\n slots[\"89005\"] = 1\n end\n end\n\n -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list.\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.extractBondedCards = function(slots)\n -- Create a list of bonded cards first so we don't modify slots while iterating\n local bondedCards = { }\n local bondedList = { }\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil and card.metadata.bonded ~= nil) then\n for _, bond in ipairs(card.metadata.bonded) do\n -- add a bonded card for each copy of the parent card (except for Pendant of the Queen)\n if bond.id == \"06022\" then\n bondedCards[bond.id] = bond.count\n else\n bondedCards[bond.id] = bond.count * cardCount\n end\n -- We need to know which cards are bonded to determine their position, remember them\n bondedList[bond.id] = true\n -- Also adding taboo versions of bonded cards to the list\n bondedList[bond.id .. \"-t\"] = true\n end\n end\n end\n -- Add any bonded cards to the main slots list\n for bondedId, bondedCount in pairs(bondedCards) do\n slots[bondedId] = bondedCount\n end\n\n return bondedList\n end\n\n -- Check the deck for cards on its taboo list. If they're found, replace the entry in the slot with the Taboo id (i.e. \"XXXX\" becomes \"XXXX-t\")\n ---@param tabooId String The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.checkTaboos = function(tabooId, slots, playerColor)\n if tabooId then\n for cardId, _ in pairs(tabooList[tabooId].cards) do\n if slots[cardId] ~= nil then\n -- Make sure there's a taboo version of the card before we replace it\n -- SCED only maintains the most recent taboo cards. If a deck is using\n -- an older taboo list it's possible the card isn't a taboo any more\n local tabooCard = allCardsBagApi.getCardById(cardId .. \"-t\")\n if tabooCard == nil then\n local basicCard = allCardsBagApi.getCardById(cardId)\n internal.maybePrint(\"Taboo version for \" .. basicCard.data.Nickname .. \" is not available. Using standard version\", playerColor)\n else\n slots[cardId .. \"-t\"] = slots[cardId]\n slots[cardId] = nil\n end\n end\n end\n end\n end\n\n internal.maybePrint = function(message, playerColor)\n if playerColor ~= \"None\" then\n printToAll(message, playerColor)\n end\n end\n\n -- Gets the ArkhamDB config info from the configuration object.\n ---@return Table. Configuration data\n internal.getConfiguration = function()\n local configuration = getObjectsWithTag(\"import_configuration_provider\")[1]:getTable(\"configuration\")\n printPriority = configuration.priority\n return configuration\n end\n\n internal.fixUtf16String = function(str)\n return str:gsub(\"\\\\u(%w%w%w%w)\", function(match)\n return string.char(tonumber(match, 16))\n end)\n end\n\n ---@type Request\n Request = {\n is_done = false,\n is_successful = false\n }\n\n -- Creates a new instance of a Request. Should not be directly called. Instead use Request.start and Request.deferred.\n ---@param uri string\n ---@param configure fun(request: Request, status: WebRequestStatus)\n ---@return Request\n function Request:new(uri, configure)\n local this = {}\n\n setmetatable(this, self)\n self.__index = self\n\n if type(uri) == \"table\" then\n uri = table.concat(uri, \"/\")\n end\n\n this.uri = uri\n\n WebRequest.get(uri, function(status)\n configure(this, status)\n end)\n\n return this\n end\n\n -- Creates a new request. on_success should set the request's is_done, is_successful, and content variables.\n -- Deferred should be used when you don't want to set is_done immediately (such as if you want to wait for another request to finish)\n ---@param uri string\n ---@param on_success fun(request: Request, status: WebRequestStatus, vararg any)\n ---@param on_error fun(status: WebRequestStatus)|nil\n ---@vararg any[]\n ---@return Request\n function Request.deferred(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request:new(uri, function(request, status)\n if (status.is_done) then\n if (status.is_error) then\n request.error_message = on_error and on_error(status, table.unpack(parameters)) or status.error\n request.is_successful = false\n request.is_done = true\n else\n on_success(request, status)\n end\n end\n end)\n end\n\n -- Creates a new request. on_success should return weather the resultant data is as expected, and the processed content of the request.\n ---@param uri string\n ---@param on_success fun(status: WebRequestStatus, vararg any): boolean, any\n ---@param on_error nil|fun(status: WebRequestStatus, vararg any): string\n ---@vararg any[]\n ---@return Request\n function Request.start(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request.deferred(uri, function(request, status)\n local result, message = on_success(status, table.unpack(parameters))\n if not result then request.error_message = message else request.content = message end\n request.is_successful = result\n request.is_done = true\n end, on_error, table.unpack(parameters))\n end\n\n ---@param requests Request[]\n ---@param on_success fun(content: any[], vararg any[])\n ---@param on_error fun(requests: Request[], vararg any[])|nil\n ---@vararg any\n function Request.with_all(requests, on_success, on_error, ...)\n local parameters = table.pack(...)\n\n Wait.condition(function()\n ---@type any[]\n local results = {}\n\n ---@type Request[]\n local errors = {}\n\n for _, request in ipairs(requests) do\n if request.is_successful then\n table.insert(results, request.content)\n else\n table.insert(errors, request)\n end\n end\n\n if (#errors \u003c= 0) then\n on_success(results, table.unpack(parameters))\n elseif on_error == nil then\n for _, request in ipairs(errors) do\n internal.maybePrint(table.concat({ \"[ERROR]\", request.uri, \":\", request.error_message }))\n end\n else\n on_error(requests, table.unpack(parameters))\n end\n end, function()\n for _, request in ipairs(requests) do\n if not request.is_done then return false end\n end\n return true\n end)\n end\n\n ---@param callback fun(content: any, vararg any)\n function Request:with(callback, ...)\n local arguments = table.pack(...)\n Wait.condition(function()\n if self.is_successful then\n callback(self.content, table.unpack(arguments))\n end\n end, function() return self.is_done\n end)\n end\n\n return ArkhamDb\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"arkhamdb/DeckImporterMain\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/DeckImporterUi\")\nrequire(\"playercards/PlayerCardSpawner\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\nlocal arkhamDb = require(\"arkhamdb/ArkhamDb\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal zones = require(\"playermat/Zones\")\n\nlocal startsInPlayCount = 0\n\nfunction onLoad(script_state)\n initializeUi(JSON.decode(script_state))\n math.randomseed(os.time())\n arkhamDb.initialize()\nend\n\nfunction onSave() return JSON.encode(getUiState()) end\n\n-- Returns the zone name where the specified card should be placed, based on its metadata.\n---@param cardMetadata Table of card metadata.\n---@return Zone String Name of the zone such as \"Deck\", \"SetAside1\", etc.\n-- See Zones object documentation for a list of valid zones.\nfunction getDefaultCardZone(cardMetadata, bondedList)\n if (cardMetadata.id == \"09080-m\") then -- Have to check the Servitor before other minicards\n return \"SetAside6\"\n elseif (cardMetadata.id == \"09006\") then -- On The Mend is set aside\n return \"SetAside2\"\n elseif cardMetadata.type == \"Investigator\" then\n return \"Investigator\"\n elseif cardMetadata.type == \"Minicard\" then\n return \"Minicard\"\n elseif cardMetadata.type == \"UpgradeSheet\" then\n return \"SetAside4\"\n elseif cardMetadata.startsInPlay then\n return startsInPlayTracker()\n elseif cardMetadata.permanent then\n return \"SetAside1\"\n elseif bondedList[cardMetadata.id] then\n return \"SetAside2\"\n -- SetAside3 is used for Ancestral Knowledge / Underworld Market\n else\n return \"Deck\"\n end\nend\n\nfunction startsInPlayTracker()\n startsInPlayCount = startsInPlayCount + 1\n if startsInPlayCount \u003e 6 then\n broadcastToAll(\"Card that should start in play was placed with permanents because no blank slots remained\")\n return \"SetAside1\"\n else\n return \"Blank\" .. startsInPlayCount\n end\nend\n\nfunction buildDeck(playerColor, deckId)\n local uiState = getUiState()\n arkhamDb.getDecklist(\n playerColor,\n deckId,\n uiState.private,\n uiState.loadNewest,\n uiState.investigators,\n loadCards)\nend\n\n-- Process the slot list, which defines the card Ids and counts of cards to load. Spawn those cards\n-- at the appropriate zones and report an error to the user if any could not be loaded.\n-- This is a callback function which handles the results of ArkhamDb.getDecklist()\n-- This method uses an encapsulated coroutine with yields to make the card spawning cleaner.\n--\n---@param slots Table Key-Value table of cardId:count. cardId is the ArkhamDB ID of the card to spawn,\n-- and count is the number which should be spawned\n---@param investigatorId String ArkhamDB ID (code) for this deck's investigator.\n-- Investigator cards should already be added to the slots list if they\n-- should be spawned, but this value is separate to check for special\n-- handling for certain investigators\n---@param bondedList Table A table of cardID keys to meaningless values. Card IDs in this list were added\n-- from a parent bonded card.\n---@param customizations String ArkhamDB data for customizations on customizable cards\n---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n---@param loadAltInvestigator String Contains the name of alternative art for the investigator (\"normal\", \"revised\" or \"promo\")\nfunction loadCards(slots, investigatorId, bondedList, customizations, playerColor, loadAltInvestigator)\n function coinside()\n local cardsToSpawn = {}\n\n -- reset the startsInPlayCount\n startsInPlayCount = 0\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if card ~= nil then\n local cardZone = getDefaultCardZone(card.metadata, bondedList)\n for i = 1, cardCount do\n table.insert(cardsToSpawn, { data = card.data, metadata = card.metadata, zone = cardZone })\n end\n\n slots[cardId] = 0\n end\n end\n\n handleAncestralKnowledge(cardsToSpawn)\n handleUnderworldMarket(cardsToSpawn, playerColor)\n handleHunchDeck(investigatorId, cardsToSpawn, playerColor)\n handleSpiritDeck(investigatorId, cardsToSpawn, playerColor)\n handleCustomizableUpgrades(cardsToSpawn, customizations)\n handlePeteSignatureAssets(investigatorId, cardsToSpawn)\n\n -- Split the card list into separate lists for each zone\n local zoneDecks = buildZoneLists(cardsToSpawn)\n -- Spawn the list for each zone\n for zone, zoneCards in pairs(zoneDecks) do\n local deckPos = zones.getZonePosition(playerColor, zone)\n deckPos.y = 3\n\n local callback = nil\n -- If cards are spread too close together TTS groups them weirdly, selecting multiples\n -- when hovering over a single card. This distance is the minimum to avoid that\n local spreadDistance = 1.15\n if (zone == \"SetAside4\") then\n -- SetAside4 is reserved for customization cards, and we want them spread on the table\n -- so their checkboxes are visible\n -- TO-DO: take into account that spreading will make multiple rows\n -- (this is affected by the user's local settings!)\n if (playerColor == \"White\") then\n deckPos.z = deckPos.z + (#zoneCards - 1) * spreadDistance\n elseif (playerColor == \"Green\") then\n deckPos.x = deckPos.x + (#zoneCards - 1) * spreadDistance\n end\n callback = function(deck) deck.spread(spreadDistance) end\n elseif zone == \"Deck\" then\n callback = function(deck) deckSpawned(deck, playerColor) end\n elseif zone == \"Investigator\" or zone == \"Minicard\" then\n callback = function(card) loadAltArt(card, loadAltInvestigator) end\n end\n Spawner.spawnCards(\n zoneCards,\n deckPos,\n zones.getDefaultCardRotation(playerColor, zone),\n true, -- Sort deck\n callback)\n\n coroutine.yield(0)\n end\n\n -- Look for any cards which haven't been loaded\n local hadError = false\n for cardId, remainingCount in pairs(slots) do\n if remainingCount \u003e 0 then\n hadError = true\n arkhamDb.logCardNotFound(cardId, playerColor)\n end\n end\n if (not hadError) then\n printToAll(\"Deck loaded successfully!\", playerColor)\n end\n return 1\n end\n\n startLuaCoroutine(self, \"coinside\")\nend\n\n-- Callback handler for the main deck spawning. Looks for cards which should start in hand, and\n-- draws them for the appropriate player.\n---@param deck Object Callback-provided spawned deck object\n---@param playerColor String Color of the player to draw the cards to\nfunction deckSpawned(deck, playerColor)\n local player = Player[playmatApi.getPlayerColor(playerColor)]\n local handPos = player.getHandTransform(1).position -- Only one hand zone per player\n local deckCards = deck.getData().ContainedObjects\n\n -- Process in reverse order so taking cards out doesn't upset the indexing\n for i = #deckCards, 1, -1 do\n local cardMetadata = JSON.decode(deckCards[i].GMNotes) or { }\n if cardMetadata.startsInHand then\n deck.takeObject({ index = i - 1, position = handPos, flip = true, smooth = true})\n end\n end\n\n -- add the \"PlayerCard\" tag to the deck\n if deck and deck.type == \"Deck\" and deck.getQuantity() \u003e 1 then\n deck.addTag(\"PlayerCard\")\n end\nend\n\n-- Converts the Raven Quill's selections from card IDs to card names. This could be more elegant\n-- but the inputs are very static so we're using some brute force.\n---@param selectionString String provided by ArkhamDB, indicates the customization selections\n-- Should be either a single card ID or two separated by a ^ (e.g. XXXXX^YYYYY)\nfunction convertRavenQuillSelections(selectionString)\n if (string.len(selectionString) == 5) then\n return getCardName(selectionString)\n elseif (string.len(selectionString) == 11) then\n return getCardName(string.sub(selectionString, 1, 5)) .. \", \" .. getCardName(string.sub(selectionString, 7))\n end\nend\n\n-- Converts Grizzled's selections from a single string with \"^\".\n---@param selectionString String provided by ArkhamDB, indicates the customization selections\n-- Should be two Traits separated by a ^ (e.g. XXXXX^YYYYY)\nfunction convertGrizzledSelections(selectionString)\n return selectionString:gsub(\"%^\", \", \")\nend\n\n-- Returns the simple name of a card given its ID. This will find the card and strip any trailing\n-- SCED-specific suffixes such as (Taboo) or (Level)\nfunction getCardName(cardId)\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil) then\n local name = card.data.Nickname\n if (string.find(name, \" %(\")) then\n return string.sub(name, 1, string.find(name, \" %(\") - 1)\n else\n return name\n end\n end\nend\n\n-- Split a single list of cards into a separate table of lists, keyed by the zone\n---@param cards Table Table of {cardData, cardMetadata, zone}\n---@return: Table of {zoneName=card list}\nfunction buildZoneLists(cards)\n local zoneList = {}\n for _, card in ipairs(cards) do\n if zoneList[card.zone] == nil then\n zoneList[card.zone] = {}\n end\n table.insert(zoneList[card.zone], card)\n end\n\n return zoneList\nend\n\n-- Check to see if the deck list has Ancestral Knowledge. If it does, move 5 random skills to SetAside3\n---@param cardList Table Deck list being created\nfunction handleAncestralKnowledge(cardList)\n local hasAncestralKnowledge = false\n local skillList = {}\n -- Have to process the entire list to check for Ancestral Knowledge and get all possible skills, so do both in one pass\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"07303\" then\n hasAncestralKnowledge = true\n card.zone = \"SetAside3\"\n elseif (card.metadata.type == \"Skill\"\n and card.zone == \"Deck\"\n and not card.metadata.weakness) then\n table.insert(skillList, i)\n end\n end\n if hasAncestralKnowledge then\n for i = 1, 5 do\n -- Move 5 random skills to SetAside3\n local skillListIndex = math.random(#skillList)\n cardList[skillList[skillListIndex]].zone = \"UnderSetAside3\"\n table.remove(skillList, skillListIndex)\n end\n end\nend\n\n-- Check for and handle Underworld Market by moving all Illicit cards to UnderSetAside3\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleUnderworldMarket(cardList, playerColor)\n local hasMarket = false\n local illicitList = {}\n -- Process the entire list to check for Underworld Market and get all possible skills, doing both in one pass\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"09077\" then\n -- Underworld Market found\n hasMarket = true\n card.zone = \"SetAside3\"\n elseif card.metadata.traits ~= nil and string.find(card.metadata.traits, \"Illicit\", 1, true) and card.zone == \"Deck\" then\n table.insert(illicitList, i)\n end\n end\n\n if hasMarket then\n if #illicitList \u003c 10 then\n printToAll(\"Only \" .. #illicitList ..\n \" Illicit cards in your deck, you can't trigger Underworld Market's ability.\",\n playerColor)\n else\n -- Process cards to move them to the market deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #illicitList, 1, -1 do\n local moving = cardList[illicitList[i]]\n moving.zone = \"UnderSetAside3\"\n table.remove(cardList, illicitList[i])\n table.insert(cardList, moving)\n end\n\n if #illicitList \u003e 10 then\n printToAll(\"Moved all \" .. #illicitList ..\n \" Illicit cards to the Market deck, reduce it to 10\",\n playerColor)\n else\n printToAll(\"Built the Market deck\", playerColor)\n end\n end\n end\nend\n\n-- If the investigator is Joe Diamond, extract all Insight events to SetAside5 to build the Hunch\n-- Deck.\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleHunchDeck(investigatorId, cardList, playerColor)\n if investigatorId == \"05002\" then -- Joe Diamond\n local insightList = {}\n for i, card in ipairs(cardList) do\n if (card.metadata.type == \"Event\"\n and card.metadata.traits ~= nil\n and string.match(card.metadata.traits, \"Insight\")\n and card.metadata.bonded_to == nil) then\n table.insert(insightList, i)\n end\n end\n -- Process insights to move them to the hunch deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #insightList, 1, -1 do\n local moving = cardList[insightList[i]]\n moving.zone = \"SetAside5\"\n table.remove(cardList, insightList[i])\n table.insert(cardList, moving)\n end\n if #insightList \u003c 11 then\n printToAll(\"Joe's hunch deck must have 11 cards but the deck only has \" .. #insightList ..\n \" Insight events.\", playerColor)\n elseif #insightList \u003e 11 then\n printToAll(\"Moved all \" .. #insightList ..\n \" Insight events to the hunch deck, reduce it to 11.\", playerColor)\n else\n printToAll(\"Built Joe's hunch deck\", playerColor)\n end\n end\nend\n\n-- If the investigator is Parallel Jim Culver, extract all Ally assets to SetAside5 to build the Spirit\n-- Deck.\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\n---@param playerColor String Color this deck is being loaded for\nfunction handleSpiritDeck(investigatorId, cardList, playerColor)\n if investigatorId == \"02004-p\" or investigatorId == \"02004-pb\" then -- Parallel Jim Culver\n local spiritList = {}\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"90053\" or (\n card.metadata.type == \"Asset\"\n and card.metadata.traits ~= nil\n and string.match(card.metadata.traits, \"Ally\")\n and card.metadata.level ~= nil\n and card.metadata.level \u003c 3) then\n table.insert(spiritList, i)\n end\n end\n -- Process allies to move them to the spirit deck. This is done in reverse\n -- order because the sorting needs to be reversed (deck sorts for face down)\n -- Performance here may be an issue, as table.remove() is an O(n) operation\n -- which makes the full shift O(n^2). But keep it simple unless it becomes\n -- a problem\n for i = #spiritList, 1, -1 do\n local moving = cardList[spiritList[i]]\n moving.zone = \"SetAside5\"\n table.remove(cardList, spiritList[i])\n table.insert(cardList, moving)\n end\n if #spiritList \u003c 10 then\n printToAll(\"Jim's spirit deck must have 9 Ally assets but the deck only has \" .. (#spiritList - 1) ..\n \" Ally assets.\", playerColor)\n elseif #spiritList \u003e 11 then\n printToAll(\"Moved all \" .. (#spiritList - 1) ..\n \" Ally assets to the spirit deck, reduce it to 10 (including Vengeful Shade).\", playerColor)\n else\n printToAll(\"Built Jim's spirit deck\", playerColor)\n end\n end\nend\n\n-- For any customization upgrade cards in the card list, process the metadata from the deck to\n-- set the save state to show the correct checkboxes/text field values\n---@param cardList Table Deck list being created\n---@param customizations String ArkhamDB data for customizations on customizable cards\nfunction handleCustomizableUpgrades(cardList, customizations)\n for _, card in ipairs(cardList) do\n if card.metadata.type == \"UpgradeSheet\" then\n local baseId = string.sub(card.metadata.id, 1, 5)\n local upgrades = customizations[\"cus_\" .. baseId]\n\n if upgrades ~= nil then\n -- initialize tables\n -- markedBoxes: contains the amount of markedBoxes (left to right) per row (starting at row 1)\n -- inputValues: contains the amount of inputValues per row (starting at row 0)\n local selectedUpgrades = { }\n local index_xp = {}\n\n -- get the index and xp values (looks like this: X|X,X|X, ..)\n -- input string from ArkhamDB is split by \",\"\n for str in string.gmatch(customizations[\"cus_\" .. baseId], \"([^,]+)\") do\n table.insert(index_xp, str)\n end\n\n -- split each pair and assign it to the proper position in markedBoxes\n for _, entry in ipairs(index_xp) do\n -- counter increments from 1 to 3 and indicates the part of the string we are on\n -- usually: 1 = row, 2 = amount of check boxes, 3 = entry in inputfield\n local counter = 0\n local row = 0\n\n -- parsing the string for each row\n for str in entry:gmatch(\"([^|]+)\") do\n counter = counter + 1\n\n if counter == 1 then\n row = tonumber(str) + 1\n elseif counter == 2 then\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n end\n selectedUpgrades[row].xp = tonumber(str)\n elseif counter == 3 and str ~= \"\" then\n if baseId == \"09042\" then\n selectedUpgrades[row].text = convertRavenQuillSelections(str)\n elseif baseId == \"09101\" then\n selectedUpgrades[row].text = convertGrizzledSelections(str)\n elseif baseId == \"09079\" then -- Living Ink skill selection\n -- All skills, regardless of row, are placed in upgrade slot 1 as a comma-delimited\n -- list\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n if selectedUpgrades[1].text == nil then\n selectedUpgrades[1].text = str\n else\n selectedUpgrades[1].text = selectedUpgrades[1].text .. \",\" .. str\n end\n else\n selectedUpgrades[row].text = str\n end\n end\n end\n end\n\n -- write the loaded values to the save_data of the sheets\n card.data[\"LuaScriptState\"] = JSON.encode({ selections = selectedUpgrades })\n end\n end\n end\nend\n\n-- Handles cards that start in play under specific conditions for Ashcan Pete (Regular Pete - Duke, Parallel Pete - Guitar)\n---@param investigatorId String ID for the deck's investigator card. Passed separately because the\n--- investigator may not be included in the cardList\n---@param cardList Table Deck list being created\nfunction handlePeteSignatureAssets(investigatorId, cardList)\n if investigatorId == \"02005\" or investigatorId == \"02005-pb\" then -- regular Pete's front\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"02014\" then -- Duke\n card.zone = startsInPlayTracker()\n end\n end\n elseif investigatorId == \"02005-p\" or investigatorId == \"02005-pf\" then -- parallel Pete's front\n for i, card in ipairs(cardList) do\n if card.metadata.id == \"90047\" then -- Pete's Guitar\n card.zone = startsInPlayTracker()\n end\n end\n end\nend\n\n-- Callback function for investigator cards and minicards to set the correct state for alt art\n---@param card Object Card which needs to be set the state for\n---@param loadAltInvestigator String Contains the name of alternative art for the investigator (\"normal\", \"revised\" or \"promo\")\nfunction loadAltArt(card, loadAltInvestigator)\n -- states are set up this way:\n -- 1 - normal, 2 - revised/promo, 3 - promo (if 2 is revised)\n -- This means we can always load the 2nd state for revised and just get the last state for promo\n if loadAltInvestigator == \"normal\" then\n return\n elseif loadAltInvestigator == \"revised\" then\n card.setState(2)\n elseif loadAltInvestigator == \"promo\" then\n local states = card.getStates()\n card.setState(#states)\n end\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param cardData: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/DeckImporterMain\")\nend)\n__bundle_register(\"arkhamdb/ArkhamDb\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n \n local ArkhamDb = { }\n local internal = { }\n\n local RANDOM_WEAKNESS_ID = \"01000\"\n\n local tabooList = { }\n --Forward declaration\n ---@type Request\n local Request = {}\n local configuration\n\n -- Sets up the ArkhamDb interface. Should be called from the parent object on load.\n ArkhamDb.initialize = function()\n configuration = internal.getConfiguration()\n Request.start({ configuration.api_uri, configuration.taboo }, function(status)\n local json = JSON.decode(internal.fixUtf16String(status.text))\n for _, taboo in pairs(json) do\n ---@type \u003cstring, boolean\u003e\n local cards = {}\n\n for _, card in pairs(JSON.decode(taboo.cards)) do\n cards[card.code] = true\n end\n\n tabooList[taboo.id] = {\n date = taboo.date_start,\n cards = cards\n }\n end\n return true, nil\n end)\n end\n\n -- Start the deck build process for the given player color and deck ID. This\n -- will retrieve the deck from ArkhamDB, and pass to a callback for processing.\n ---@param playerColor String. Color name of the player mat to place this deck on (e.g. \"Red\").\n ---@param deckId String. ArkhamDB deck id to be loaded\n ---@param isPrivate Boolean. Whether this deck is published or private on ArkhamDB\n ---@param loadNewest Boolean. Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean. Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function. Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n ArkhamDb.getDecklist = function(\n playerColor,\n deckId,\n isPrivate,\n loadNewest,\n loadInvestigators,\n callback)\n -- Get a simple card to see if the bag indexes are complete. If not, abort\n -- the deck load. The called method will handle player notification.\n local checkCard = allCardsBagApi.getCardById(\"01001\")\n if (checkCard ~= nil and checkCard.data == nil) then\n return\n end\n\n local deckUri = { configuration.api_uri,\n isPrivate and configuration.private_deck or configuration.public_deck, deckId }\n\n local deck = Request.start(deckUri, function(status)\n if string.find(status.text, \"\u003c!DOCTYPE html\u003e\") then\n internal.maybePrint(\"Private deck ID \" .. deckId .. \" is not shared\", playerColor)\n return false, table.concat({ \"Private deck \", deckId, \" is not shared\" })\n end\n local json = JSON.decode(status.text)\n\n if not json then\n internal.maybePrint(\"Deck ID \" .. deckId .. \" not found\", playerColor)\n return false, \"Deck not found!\"\n end\n\n return true, json\n end)\n\n deck:with(internal.onDeckResult, playerColor, loadNewest, loadInvestigators, callback)\n end\n\n -- Logs that a card could not be loaded in the mod by printing it to the console in the given\n -- color of the player owning the deck. Attempts to look up the name on ArkhamDB for clarity,\n -- but prints the card ID if the name cannot be retrieved.\n ---@param cardId String. ArkhamDB ID of the card that could not be found\n ---@param playerColor String. Color of the player's deck that had the problem\n ArkhamDb.logCardNotFound = function(cardId, playerColor)\n local request = Request.start({\n configuration.api_uri,\n configuration.cards,\n cardId\n },\n function(result)\n local adbCardInfo = JSON.decode(internal.fixUtf16String(result.text))\n local cardName = adbCardInfo.real_name\n if (cardName ~= nil) then\n if (adbCardInfo.xp ~= nil and adbCardInfo.xp \u003e 0) then\n cardName = cardName .. \" (\" .. adbCardInfo.xp .. \")\"\n end\n internal.maybePrint(\"Card not found: \" .. cardName .. \", ArkhamDB ID \" .. cardId, playerColor)\n else\n internal.maybePrint(\"Card not found in ArkhamDB, ID \" .. cardId, playerColor)\n end\n end)\n end\n\n -- Callback when the deck information is received from ArkhamDB. Parses the\n -- response then applies standard transformations to the deck such as adding\n -- random weaknesses and checking for taboos. Once the deck is processed,\n -- passes to loadCards to actually spawn the defined deck.\n ---@param deck ArkhamImportDeck\n ---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n ---@param loadNewest Boolean Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- bondedList A table of cardID keys to meaningless values. Card IDs in this list were\n --- added from a parent bonded card.\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n internal.onDeckResult = function(deck, playerColor, loadNewest, loadInvestigators, callback)\n -- Load the next deck in the upgrade path if the option is enabled\n if (loadNewest and deck.next_deck ~= nil and deck.next_deck ~= \"\") then\n buildDeck(playerColor, deck.next_deck)\n return\n end\n\n internal.maybePrint(table.concat({ \"Found decklist: \", deck.name }), playerColor)\n\n -- Initialize deck slot table and perform common transformations. The order of these should not\n -- be changed, as later steps may act on cards added in each. For example, a random weakness or\n -- investigator may have bonded cards or taboo entries, and should be present\n local slots = deck.slots\n internal.maybeDrawRandomWeakness(slots, playerColor)\n local loadAltInvestigator = \"normal\"\n if loadInvestigators then\n loadAltInvestigator = internal.addInvestigatorCards(deck, slots)\n end\n \n internal.maybeModifyDeckFromDescription(slots, deck.description_md)\n internal.maybeAddSummonedServitor(slots)\n internal.maybeAddOnTheMend(slots, playerColor)\n internal.maybeAddRealityAcidReference(slots)\n local bondList = internal.extractBondedCards(slots)\n internal.checkTaboos(deck.taboo_id, slots, playerColor)\n internal.maybeAddUpgradeSheets(slots)\n\n -- get upgrades for customizable cards\n local customizations = {}\n if deck.meta then\n customizations = JSON.decode(deck.meta)\n end\n\n callback(slots, deck.investigator_code, bondList, customizations, playerColor, loadAltInvestigator)\n end\n\n -- Checks to see if the slot list includes the random weakness ID. If it does,\n -- removes it from the deck and replaces it with the ID of a random basic weakness provided by the\n -- all cards bag\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n --- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast\n --- if a weakness is added.\n internal.maybeDrawRandomWeakness = function(slots, playerColor)\n local randomWeaknessAmount = slots[RANDOM_WEAKNESS_ID] or 0\n slots[RANDOM_WEAKNESS_ID] = nil\n\n if randomWeaknessAmount ~= 0 then\n for i=1, randomWeaknessAmount do\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n slots[weaknessId] = (slots[weaknessId] or 0) + 1\n end\n internal.maybePrint(\"Added \" .. randomWeaknessAmount .. \" random basic weakness(es) to deck\", playerColor)\n end\n end\n\n -- Adds both the investigator (XXXXX) and minicard (XXXXX-m) slots with one copy each\n ---@param deck Table The processed ArkhamDB deck response\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the\n --- number of those cards which will be spawned\n ---@return string: Contains the name of the art that should be loaded (\"normal\", \"promo\" or \"revised\")\n internal.addInvestigatorCards = function(deck, slots)\n local investigatorId = deck.investigator_code\n slots[investigatorId .. \"-m\"] = 1\n local deckMeta = JSON.decode(deck.meta)\n -- handling alternative investigator art and parallel investigators\n local loadAltInvestigator = \"normal\"\n if deckMeta ~= nil then\n local altFrontId = tonumber(deckMeta.alternate_front) or 0\n local altBackId = tonumber(deckMeta.alternate_back) or 0\n local altArt = { front = \"normal\", back = \"normal\" }\n\n -- translating front ID\n if altFrontId \u003e 90000 and altFrontId \u003c 90100 then\n altArt.front = \"parallel\"\n elseif altFrontId \u003e 01500 and altFrontId \u003c 01506 then\n altArt.front = \"revised\"\n elseif altFrontId \u003e 98000 then\n altArt.front = \"promo\"\n end\n\n -- translating back ID\n if altBackId \u003e 90000 and altBackId \u003c 90100 then\n altArt.back = \"parallel\"\n elseif altBackId \u003e 01500 and altBackId \u003c 01506 then\n altArt.back = \"revised\"\n elseif altBackId \u003e 98000 then\n altArt.back = \"promo\"\n end\n\n -- updating investigatorID based on alt investigator selection\n -- precedence: parallel \u003e promo \u003e revised\n if altArt.front == \"parallel\" then\n if altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-p\"\n else\n investigatorId = investigatorId .. \"-pf\"\n end\n elseif altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-pb\"\n elseif altArt.front == \"promo\" or altArt.back == \"promo\" then\n loadAltInvestigator = \"promo\"\n elseif altArt.front == \"revised\" or altArt.back == \"revised\" then\n loadAltInvestigator = \"revised\"\n end\n end\n slots[investigatorId] = 1\n deck.investigator_code = investigatorId\n return loadAltInvestigator\n end\n\n -- Process the card list looking for the customizable cards, and add their upgrade sheets if needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddUpgradeSheets = function(slots)\n for cardId, _ in pairs(slots) do\n -- upgrade sheets for customizable cards\n local upgradesheet = allCardsBagApi.getCardById(cardId .. \"-c\")\n if upgradesheet ~= nil then\n slots[cardId .. \"-c\"] = 1\n end\n end\n end\n\n -- Process the card list looking for the Summoned Servitor, and add its minicard to the list if\n -- needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddSummonedServitor = function(slots)\n if slots[\"09080\"] ~= nil then\n slots[\"09080-m\"] = 1\n end\n end\n\n -- On the Mend should have 1-per-investigator copies set aside, but ArkhamDB always sends 1. Update\n -- the count based on the investigator count\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast if an error occurs\n internal.maybeAddOnTheMend = function(slots, playerColor)\n if slots[\"09006\"] ~= nil then\n local investigatorCount = playAreaApi.getInvestigatorCount()\n if investigatorCount ~= nil then\n slots[\"09006\"] = investigatorCount\n else\n internal.maybePrint(\"Something went wrong with the load, adding 4 copies of On the Mend\", playerColor)\n slots[\"09006\"] = 4\n end\n end\n end\n\n -- Process the card list looking for Reality Acid and adds the reference sheet when needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddRealityAcidReference = function(slots)\n if slots[\"89004\"] ~= nil then\n slots[\"89005\"] = 1\n end\n end\n\n -- Processes the deck description from ArkhamDB and modifies the slot list accordingly\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n ---@param description String The deck desription from ArkhamDB\n internal.maybeModifyDeckFromDescription = function(slots, description)\n -- check for import instructions\n local pos = string.find(description, \"++SCED import instructions++\")\n if not pos then return end\n\n -- remove everything before instructions (including newline)\n local tempStr = string.sub(description, pos + 30)\n \n -- parse each line in instructions\n for line in tempStr:gmatch(\"([^\\n]+)\") do\n -- remove dashes at the start\n line = line:gsub(\"%- \", \"\")\n\n -- remove spaces\n line = line:gsub(\"%s\", \"\")\n\n -- get instructor\n local instructor = \"\"\n for word in line:gmatch(\"%a+:\") do\n instructor = word\n break\n end\n\n if instructor == \"\" or (instructor ~= \"add:\" and instructor ~= \"remove:\") then return end\n\n -- remove instructor from line\n line = line:gsub(instructor, \"\")\n\n -- evaluate instructions\n local cardIds = {}\n for str in line:gmatch(\"([^,]+)\") do\n if instructor == \"add:\" then\n slots[str] = (slots[str] or 0) + 1\n elseif instructor == \"remove:\" then\n if slots[str] == nil then break end\n slots[str] = math.max(slots[str] - 1, 0)\n end\n end\n end\n end\n\n -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list.\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.extractBondedCards = function(slots)\n -- Create a list of bonded cards first so we don't modify slots while iterating\n local bondedCards = { }\n local bondedList = { }\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil and card.metadata.bonded ~= nil) then\n for _, bond in ipairs(card.metadata.bonded) do\n -- add a bonded card for each copy of the parent card (except for Pendant of the Queen)\n if bond.id == \"06022\" then\n bondedCards[bond.id] = bond.count\n else\n bondedCards[bond.id] = bond.count * cardCount\n end\n -- We need to know which cards are bonded to determine their position, remember them\n bondedList[bond.id] = true\n -- Also adding taboo versions of bonded cards to the list\n bondedList[bond.id .. \"-t\"] = true\n end\n end\n end\n -- Add any bonded cards to the main slots list\n for bondedId, bondedCount in pairs(bondedCards) do\n slots[bondedId] = bondedCount\n end\n\n return bondedList\n end\n\n -- Check the deck for cards on its taboo list. If they're found, replace the entry in the slot with the Taboo id (i.e. \"XXXX\" becomes \"XXXX-t\")\n ---@param tabooId String The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.checkTaboos = function(tabooId, slots, playerColor)\n if tabooId then\n for cardId, _ in pairs(tabooList[tabooId].cards) do\n if slots[cardId] ~= nil then\n -- Make sure there's a taboo version of the card before we replace it\n -- SCED only maintains the most recent taboo cards. If a deck is using\n -- an older taboo list it's possible the card isn't a taboo any more\n local tabooCard = allCardsBagApi.getCardById(cardId .. \"-t\")\n if tabooCard == nil then\n local basicCard = allCardsBagApi.getCardById(cardId)\n internal.maybePrint(\"Taboo version for \" .. basicCard.data.Nickname .. \" is not available. Using standard version\", playerColor)\n else\n slots[cardId .. \"-t\"] = slots[cardId]\n slots[cardId] = nil\n end\n end\n end\n end\n end\n\n internal.maybePrint = function(message, playerColor)\n if playerColor ~= \"None\" then\n printToAll(message, playerColor)\n end\n end\n\n -- Gets the ArkhamDB config info from the configuration object.\n ---@return Table. Configuration data\n internal.getConfiguration = function()\n local configuration = getObjectsWithTag(\"import_configuration_provider\")[1]:getTable(\"configuration\")\n printPriority = configuration.priority\n return configuration\n end\n\n internal.fixUtf16String = function(str)\n return str:gsub(\"\\\\u(%w%w%w%w)\", function(match)\n return string.char(tonumber(match, 16))\n end)\n end\n\n ---@type Request\n Request = {\n is_done = false,\n is_successful = false\n }\n\n -- Creates a new instance of a Request. Should not be directly called. Instead use Request.start and Request.deferred.\n ---@param uri string\n ---@param configure fun(request: Request, status: WebRequestStatus)\n ---@return Request\n function Request:new(uri, configure)\n local this = {}\n\n setmetatable(this, self)\n self.__index = self\n\n if type(uri) == \"table\" then\n uri = table.concat(uri, \"/\")\n end\n\n this.uri = uri\n\n WebRequest.get(uri, function(status)\n configure(this, status)\n end)\n\n return this\n end\n\n -- Creates a new request. on_success should set the request's is_done, is_successful, and content variables.\n -- Deferred should be used when you don't want to set is_done immediately (such as if you want to wait for another request to finish)\n ---@param uri string\n ---@param on_success fun(request: Request, status: WebRequestStatus, vararg any)\n ---@param on_error fun(status: WebRequestStatus)|nil\n ---@vararg any[]\n ---@return Request\n function Request.deferred(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request:new(uri, function(request, status)\n if (status.is_done) then\n if (status.is_error) then\n request.error_message = on_error and on_error(status, table.unpack(parameters)) or status.error\n request.is_successful = false\n request.is_done = true\n else\n on_success(request, status)\n end\n end\n end)\n end\n\n -- Creates a new request. on_success should return weather the resultant data is as expected, and the processed content of the request.\n ---@param uri string\n ---@param on_success fun(status: WebRequestStatus, vararg any): boolean, any\n ---@param on_error nil|fun(status: WebRequestStatus, vararg any): string\n ---@vararg any[]\n ---@return Request\n function Request.start(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request.deferred(uri, function(request, status)\n local result, message = on_success(status, table.unpack(parameters))\n if not result then request.error_message = message else request.content = message end\n request.is_successful = result\n request.is_done = true\n end, on_error, table.unpack(parameters))\n end\n\n ---@param requests Request[]\n ---@param on_success fun(content: any[], vararg any[])\n ---@param on_error fun(requests: Request[], vararg any[])|nil\n ---@vararg any\n function Request.with_all(requests, on_success, on_error, ...)\n local parameters = table.pack(...)\n\n Wait.condition(function()\n ---@type any[]\n local results = {}\n\n ---@type Request[]\n local errors = {}\n\n for _, request in ipairs(requests) do\n if request.is_successful then\n table.insert(results, request.content)\n else\n table.insert(errors, request)\n end\n end\n\n if (#errors \u003c= 0) then\n on_success(results, table.unpack(parameters))\n elseif on_error == nil then\n for _, request in ipairs(errors) do\n internal.maybePrint(table.concat({ \"[ERROR]\", request.uri, \":\", request.error_message }))\n end\n else\n on_error(requests, table.unpack(parameters))\n end\n end, function()\n for _, request in ipairs(requests) do\n if not request.is_done then return false end\n end\n return true\n end)\n end\n\n ---@param callback fun(content: any, vararg any)\n function Request:with(callback, ...)\n local arguments = table.pack(...)\n Wait.condition(function()\n if self.is_successful then\n callback(self.content, table.unpack(arguments))\n end\n end, function() return self.is_done\n end)\n end\n\n return ArkhamDb\nend\nend)\n__bundle_register(\"arkhamdb/DeckImporterUi\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\nlocal INPUT_FIELD_HEIGHT = 340\nlocal INPUT_FIELD_WIDTH = 1500\nlocal FIELD_COLOR = { 0.9, 0.7, 0.5 }\n\nlocal PRIVATE_TOGGLE_LABELS = {}\nPRIVATE_TOGGLE_LABELS[true] = \"Private\"\nPRIVATE_TOGGLE_LABELS[false] = \"Published\"\n\nlocal UPGRADED_TOGGLE_LABELS = {}\nUPGRADED_TOGGLE_LABELS[true] = \"Upgraded\"\nUPGRADED_TOGGLE_LABELS[false] = \"Specific\"\n\nlocal LOAD_INVESTIGATOR_TOGGLE_LABELS = {}\nLOAD_INVESTIGATOR_TOGGLE_LABELS[true] = \"Yes\"\nLOAD_INVESTIGATOR_TOGGLE_LABELS[false] = \"No\"\n\nlocal redDeckId = \"\"\nlocal orangeDeckId = \"\"\nlocal whiteDeckId = \"\"\nlocal greenDeckId = \"\"\n\nlocal privateDeck = true\nlocal loadNewestDeck = true\nlocal loadInvestigators = false\n\n-- Returns a table with the full state of the UI, including options and deck IDs.\n-- This can be used to persist via onSave(), or provide values for a load operation\n-- Table values:\n-- redDeck: Deck ID to load for the red player\n-- orangeDeck: Deck ID to load for the orange player\n-- whiteDeck: Deck ID to load for the white player\n-- greenDeck: Deck ID to load for the green player\n-- private: True to load a private deck, false to load a public deck\n-- loadNewest: True if the most upgraded version of the deck should be loaded\n-- investigators: True if investigator cards should be spawned\nfunction getUiState()\n return {\n redDeck = redDeckId,\n orangeDeck = orangeDeckId,\n whiteDeck = whiteDeckId,\n greenDeck = greenDeckId,\n private = privateDeck,\n loadNewest = loadNewestDeck,\n investigators = loadInvestigators\n }\nend\n\n-- Updates the state of the UI based on the provided table. Any values not provided will be left the same.\n---@param uiStateTable Table of values to update on importer\n-- Table values:\n-- redDeck: Deck ID to load for the red player\n-- orangeDeck: Deck ID to load for the orange player\n-- whiteDeck: Deck ID to load for the white player\n-- greenDeck: Deck ID to load for the green player\n-- private: True to load a private deck, false to load a public deck\n-- loadNewest: True if the most upgraded version of the deck should be loaded\n-- investigators: True if investigator cards should be spawned\nfunction setUiState(uiStateTable)\n self.clearButtons()\n self.clearInputs()\n initializeUi(uiStateTable)\nend\n\n-- Sets up the UI for the deck loader, populating fields from the given save state table decoded from onLoad()\nfunction initializeUi(savedUiState)\n if savedUiState ~= nil then\n redDeckId = savedUiState.redDeck\n orangeDeckId = savedUiState.orangeDeck\n whiteDeckId = savedUiState.whiteDeck\n greenDeckId = savedUiState.greenDeck\n privateDeck = savedUiState.private\n loadNewestDeck = savedUiState.loadNewest\n loadInvestigators = savedUiState.investigators\n end\n\n makeOptionToggles()\n makeDeckIdFields()\n makeBuildButton()\nend\n\nfunction makeOptionToggles()\n -- common parameters\n local checkbox_parameters = {}\n checkbox_parameters.function_owner = self\n checkbox_parameters.width = INPUT_FIELD_WIDTH\n checkbox_parameters.height = INPUT_FIELD_HEIGHT\n checkbox_parameters.scale = { 0.1, 0.1, 0.1 }\n checkbox_parameters.font_size = 240\n checkbox_parameters.hover_color = { 0.4, 0.6, 0.8 }\n checkbox_parameters.color = FIELD_COLOR\n\n -- public / private deck\n checkbox_parameters.click_function = \"publicPrivateChanged\"\n checkbox_parameters.position = { 0.25, 0.1, -0.102 }\n checkbox_parameters.tooltip = \"Published or private deck?\\n\\nPLEASE USE A PRIVATE DECK IF JUST FOR TTS TO AVOID FLOODING ARKHAMDB PUBLISHED DECK LISTS!\"\n checkbox_parameters.label = PRIVATE_TOGGLE_LABELS[privateDeck]\n self.createButton(checkbox_parameters)\n\n -- load upgraded?\n checkbox_parameters.click_function = \"loadUpgradedChanged\"\n checkbox_parameters.position = { 0.25, 0.1, -0.01 }\n checkbox_parameters.tooltip = \"Load newest upgrade or exact deck?\"\n checkbox_parameters.label = UPGRADED_TOGGLE_LABELS[loadNewestDeck]\n self.createButton(checkbox_parameters)\n\n -- load investigators?\n checkbox_parameters.click_function = \"loadInvestigatorsChanged\"\n checkbox_parameters.position = { 0.25, 0.1, 0.081 }\n checkbox_parameters.tooltip = \"Spawn investigator cards?\"\n checkbox_parameters.label = LOAD_INVESTIGATOR_TOGGLE_LABELS[loadInvestigators]\n self.createButton(checkbox_parameters)\nend\n\n-- Create the four deck ID entry fields\nfunction makeDeckIdFields()\n local input_parameters = {}\n -- Parameters common to all entry fields\n input_parameters.function_owner = self\n input_parameters.scale = { 0.1, 0.1, 0.1 }\n input_parameters.width = INPUT_FIELD_WIDTH\n input_parameters.height = INPUT_FIELD_HEIGHT\n input_parameters.font_size = 320\n input_parameters.tooltip = \"Deck ID from ArkhamDB URL of the deck\\nPublic URL: 'https://arkhamdb.com/decklist/view/101/knowledge-overwhelming-solo-deck-1.0' = '101'\\nPrivate URL: 'https://arkhamdb.com/deck/view/102' = '102'\"\n input_parameters.alignment = 3 -- Center\n input_parameters.color = FIELD_COLOR\n input_parameters.font_color = { 0, 0, 0 }\n input_parameters.validation = 2 -- Integer\n\n -- Green\n input_parameters.input_function = \"greenDeckChanged\"\n input_parameters.position = { -0.166, 0.1, 0.385 }\n input_parameters.value = greenDeckId\n self.createInput(input_parameters)\n -- Red\n input_parameters.input_function = \"redDeckChanged\"\n input_parameters.position = { 0.171, 0.1, 0.385 }\n input_parameters.value = redDeckId\n self.createInput(input_parameters)\n -- White\n input_parameters.input_function = \"whiteDeckChanged\"\n input_parameters.position = { -0.166, 0.1, 0.474 }\n input_parameters.value = whiteDeckId\n self.createInput(input_parameters)\n -- Orange\n input_parameters.input_function = \"orangeDeckChanged\"\n input_parameters.position = { 0.171, 0.1, 0.474 }\n input_parameters.value = orangeDeckId\n self.createInput(input_parameters)\nend\n\n-- Create the Build All button. This is a transparent button which covers the Build All portion of the background graphic\nfunction makeBuildButton()\n local button_parameters = {}\n button_parameters.click_function = \"loadDecks\"\n button_parameters.function_owner = self\n button_parameters.position = { 0, 0.1, 0.71 }\n button_parameters.width = 320\n button_parameters.height = 30\n button_parameters.color = { 0, 0, 0, 0 }\n button_parameters.tooltip = \"Click to build all four decks!\"\n self.createButton(button_parameters)\nend\n\n-- Event handlers for deck ID change\nfunction redDeckChanged(_, _, inputValue) redDeckId = inputValue end\n\nfunction orangeDeckChanged(_, _, inputValue) orangeDeckId = inputValue end\n\nfunction whiteDeckChanged(_, _, inputValue) whiteDeckId = inputValue end\n\nfunction greenDeckChanged(_, _, inputValue) greenDeckId = inputValue end\n\n-- Event handlers for toggle buttons\nfunction publicPrivateChanged()\n privateDeck = not privateDeck\n self.editButton { index = 0, label = PRIVATE_TOGGLE_LABELS[privateDeck] }\nend\n\nfunction loadUpgradedChanged()\n loadNewestDeck = not loadNewestDeck\n self.editButton { index = 1, label = UPGRADED_TOGGLE_LABELS[loadNewestDeck] }\nend\n\nfunction loadInvestigatorsChanged()\n loadInvestigators = not loadInvestigators\n self.editButton { index = 2, label = LOAD_INVESTIGATOR_TOGGLE_LABELS[loadInvestigators] }\nend\n\nfunction loadDecks()\n -- testLoadLotsOfDecks()\n -- Method in DeckImporterMain, visible due to inclusion\n\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n if (redDeckId ~= nil and redDeckId ~= \"\") then\n buildDeck(\"Red\", redDeckId)\n end\n if (orangeDeckId ~= nil and orangeDeckId ~= \"\") then\n buildDeck(\"Orange\", orangeDeckId)\n end\n if (whiteDeckId ~= nil and whiteDeckId ~= \"\") then\n buildDeck(\"White\", whiteDeckId)\n end\n if (greenDeckId ~= nil and greenDeckId ~= \"\") then\n buildDeck(\"Green\", greenDeckId)\n end\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"playermat/Zones\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Sets up and returns coordinates for all possible spawn zones. Because Lua assigns tables by reference\n-- and there is no built-in function to copy a table this is relatively brute force.\n--\n-- Positions are all relative to the player mat, and most are consistent. The\n-- exception are the SetAside# zones, which are placed to the left of the mat\n-- for White/Green, and the right of the mat for Orange/Red.\n--\n-- Investigator: Investigator card area.\n-- Minicard: Placement for the investigator's minicard, just above the player mat\n-- Deck, Discard: Standard locations for the deck and discard piles.\n-- Blank1: used for assets that start in play (e.g. Duke)\n-- Tarot, Hand1, Hand2, Ally, Blank4, Accessory, Arcane1, Arcane2, Body: Asset slot positions\n-- Threat[1-4]: Threat area slots. Threat[1-3] correspond to the named threat area slots, and Threat4 is the blank threat area slot.\n-- SetAside[1-3]: Column closest to the player mat, with 1 at the top and 3 at the bottom.\n-- SetAside[4-6]: Column farther away from the mat, with 4 at the top and 6 at the bottom.\n-- SetAside1: Permanent cards\n-- SetAside2: Bonded cards\n-- SetAside3: Ancestral Knowledge / Underworld Market\n-- SetAside4: Upgrade sheets for customizable cards\n-- SetAside5: Hunch Deck for Joe Diamond\n-- SetAside6: currently unused\ndo\n local playmatApi = require(\"playermat/PlaymatApi\")\n local Zones = { }\n\n local commonZones = {}\n commonZones[\"Investigator\"] = { -1.177, 0, 0.002 }\n commonZones[\"Deck\"] = { -1.82, 0, 0 }\n commonZones[\"Discard\"] = { -1.82, 0, 0.61 }\n commonZones[\"Ally\"] = { -0.615, 0, 0.024 }\n commonZones[\"Body\"] = { -0.630, 0, 0.553 }\n commonZones[\"Hand1\"] = { 0.215, 0, 0.042 }\n commonZones[\"Hand2\"] = { -0.180, 0, 0.037 }\n commonZones[\"Arcane1\"] = { 0.212, 0, 0.559 }\n commonZones[\"Arcane2\"] = { -0.171, 0, 0.557 }\n commonZones[\"Tarot\"] = { 0.602, 0, 0.033 }\n commonZones[\"Accessory\"] = { 0.602, 0, 0.555 }\n commonZones[\"Blank1\"] = { 1.758, 0, 0.040 }\n commonZones[\"Blank2\"] = { 1.754, 0, 0.563 }\n commonZones[\"Blank3\"] = { 1.371, 0, 0.038 }\n commonZones[\"Blank4\"] = { 1.371, 0, 0.558 }\n commonZones[\"Blank5\"] = { 0.98, 0, 0.035 }\n commonZones[\"Blank6\"] = { 0.977, 0, 0.556 }\n commonZones[\"Threat1\"] = { -0.911, 0, -0.625 }\n commonZones[\"Threat2\"] = { -0.454, 0, -0.625 }\n commonZones[\"Threat3\"] = { 0.002, 0, -0.625 }\n commonZones[\"Threat4\"] = { 0.459, 0, -0.625 }\n\n local zoneData = {}\n zoneData[\"White\"] = {}\n zoneData[\"White\"][\"Investigator\"] = commonZones[\"Investigator\"]\n zoneData[\"White\"][\"Deck\"] = commonZones[\"Deck\"]\n zoneData[\"White\"][\"Discard\"] = commonZones[\"Discard\"]\n zoneData[\"White\"][\"Ally\"] = commonZones[\"Ally\"]\n zoneData[\"White\"][\"Body\"] = commonZones[\"Body\"]\n zoneData[\"White\"][\"Hand1\"] = commonZones[\"Hand1\"]\n zoneData[\"White\"][\"Hand2\"] = commonZones[\"Hand2\"]\n zoneData[\"White\"][\"Arcane1\"] = commonZones[\"Arcane1\"]\n zoneData[\"White\"][\"Arcane2\"] = commonZones[\"Arcane2\"]\n zoneData[\"White\"][\"Tarot\"] = commonZones[\"Tarot\"]\n zoneData[\"White\"][\"Accessory\"] = commonZones[\"Accessory\"]\n zoneData[\"White\"][\"Blank1\"] = commonZones[\"Blank1\"]\n zoneData[\"White\"][\"Blank2\"] = commonZones[\"Blank2\"]\n zoneData[\"White\"][\"Blank3\"] = commonZones[\"Blank3\"]\n zoneData[\"White\"][\"Blank4\"] = commonZones[\"Blank4\"]\n zoneData[\"White\"][\"Blank5\"] = commonZones[\"Blank5\"]\n zoneData[\"White\"][\"Blank6\"] = commonZones[\"Blank6\"]\n zoneData[\"White\"][\"Threat1\"] = commonZones[\"Threat1\"]\n zoneData[\"White\"][\"Threat2\"] = commonZones[\"Threat2\"]\n zoneData[\"White\"][\"Threat3\"] = commonZones[\"Threat3\"]\n zoneData[\"White\"][\"Threat4\"] = commonZones[\"Threat4\"]\n zoneData[\"White\"][\"Minicard\"] = { -1, 0, -1.45 }\n zoneData[\"White\"][\"SetAside1\"] = { 2.35, 0, -0.520 }\n zoneData[\"White\"][\"SetAside2\"] = { 2.35, 0, 0.042 }\n zoneData[\"White\"][\"SetAside3\"] = { 2.35, 0, 0.605 }\n zoneData[\"White\"][\"UnderSetAside3\"] = { 2.50, 0, 0.805 }\n zoneData[\"White\"][\"SetAside4\"] = { 2.78, 0, -0.520 }\n zoneData[\"White\"][\"SetAside5\"] = { 2.78, 0, 0.042 }\n zoneData[\"White\"][\"SetAside6\"] = { 2.78, 0, 0.605 }\n zoneData[\"White\"][\"UnderSetAside6\"] = { 2.93, 0, 0.805 }\n\n zoneData[\"Orange\"] = {}\n zoneData[\"Orange\"][\"Investigator\"] = commonZones[\"Investigator\"]\n zoneData[\"Orange\"][\"Deck\"] = commonZones[\"Deck\"]\n zoneData[\"Orange\"][\"Discard\"] = commonZones[\"Discard\"]\n zoneData[\"Orange\"][\"Ally\"] = commonZones[\"Ally\"]\n zoneData[\"Orange\"][\"Body\"] = commonZones[\"Body\"]\n zoneData[\"Orange\"][\"Hand1\"] = commonZones[\"Hand1\"]\n zoneData[\"Orange\"][\"Hand2\"] = commonZones[\"Hand2\"]\n zoneData[\"Orange\"][\"Arcane1\"] = commonZones[\"Arcane1\"]\n zoneData[\"Orange\"][\"Arcane2\"] = commonZones[\"Arcane2\"]\n zoneData[\"Orange\"][\"Tarot\"] = commonZones[\"Tarot\"]\n zoneData[\"Orange\"][\"Accessory\"] = commonZones[\"Accessory\"]\n zoneData[\"Orange\"][\"Blank1\"] = commonZones[\"Blank1\"]\n zoneData[\"Orange\"][\"Blank2\"] = commonZones[\"Blank2\"]\n zoneData[\"Orange\"][\"Blank3\"] = commonZones[\"Blank3\"]\n zoneData[\"Orange\"][\"Blank4\"] = commonZones[\"Blank4\"]\n zoneData[\"Orange\"][\"Blank5\"] = commonZones[\"Blank5\"]\n zoneData[\"Orange\"][\"Blank6\"] = commonZones[\"Blank6\"]\n zoneData[\"Orange\"][\"Threat1\"] = commonZones[\"Threat1\"]\n zoneData[\"Orange\"][\"Threat2\"] = commonZones[\"Threat2\"]\n zoneData[\"Orange\"][\"Threat3\"] = commonZones[\"Threat3\"]\n zoneData[\"Orange\"][\"Threat4\"] = commonZones[\"Threat4\"]\n zoneData[\"Orange\"][\"Minicard\"] = { 1, 0, -1.45 }\n zoneData[\"Orange\"][\"SetAside1\"] = { -2.35, 0, -0.520 }\n zoneData[\"Orange\"][\"SetAside2\"] = { -2.35, 0, 0.042}\n zoneData[\"Orange\"][\"SetAside3\"] = { -2.35, 0, 0.605 }\n zoneData[\"Orange\"][\"UnderSetAside3\"] = { -2.50, 0, 0.805 }\n zoneData[\"Orange\"][\"SetAside4\"] = { -2.78, 0, -0.520 }\n zoneData[\"Orange\"][\"SetAside5\"] = { -2.78, 0, 0.042 }\n zoneData[\"Orange\"][\"SetAside6\"] = { -2.78, 0, 0.605 }\n zoneData[\"Orange\"][\"UnderSetAside6\"] = { -2.93, 0, 0.805 }\n\n -- Green positions are the same as White and Red the same as Orange\n zoneData[\"Red\"] = zoneData[\"Orange\"]\n zoneData[\"Green\"] = zoneData[\"White\"]\n\n -- Gets the global position for the given zone on the specified player mat.\n ---@param playerColor: Color name of the player mat to get the zone position for (e.g. \"Red\")\n ---@param zoneName: Name of the zone to get the position for. See Zones object documentation for a list of valid zones.\n ---@return: Global position table, or nil if an invalid player color or zone is specified\n Zones.getZonePosition = function(playerColor, zoneName)\n if (playerColor ~= \"Red\"\n and playerColor ~= \"Orange\"\n and playerColor ~= \"White\"\n and playerColor ~= \"Green\") then\n return nil\n end\n return playmatApi.transformLocalPosition(zoneData[playerColor][zoneName], playerColor)\n end\n\n -- Return the global rotation for a card on the given player mat, based on its zone.\n ---@param playerColor: Color name of the player mat to get the rotation for (e.g. \"Red\")\n ---@param zoneName: Name of the zone. See Zones object documentation for a list of valid zones.\n ---@return: Global rotation vector for the given card. This will include the\n -- Y rotation to orient the card on the given player mat as well as a\n -- Z rotation to place the card face up or face down.\n Zones.getDefaultCardRotation = function(playerColor, zoneName)\n local cardRotation = playmatApi.returnRotation(playerColor)\n if zoneName == \"Deck\" then\n cardRotation = cardRotation + Vector(0, 0, 180)\n end\n return cardRotation\n end\n\n return Zones\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"greenDeck\":\"\",\"investigators\":true,\"loadNewest\":true,\"orangeDeck\":\"\",\"private\":true,\"redDeck\":\"\",\"whiteDeck\":\"\"}", "MeasureMovement": false, "Name": "Custom_Tile", @@ -89391,7 +88191,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/Configuration\")\nend)\n__bundle_register(\"arkhamdb/Configuration\", function(require, _LOADED, __bundle_register, __bundle_modules)\n---@type ArkhamImportConfiguration\nconfiguration = {\n api_uri = \"https://arkhamdb.com/api/public\",\n public_deck = \"decklist\",\n private_deck = \"deck\",\n cards = \"card\",\n taboo = \"taboos\",\n card_bag_guid = \"15bb07\"\n}\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"arkhamdb/Configuration\", function(require, _LOADED, __bundle_register, __bundle_modules)\n---@type ArkhamImportConfiguration\nconfiguration = {\n api_uri = \"https://arkhamdb.com/api/public\",\n public_deck = \"decklist\",\n private_deck = \"deck\",\n cards = \"card\",\n taboo = \"taboos\",\n card_bag_guid = \"15bb07\"\n}\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/Configuration\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Checker_white", @@ -89508,7 +88308,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/PlayAreaSelector\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayAreaImageData\") -- this fills the variable \"PLAYAREA_IMAGE_DATA\"\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal typeIndex, selectionIndex\n\nfunction onSave() return JSON.encode({typeIndex = typeIndex, selectionIndex = selectionIndex}) end\n\nfunction onLoad(savedData)\n self.createButton({\n function_owner = self,\n click_function = \"onClick_toggleGallery\",\n tooltip = \"Show Image Gallery\",\n height = 1500,\n width = 1500,\n color = { 1, 1, 1, 0 }\n })\n\n local loadedData = JSON.decode(savedData) or {}\n typeIndex = loadedData.typeIndex or 1\n selectionIndex = loadedData.selectionIndex or 1\n Wait.time(updatePlayareaGallery, 0.5)\nend\n\n-- click function for main button\nfunction onClick_toggleGallery()\n Global.call(\"togglePlayareaGallery\")\nend\n\nfunction onClick_defaultImage()\n playAreaApi.updateSurface()\n Global.call(\"togglePlayareaGallery\")\nend\n\nfunction getDataSubTableByIndex(dataTable, index)\n local loopId = 1\n for i, v in pairs(dataTable) do\n if index == loopId then return v end\n loopId = loopId + 1\n end\n return {}\nend\n\nfunction updatePlayareaGallery()\n -- get subtables\n local dataForType = getDataSubTableByIndex(PLAYAREA_IMAGE_DATA, typeIndex)\n local dataForSelection = getDataSubTableByIndex(dataForType, selectionIndex)\n\n -- get global xml to insert elements\n local globalXml = UI.getXmlTable()\n\n -- selectable items\n local itemSelection = getXmlTableElementById(globalXml, 'itemSelection')\n itemSelection.children = {}\n\n local i = 0\n for itemName, _ in pairs(dataForType) do\n i = i + 1\n table.insert(itemSelection.children,\n {\n tag = \"Panel\",\n attributes = { class = \"itemPanel\", id = \"typePanel\" .. i },\n children = {\n tag = \"Text\",\n value = itemName,\n attributes = { class = \"itemText\", id = \"typeListText\" .. i }\n }\n })\n end\n\n -- selectable images for that item\n local playareaList = getXmlTableElementById(globalXml, 'playareaList')\n playareaList.children = {}\n\n for i, v in ipairs(dataForSelection) do\n table.insert(playareaList.children,\n {\n tag = \"VerticalLayout\",\n attributes = { class = \"imageBox\", id = \"image\" .. i },\n children = {\n {\n tag = 'Image',\n attributes = { class = \"playareaImage\", image = v.URL }\n },\n {\n tag = 'Text',\n value = v.Name,\n attributes = { class = \"imageName\" }\n }\n }\n })\n end\n\n playareaList.attributes.height = round(#playareaList.children / 2, 0) * 380\n UI.setXmlTable(globalXml)\n Wait.time(highlightTabAndItem, 0.1)\nend\n\nfunction onClick_imageTab(_, _, tabId)\n typeIndex = tonumber(tabId:sub(9))\n selectionIndex = 1\n updatePlayareaGallery()\nend\n\nfunction onClick_listItem(_, _, listId)\n selectionIndex = tonumber(listId:sub(10))\n updatePlayareaGallery()\nend\n\nfunction onClick_image(_, _, id)\n local imageIndex = tonumber(id:sub(6))\n local dataForType = getDataSubTableByIndex(PLAYAREA_IMAGE_DATA, typeIndex)\n local dataForSelection = getDataSubTableByIndex(dataForType, selectionIndex)\n local newURL = dataForSelection[imageIndex].URL\n playAreaApi.updateSurface(newURL)\n Global.call(\"togglePlayareaGallery\")\nend\n\nfunction highlightTabAndItem()\n -- highlight active tab\n for i = 1, 5 do\n local color = \"#888888\"\n if i == typeIndex then color = \"#ffffff\" end\n UI.setAttribute(\"imageTab\" .. i, \"color\", color)\n end\n\n -- highlight item\n UI.setAttribute(\"typePanel\" .. selectionIndex, \"color\", \"grey\")\n UI.setAttribute(\"typeListText\" .. selectionIndex, \"color\", \"black\")\nend\n\n-- loops through an XML table and returns the specified object\n---@param ui Table XmlTable (get this via getXmlTable)\n---@param id String Id of the object to return\nfunction getXmlTableElementById(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = getXmlTableElementById(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n-- utility function\nfunction round(num, numDecimalPlaces)\n local mult = 10 ^ (numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/PlayAreaImageData\", function(require, _LOADED, __bundle_register, __bundle_modules)\nPLAYAREA_IMAGE_DATA = {\n [\"Official Campaigns\"] = {\n [\"Night of the Zealot\"] = {\n {\n Name = \"I - The Gathering 1\",\n URL = \"https://i.ibb.co/6NWqg1K/Zealot-Gathering.jpg\"\n },\n {\n Name = \"III - Devourer Below 1\",\n URL = \"https://i.ibb.co/x5QFzrx/Zealot-3-Devourer-Below-Helen-Castelow.png\"\n },\n {\n Name = \"III - Devourer Below 2\",\n URL = \"https://i.ibb.co/6r6LFGz/Zealot-3-Devourer-Below-Sarah-Miller.png\"\n }\n },\n [\"The Dunwich Legacy\"] = {\n {\n Name = \"I-A - Extracurricular Activity 1\",\n URL = \"https://i.ibb.co/tDxX8KS/Dunwich-1-Extracurricular-Activity-Igor-Kirdeika.jpg\"\n },\n {\n Name = \"I-A - Extracurricular Activity 2\",\n URL = \"https://i.ibb.co/RQ6z0pj/Dunwich-1-Extracurricular-Activity-Joseph-Diaz.jpg\"\n },\n {\n Name = \"I-A - Extracurricular Activity 3\",\n URL = \"https://i.ibb.co/nnJdwL2/Dunwich-1-Extracurricular-Activity-Tomasz-Jedruszek.jpg\"\n },\n {\n Name = \"I-B - House Always Wins 1\",\n URL = \"https://i.ibb.co/8XPLdr9/Dunwich-2-House-Always-Wins-Jonny-Klein.jpg\"\n },\n {\n Name = \"I-B - House Always Wins 2\",\n URL = \"https://i.ibb.co/HtX95GK/Dunwich-2-House-Always-Wins-Robert-Laskey.jpg\"\n },\n {\n Name = \"I-B - House Always Wins 3\",\n URL = \"https://i.ibb.co/MCLP3Sz/Dunwich-2-House-Always-Wins-XX-l.jpg\"\n },\n {\n Name = \"I-B - House Always Wins 4\",\n URL = \"https://i.ibb.co/w7Pf5sd/Dunwich-2-House-Always-Wins-XX-l-2.jpg\"\n },\n {\n Name = \"II - Miskatonic Museum 1\",\n URL = \"https://i.ibb.co/x1Kf7qG/Dunwich-3-Miskatonic-Museum-Emre-Aktuna.jpg\"\n },\n {\n Name = \"II - Miskatonic Museum 2\",\n URL = \"https://i.ibb.co/yWXVPcN/Dunwich-3-Miskatonic-Museum-Richard-Wright.jpg\"\n },\n {\n Name = \"III - Essex County Express\",\n URL = \"https://i.ibb.co/602CMZb/Dunwich-4-Essex-County-Express-David-Alvarez.jpg\"\n },\n {\n Name = \"IV - Blood on the Altar 1\",\n URL = \"https://i.ibb.co/3CYHDhf/Dunwich-5-Blood-on-the-Altar.jpg\"\n },\n {\n Name = \"IV - Blood on the Altar 2\",\n URL = \"https://i.ibb.co/FbxcCY2/Dunwich-5-Blood-on-the-Altar-Chris-Ostrowski.jpg\"\n },\n {\n Name = \"IV - Blood on the Altar 3\",\n URL = \"https://i.ibb.co/sJf6YsZ/Dunwich-5-Blood-on-the-Altar-Lucas-Staniec.jpg\"\n },\n {\n Name = \"IV - Blood on the Altar 4\",\n URL = \"https://i.ibb.co/kBPNGBd/Dunwich-5-Blood-on-the-Altar-Mark-Molnar.jpg\"\n },\n {\n Name = \"V - Undimensioned and Unseen 1\",\n URL = \"https://i.ibb.co/QvfhjDv/Dunwich-6-Undimensioned-and-Unseen-Frej-Agelii.jpg\"\n },\n {\n Name = \"V - Undimensioned and Unseen 2\",\n URL = \"https://i.ibb.co/4VL9gSK/Dunwich-6-Undimensioned-and-Unseen-Lucas-Staniec.jpg\"\n },\n {\n Name = \"V - Undimensioned and Unseen 3\",\n URL = \"https://i.ibb.co/wBFsS8P/Dunwich-6-Undimensioned-and-Unseen-Michal-Teliga-jpg.jpg\"\n },\n {\n Name = \"V - Undimensioned and Unseen 4\",\n URL = \"https://i.ibb.co/wwGDcq6/Dunwich-6-Undimensioned-and-Unseen-Tomasz-Jedruszek.jpg\"\n },\n {\n Name = \"VI - Where Doom Awaits 1\",\n URL = \"https://i.ibb.co/TvMwqj4/Dunwich-7-Where-Doom-Awaits.jpg\"\n },\n {\n Name = \"VI - Where Doom Awaits 2\",\n URL = \"https://i.ibb.co/S6cSLH9/Dunwich-7-Where-Doom-Awaits-3.jpg\"\n },\n {\n Name = \"VI - Where Doom Awaits 3\",\n URL = \"https://i.ibb.co/khBX32g/Dunwich-7-Where-Doom-Awaits-4.jpg\"\n },\n {\n Name = \"VI - Where Doom Awaits 4\",\n URL = \"https://i.ibb.co/S0hcwN8/Dunwich-7-Where-Doom-Awaits-5.jpg\"\n },\n {\n Name = \"VI - Where Doom Awaits 5\",\n URL = \"https://i.ibb.co/Lxv1Bjp/Dunwich-7-Where-Doom-Awaits-Luca-Trentin.jpg\"\n },\n {\n Name = \"VII - Lost in Time and Space 1\",\n URL = \"https://i.ibb.co/rtTpbDx/Dunwich-8-Lost-in-Time-amp-Space.jpg\"\n },\n {\n Name = \"VII - Lost in Time and Space 2\",\n URL = \"https://i.ibb.co/dBXP0GL/Dunwich-8-Lost-in-Time-amp-Space-Chris-Ostrowski.jpg\"\n },\n {\n Name = \"VII - Lost in Time and Space 3\",\n URL = \"https://i.ibb.co/0XcnxFD/Dunwich-8-Lost-in-Time-amp-Space-Lino-Drieghe.jpg\"\n }\n },\n [\"The Path to Carcosa\"] = {\n {\n Name = \"I - Curtain Call\",\n URL = \"https://i.ibb.co/TcnKXJD/Carcosa-1-Curtain-Call-Mark-Molnar.jpg\"\n },\n {\n Name = \"II - Last King 1\",\n URL = \"https://i.ibb.co/JRQJKR8/Carcosa-2-Last-King-Cristi-Balanescu.jpg\"\n },\n {\n Name = \"II - Last King 2\",\n URL = \"https://i.ibb.co/NZzBwgv/Carcosa-2-Last-King-Cristi-Balanescu-2.jpg\"\n },\n {\n Name = \"II - Last King 3\",\n URL = \"https://i.ibb.co/x56ZHt7/Carcosa-2-Last-King-Wu-Mengjia.jpg\"\n },\n {\n Name = \"III - Echoes of the Past\",\n URL = \"https://i.ibb.co/R6gSm0D/Carcosa-3-Echoes-of-the-Past-Heather-Savage.jpg\"\n },\n {\n Name = \"IV - Unspeakable Oath 1\",\n URL = \"https://i.ibb.co/DzzDQQQ/Carcosa-4-Unspeakable-Oath.jpg\"\n },\n {\n Name = \"IV - Unspeakable Oath 2\",\n URL = \"https://i.ibb.co/9gqBzXr/Carcosa-4-Unspeakable-Oath-2-Mark-Molnar.jpg\"\n },\n {\n Name = \"IV - Unspeakable Oath 3\",\n URL = \"https://i.ibb.co/wWL73c9/Carcosa-4-Unspeakable-Oath-Paul-Fairbairn.jpg\"\n },\n {\n Name = \"V - Phantom of Truth 1\",\n URL = \"https://i.ibb.co/mzpz1Dd/Carcosa-5-Phantom-of-Truth-Lucas-Staniec.jpg\"\n },\n {\n Name = \"V - Phantom of Truth 2\",\n URL = \"https://i.ibb.co/Vp1wNbT/Carcosa-5-Phantom-of-Truth-Tomasz-Jedruszek.jpg\"\n },\n {\n Name = \"VI - Pallid Mask 1\",\n URL = \"https://i.ibb.co/Bf5LByY/Carcosa-6-Pallid-Mask-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"VI - Pallid Mask 2\",\n URL = \"https://i.ibb.co/1v1J9Xx/Carcosa-6-Pallid-Mask-Rafal-Pyra.jpg\"\n },\n {\n Name = \"VII - Black Star Rises 1\",\n URL = \"https://i.ibb.co/TB451t7/Carcosa-7-Black-Star-Rises-Audric-Gatoux.jpg\"\n },\n {\n Name = \"VII - Black Star Rises 2\",\n URL = \"https://i.ibb.co/nC8Ncxx/Carcosa-7-Black-Star-Rises-Chris-Kintner.jpg\"\n },\n {\n Name = \"VIII - Dim Carcosa 1\",\n URL = \"https://i.ibb.co/QvS4y3D/Carcosa-8-Dim-Carcosa-Alexandr-Elichev.jpg\"\n },\n {\n Name = \"VIII - Dim Carcosa 2\",\n URL = \"https://i.ibb.co/hR95x7k/Carcosa-8-Dim-Carcosa-Yuri-Shepherd.jpg\"\n }\n },\n [\"The Forgotten Age\"] = {\n {\n Name = \"I - Untamed Wilds 1\",\n URL = \"https://i.ibb.co/BLhwCG1/Forgotten-Age-1-Untamed-Wilds-David-Frasheski.jpg\"\n },\n {\n Name = \"I - Untamed Wilds 2\",\n URL = \"https://i.ibb.co/SnJfsNy/Forgotten-Age-1-Untamed-Wilds-David-Frasheski-2.jpg\"\n },\n {\n Name = \"I - Untamed Wilds 3\",\n URL = \"https://i.ibb.co/kcx1tvp/Forgotten-Age-1-Untamed-Wilds-Ethan-Patrick-Harris.jpg\"\n },\n {\n Name = \"I - Untamed Wilds 4\",\n URL = \"https://i.ibb.co/HPbJwXk/Forgotten-Age-1-Untamed-Wilds-Lucas-Staniec.jpg\"\n },\n {\n Name = \"I - Untamed Wilds 5\",\n URL = \"https://i.ibb.co/bbq1ZrK/Forgotten-Age-1-Untamed-Wilds-Nele-Diel.jpg\"\n },\n {\n Name = \"II - Doom of Etzli 1\",\n URL = \"https://i.ibb.co/Pw4by4q/Forgotten-Age-2-Doom-of-Eztli-Cristi-Balanescu.jpg\"\n },\n {\n Name = \"II - Doom of Etzli 2\",\n URL = \"https://i.ibb.co/xqW6cXR/Forgotten-Age-2-Doom-of-Eztli-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"II - Doom of Etzli 3\",\n URL = \"https://i.ibb.co/kgsC3pb/Forgotten-Age-2-Doom-of-Eztli-Nele-Diel.jpg\"\n },\n {\n Name = \"III - Threads of Fate\",\n URL = \"https://i.ibb.co/Bn0Pjng/Forgotten-Age-3-Threads-of-Fate-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"IV - Boundary Beyond 1\",\n URL = \"https://i.ibb.co/yPZ9v2X/Forgotten-Age-4-Boundary-Beyond-Greg-Bobrowski-2-jpg.jpg\"\n },\n {\n Name = \"IV - Boundary Beyond 2\",\n URL = \"https://i.ibb.co/vm0JgFs/Forgotten-Age-4-Boundary-Beyond-Greg-Bobrowski-jpg.jpg\"\n },\n {\n Name = \"IV - Boundary Beyond 3\",\n URL = \"https://i.ibb.co/D1rh9Ry/Forgotten-Age-4-Boundary-Beyond-Nele-Diel.jpg\"\n },\n {\n Name = \"V - Heart of the Elders I-1\",\n URL = \"https://i.ibb.co/jzKvv6P/Forgotten-Age-5-Heart-of-the-Elders-I-Lucas-Staniec.jpg\"\n },\n {\n Name = \"V - Heart of the Elders I-2\",\n URL = \"https://i.ibb.co/mR79MX4/Forgotten-Age-5-Heart-of-the-Elders-I-Lucas-Staniec-2.jpg\"\n },\n {\n Name = \"V - Heart of the Elders II\",\n URL = \"https://i.ibb.co/pQSbL0t/Forgotten-Age-5-Heart-of-the-Elders-II-Nele-Diel.jpg\"\n },\n {\n Name = \"VI - City of Archives 1\",\n URL = \"https://i.ibb.co/f04DSPb/Forgotten-Age-6-City-of-Archives.jpg\"\n },\n {\n Name = \"VI - City of Archives 2\",\n URL = \"https://i.ibb.co/WsSBrYj/Forgotten-Age-6-City-of-Archives-2.jpg\"\n },\n {\n Name = \"VI - City of Archives 3\",\n URL = \"https://i.ibb.co/qdPbSZ8/Forgotten-Age-6-City-of-Archives-Chris-Ostrowski.jpg\"\n },\n {\n Name = \"VII - Depths of Yoth 1\",\n URL = \"https://i.ibb.co/dbLKgGv/Forgotten-Age-7-Depths-of-Yoth-Diego-Arbetta.jpg\"\n },\n {\n Name = \"VII - Depths of Yoth 2\",\n URL = \"https://i.ibb.co/NW7Wp98/Forgotten-Age-7-Depths-of-Yoth-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"VII - Depths of Yoth 3\",\n URL = \"https://i.ibb.co/257zr7c/Forgotten-Age-7-Depths-of-Yoth-Greg-Bobrowski-2-jpg.jpg\"\n },\n {\n Name = \"VIII - Shattered Aeons 1\",\n URL = \"https://i.ibb.co/KwnWTGR/Forgotten-Age-8-Shattered-Aeons.jpg\"\n },\n {\n Name = \"VIII - Shattered Aeons 2\",\n URL = \"https://i.ibb.co/b7kVd4F/Forgotten-Age-8-Shattered-Aeons-Alexandr-Elichev.jpg\"\n }\n },\n [\"The Circle Undone\"] = {\n {\n Name = \"0 - Prologue\",\n URL = \"https://i.ibb.co/gm4C6yy/Circle-Undone-0-Prologue-Ted-Galaday.jpg\"\n },\n {\n Name = \"I - Witching Hour\",\n URL = \"https://i.ibb.co/kgJ34WS/Circle-Undone-1-Witching-Hour-Nele-Diel.jpg\"\n },\n {\n Name = \"II - At Death's Doorstep 1\",\n URL = \"https://i.ibb.co/qNWzH0Y/Circle-Undone-2-At-Death-039-s-Doorstep-Emilio-Rodriguez.jpg\"\n },\n {\n Name = \"II - At Death's Doorstep 2\",\n URL = \"https://i.ibb.co/T1zp1QN/Circle-Undone-2-At-Death-039-s-Doorstep-Emilio-Rodriguez-2.jpg\"\n },\n {\n Name = \"II - At Death's Doorstep 3\",\n URL = \"https://i.ibb.co/ZJfYZ1w/Circle-Undone-2-At-Death-039-s-Doorstep-Majid-Azim.jpg\"\n },\n {\n Name = \"III - The Secret Name 1\",\n URL = \"https://i.ibb.co/hsBw4JQ/Circle-Undone-3-Secret-Name-Jeff-Jumper.jpg\"\n },\n {\n Name = \"III - The Secret Name 2\",\n URL = \"https://i.ibb.co/MpcPXR5/Circle-Undone-3-Secret-Name-Pierre-Santamaria.jpg\"\n },\n {\n Name = \"III - The Secret Name 3\",\n URL = \"https://i.ibb.co/LQ8rdKs/Circle-Undone-3-The-Secret-Name-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"III - The Secret Name 4\",\n URL = \"https://i.ibb.co/0D7LzxV/Circle-Undone-3-The-Secret-Name-Robert-Laskey.jpg\"\n },\n {\n Name = \"IV - Wages of Sin 1\",\n URL = \"https://i.ibb.co/fDMqH1C/Circle-Undone-4-Wages-of-Sin-Emilio-Rodriguez.jpg\"\n },\n {\n Name = \"IV - Wages of Sin 2\",\n URL = \"https://i.ibb.co/HDrKkZF/Circle-Undone-4-Wages-of-Sin-Emilio-Rodriguez-2.jpg\"\n },\n {\n Name = \"IV - Wages of Sin 3\",\n URL = \"https://i.ibb.co/vkpG8cM/Circle-Undone-4-Wages-of-Sin-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"IV - Wages of Sin 4\",\n URL = \"https://i.ibb.co/CMj007q/Circle-Undone-4-Wages-of-Sin-Mateusz-Michalski.jpg\"\n },\n {\n Name = \"IV - Wages of Sin 5\",\n URL = \"https://i.ibb.co/sj1bS5x/Circle-Undone-4-Wages-of-Sin-Serge-Da-Silva-Dias.jpg\"\n },\n {\n Name = \"V - For the Greater Good 1\",\n URL = \"https://i.ibb.co/LDyqjbj/Circle-Undone-5-For-the-Greater-Good.jpg\"\n },\n {\n Name = \"V - For the Greater Good 2\",\n URL = \"https://i.ibb.co/pPzXNd1/Circle-Undone-5-For-the-Greater-Good-2.jpg\"\n },\n {\n Name = \"V - For the Greater Good 3\",\n URL = \"https://i.ibb.co/8rMLvJH/Circle-Undone-5-For-the-Greater-Good-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"V - For the Greater Good 4\",\n URL = \"https://i.ibb.co/vj1q4Cm/Circle-Undone-5-For-the-Greater-Good-Robert-Laskey.jpg\"\n },\n {\n Name = \"VI - Union and Disillusioned\",\n URL = \"https://i.ibb.co/n7SD1tB/Circle-Undone-6-Union-amp-Disillusioned-Andreas-Rocha.jpg\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 1\",\n URL = \"https://i.ibb.co/bFXBNh7/Circle-Undone-7-In-the-Clutches-of-Chaos.jpg\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 2\",\n URL = \"https://i.ibb.co/m6DshNg/Circle-Undone-7-In-the-Clutches-of-Chaos-Alexandr-Elichev.jpg\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 3\",\n URL = \"https://i.ibb.co/k2p4yfG/Circle-Undone-7-In-the-Clutches-of-Chaos-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"VIII - Before the Black Throne 1\",\n URL = \"https://i.ibb.co/9TPwvP6/Circle-Undone-8-Before-the-Black-Throne-Aaron-Luke-Wilson.jpg\"\n },\n {\n Name = \"VIII - Before the Black Throne 2\",\n URL = \"https://i.ibb.co/VNtgH4v/Circle-Undone-8-Before-the-Black-Throne-Greg-Bobrowski.jpg\"\n }\n },\n [\"The Dream-Eaters\"] = {\n {\n Name = \"I-A - Beyond the Gates of Sleep 1\",\n URL = \"https://i.ibb.co/S6sCy7G/Dream-Eaters-1-A-Beyond-the-Gates-of-Sleep-Phoebe-Herring.jpg\"\n },\n {\n Name = \"I-A - Beyond the Gates of Sleep 2\",\n URL = \"https://i.ibb.co/kBfW9SC/Dream-Eaters-1-A-Beyond-the-Gates-of-Sleep-Regina-Kurnya.jpg\"\n },\n {\n Name = \"I-A - Beyond the Gates of Sleep 3\",\n URL = \"https://i.ibb.co/HGvnxdX/Dream-Eaters-1-A-Beyond-the-Gates-of-Sleep-Jason-Scheier.jpg\"\n },\n {\n Name = \"I-B - Waking Nightmare\",\n URL = \"https://i.ibb.co/sWsZCv8/Dream-Eaters-1-B-Waking-Nightmare-Josh-Gould-jpg.jpg\"\n },\n {\n Name = \"II-A - Search for Kadath 1\",\n URL = \"https://i.ibb.co/4SwzCD8/Dream-Eaters-2-A-Search-for-Kadath-Andrei-Khrutskii.jpg\"\n },\n {\n Name = \"II-A - Search for Kadath 2\",\n URL = \"https://i.ibb.co/WpZ4fMc/Dream-Eaters-2-A-Search-for-Kadath-Dan-Iorgulescu.jpg\"\n },\n {\n Name = \"II-A - Search for Kadath 3\",\n URL = \"https://i.ibb.co/jwsn0jf/Dream-Eaters-2-A-Search-for-Kadath-Diana-Tsareva.jpg\"\n },\n {\n Name = \"II-A - Search for Kadath 4\",\n URL = \"https://i.ibb.co/pd9vxmL/Dream-Eaters-2-A-Search-for-Kadath-Helen-Ilnytska.jpg\"\n },\n {\n Name = \"II-A - Search for Kadath 5\",\n URL = \"https://i.ibb.co/MZ7Qtcc/Dream-Eaters-2-A-Search-for-Kadath-Nele-Diel.jpg\"\n },\n {\n Name = \"II-B - Thousand Shapes of Horror 1\",\n URL = \"https://i.ibb.co/9s7M0PP/Dream-Eaters-2-B-Thousand-Shapes-of-Horror-Nele-Diel-2.jpg\"\n },\n {\n Name = \"II-B - Thousand Shapes of Horror 2\",\n URL = \"https://i.ibb.co/T4Pqx0H/Dream-Eaters-2-B-Thousand-Shapes-of-Horror-Nele-Diel.jpg\"\n },\n {\n Name = \"II-B - Thousand Shapes of Horror 3\",\n URL = \"https://i.ibb.co/VJFQVYd/Dream-Eaters-2-B-Thousand-Shapes-of-Horror-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"III-A - Dark Side of the Moon 1\",\n URL = \"https://i.ibb.co/B2DfXLZ/Dream-Eaters-3-A-Dark-Side-of-the-Moon-Dabanli.jpg\"\n },\n {\n Name = \"III-A - Dark Side of the Moon 2\",\n URL = \"https://i.ibb.co/c27JRvv/Dream-Eaters-3-A-Dark-Side-of-the-Moon-Frej-Agelii.jpg\"\n },\n {\n Name = \"III-B - Point of No Return 1\",\n URL = \"https://i.ibb.co/dMGNB9Y/Dream-Eaters-3-B-Point-of-No-Return-Daria-Khlebnikova.jpg\"\n },\n {\n Name = \"III-B - Point of No Return 2\",\n URL = \"https://i.ibb.co/dpXxPmz/Dream-Eaters-3-B-Point-of-No-Return-Karine-Villette.jpg\"\n },\n {\n Name = \"IV-A - Where the Gods Dwell\",\n URL = \"https://i.ibb.co/v4nqw6G/Dream-Eaters-4-A-Where-the-Gods-Dwell-Samantha-Franco.jpg\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 1\",\n URL = \"https://i.ibb.co/7btNBS1/Dream-Eaters-4-B-Weaver-of-the-Cosmos-Diana-Franco.jpg\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 2\",\n URL = \"https://i.ibb.co/RY7y22b/Dream-Eaters-4-B-Weaver-of-the-Cosmos-Leanna-Crossan.jpg\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 3\",\n URL = \"https://i.ibb.co/f8LBbFW/Dream-Eaters-4-B-Weaver-of-the-Cosmos-Nele-Diel.jpg\"\n }\n },\n [\"The Innsmouth Conspiracy\"] = {\n {\n Name = \"I - Pit of Despair 1\",\n URL = \"https://i.ibb.co/2sc0F61/Innsmouth-1-Pit-of-Despair-Amanda-Castrillo.jpg\"\n },\n {\n Name = \"I - Pit of Despair 2\",\n URL = \"https://i.ibb.co/Nj9JLBQ/Innsmouth-1-Pit-of-Despair-J-Mill.jpg\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 1\",\n URL = \"https://i.ibb.co/2j74cVn/Innsmouth-2-Vanishing-of-Elina-Harper-Konstantin-Vohwinkel.jpg\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 2\",\n URL = \"https://i.ibb.co/r2VqHSn/Innsmouth-2-Vanishing-of-Elina-Harper-Mihail-Bila.jpg\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 3\",\n URL = \"https://i.ibb.co/hFQMm7N/Innsmouth-2-Vanishing-of-Elina-Harper-Richard-Wright.jpg\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 4\",\n URL = \"https://i.ibb.co/2nZKGN6/Innsmouth-2-Vanishing-of-Elina-Harper-Tomasz-Jedruszek-1.jpg\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 5\",\n URL = \"https://i.ibb.co/WxLpKrM/Innsmouth-2-Vanishing-of-Elina-Harper-Tomasz-Jedruszek-2.jpg\"\n },\n {\n Name = \"III - In Too Deep 1\",\n URL = \"https://i.ibb.co/SsQ3my4/Innsmouth-3-In-Too-Deep-David-Frasheski.jpg\"\n },\n {\n Name = \"III - In Too Deep 2\",\n URL = \"https://i.ibb.co/jgQ8zQN/Innsmouth-3-In-Too-Deep-Klaudia-Bezak.jpg\"\n },\n {\n Name = \"III - In Too Deep 3\",\n URL = \"https://i.ibb.co/VVgtNM1/Innsmouth-3-In-Too-Deep-Patrik-Antonescu.jpg\"\n },\n {\n Name = \"IV - Devil Reef 1\",\n URL = \"https://i.ibb.co/Jrf6CJ0/Innsmouth-4-Devil-Reef-Ludovic-Sanson.jpg\"\n },\n {\n Name = \"IV - Devil Reef 2\",\n URL = \"https://i.ibb.co/4jfwDZR/Innsmouth-4-Devil-Reef-Marc-Stewart.jpg\"\n },\n {\n Name = \"V - Horror in High Gear 1\",\n URL = \"https://i.ibb.co/vqYJjYJ/Innsmouth-5-Horror-in-High-Gear-Greg-Bobrowski.jpg\"\n },\n {\n Name = \"V - Horror in High Gear 2\",\n URL = \"https://i.ibb.co/yYrzbYS/Innsmouth-5-Horror-in-High-Gear-Greg-Bobrowski-2.jpg\"\n },\n {\n Name = \"V - Horror in High Gear 3\",\n URL = \"https://i.ibb.co/fpKWhGY/Innsmouth-5-Horror-in-High-Gear-Guillem-H-Pongiluppi.jpg\"\n },\n {\n Name = \"V - Horror in High Gear 4\",\n URL = \"https://i.ibb.co/YkLFy7y/Innsmouth-5-Horror-in-High-Gear-Rostyslav-Zagornov.jpg\"\n },\n {\n Name = \"VI - Light in the Fog 1\",\n URL = \"https://i.ibb.co/v1rhgqJ/Innsmouth-6-Light-in-the-Fog-Florian-Aupetit.jpg\"\n },\n {\n Name = \"VI - Light in the Fog 2\",\n URL = \"https://i.ibb.co/Db2pRd6/Innsmouth-6-Light-in-the-Fog-JB-Caillet.jpg\"\n },\n {\n Name = \"VII - Lair of Dagon 1\",\n URL = \"https://i.ibb.co/QPwzQL5/Innsmouth-7-Lair-of-Dagon-Daria-Khlebnikova.jpg\"\n },\n {\n Name = \"VII - Lair of Dagon 2\",\n URL = \"https://i.ibb.co/MZBpCbs/Innsmouth-7-Lair-of-Dagon-Guillem-H-Pongiluppi.jpg\"\n },\n {\n Name = \"VIII - Into the Maelstrom 1\",\n URL = \"https://i.ibb.co/fkSXDgs/Innsmouth-8-Into-the-Maelstrom-Dimitri-Bielak.jpg\"\n },\n {\n Name = \"VIII - Into the Maelstrom 2\",\n URL = \"https://i.ibb.co/k56Dn9q/Innsmouth-8-Into-the-Maelstrom-Mateusz-Michalski.jpg\"\n }\n },\n [\"Edge of the Earth\"] = {\n {\n Name = \"I - Ice and Death 1\",\n URL = \"https://i.ibb.co/FWZMWtW/Edge-1-Ice-and-Death-David-Frasheski.png\"\n },\n {\n Name = \"I - Ice and Death 2\",\n URL = \"https://i.ibb.co/QDGV0jQ/Edge-1-Ice-and-Death-Felix-Riano.png\"\n },\n {\n Name = \"I - Ice and Death 3\",\n URL = \"https://i.ibb.co/hFJQM8v/Edge-1-Ice-and-Death-Mike-Gizienski.png\"\n },\n {\n Name = \"??? - Fatal Mirage\",\n URL = \"https://i.ibb.co/KzwvjJN/Edge-2-Fatal-Mirage-David-Frasheski.png\"\n },\n {\n Name = \"II - Forbidden Peaks 1\",\n URL = \"https://i.ibb.co/C2SLByt/Edge-2-Forbidden-Peaks-David-Frasheski-2.png\"\n },\n {\n Name = \"II - Forbidden Peaks 2\",\n URL = \"https://i.ibb.co/0cGkkBL/Edge-3-Forbidden-Peaks-David-Frasheski.png\"\n },\n {\n Name = \"III - City of Elder Things 1\",\n URL = \"https://i.ibb.co/FbpgBD3/Edge-4-City-Francois-Baranger.png\"\n },\n {\n Name = \"III - City of Elder Things 2\",\n URL = \"https://i.ibb.co/ncRvHr3/Edge-4-City-Francois-Baranger-2.png\"\n },\n {\n Name = \"IV - Heart of Madness 1\",\n URL = \"https://i.ibb.co/rk0qR4z/Edge-5-Heart-of-Madness-Karol-Sollich.png\"\n },\n {\n Name = \"IV - Heart of Madness 2\",\n URL = \"https://i.ibb.co/NVFjx6N/Edge-5-Heart-of-Madness-Miguel-Coimbra.png\"\n }\n },\n [\"The Scarlet Keys\"] = {\n {\n Name = \"5-A Riddles and Rain\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358580/E9E5FE4028C08B3D4883406821221B73C8B5B2C7/\"\n },\n {\n Name = \"11-B Dead Heat\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566443853/CAD7771D90141EA6D5FFAFE1EC5E7AD9647C82DB/\"\n },\n {\n Name = \"16-D Sanguine Shadows\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358704/4A7261EB31511467CBC46E876476DD205F528A4B/\"\n },\n {\n Name = \"21-F Dealings in the Dark\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358816/7C9FE4C34CD0A7AE87EF054742D878F310C71AA7/\"\n },\n {\n Name = \"28-I Dancing Mad\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792056955518/EAB857DD5629EC6A3078FB0A3A703B85B5F514B9/\"\n },\n {\n Name = \"23-K On Thin Ice\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444026/EB5628E254AE25DA89A9C999EAAD995ECF67068E/\"\n },\n {\n Name = \"38-N Dogs of War\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444199/194FD9A713907197471A55411AE300B62C5F5278/\"\n },\n {\n Name = \"46-Q Shades of Suffering\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444330/3ED2CCE95DE933546E1B5CBBF445D773E6D65465/\"\n },\n {\n Name = \"56-Y ???\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444450/FE4C335B0F72E83900A4EED0FD1A1D304D70D6B7/\"\n },\n {\n Name = \"59-Z Congress of Keys I\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444576/5BB32469ED412D59BB0A46E57D226500B1D0568B/\"\n },\n {\n Name = \"59-Z Congress of Keys II\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444690/B01A1FEAB57473D9B6DF11B92D62C214AA1C2C02/\"\n }\n }\n },\n [\"Official Scenarios\"] = {\n [\"The Blob That Ate Everything\"] = {\n {\n Name = \"The Blob That Ate Everything 1\",\n URL = \"https://i.ibb.co/JxFV4ZN/Blob-That-Ate-Everything-Emilio-Rodriguez.jpg\"\n },\n {\n Name = \"The Blob That Ate Everything 2\",\n URL = \"https://i.ibb.co/qJzstWF/Blob-That-Ate-Everything-Emilio-Rodriguez.jpg\"\n }\n },\n [\"Carnevale of Horrors\"] = {\n {\n Name = \"Carnevale of Horrors 1\",\n URL = \"https://i.ibb.co/ZchJBpz/Carnevale-of-Horrors.jpg\"\n },\n },\n [\"Curse of the Rougarou\"] = {\n {\n Name = \"Curse of the Rougarou 1\",\n URL = \"https://i.ibb.co/Qf7Sr7P/Curse-of-the-Rougarou.jpg\"\n },\n {\n Name = \"Curse of the Rougarou 2\",\n URL = \"https://i.ibb.co/hs1Qjp0/Curse-of-the-Rougarou-Ann-Kovaleva.jpg\"\n },\n {\n Name = \"Curse of the Rougarou 3\",\n URL = \"https://i.ibb.co/BK7rmJ9/Curse-of-the-Rougarou-Karine-Villette.jpg\"\n },\n {\n Name = \"Curse of the Rougarou 4\",\n URL = \"https://i.ibb.co/ZxGTC1w/Curse-of-the-Rougarou-Lachlan-Page.jpg\"\n },\n {\n Name = \"Curse of the Rougarou 5\",\n URL = \"https://i.ibb.co/HgNXJhW/Curse-of-the-Rougarou-Vladimir-Manyukhin.jpg\"\n }\n },\n [\"Guardians of the Abyss\"] = {\n {\n Name = \"Guardians of the Abyss 1\",\n URL = \"https://i.ibb.co/gD3R6cw/Guardians-of-the-Abyss-Jake-Murray.jpg\"\n },\n {\n Name = \"Guardians of the Abyss 2\",\n URL = \"https://i.ibb.co/jMHPcvz/Guardians-of-the-Abyss-Jose-Vega.jpg\"\n },\n {\n Name = \"Guardians of the Abyss 3\",\n URL = \"https://i.ibb.co/99pqXQP/Guardians-of-the-Abyss-Koke-Nunez.jpg\"\n },\n {\n Name = \"Guardians of the Abyss 4\",\n URL = \"https://i.ibb.co/QbMvjbx/Guardians-of-the-Abyss-Mike-Szabados.jpg\"\n },\n {\n Name = \"Guardians of the Abyss 5\",\n URL = \"https://i.ibb.co/zFDt9Q8/Guardians-of-the-Abyss-Nele-Diel.jpg\"\n },\n {\n Name = \"Guardians of the Abyss 6\",\n URL = \"https://i.ibb.co/Vpzptmt/Guardians-of-the-Abyss-Yujin-Choo.jpg\"\n }\n },\n [\"Labyrinths of Lunacy\"] = {\n {\n Name = \"Labyrinths of Lunacy 1\",\n URL = \"https://i.ibb.co/f17PMCC/Labyrinths-of-Lunacy-Cordelia-Wolf.jpg\"\n },\n {\n Name = \"Labyrinths of Lunacy 2\",\n URL = \"https://i.ibb.co/44DXfWw/Labyrinths-of-Lunacy-Richard-Wright.jpg\"\n },\n {\n Name = \"Labyrinths of Lunacy 3\",\n URL = \"https://i.ibb.co/jMQhs68/Labyrinths-of-Lunacy-Robert-Berg.jpg\"\n }\n },\n [\"Murder at Excelsior Hotel\"] = {\n {\n Name = \"Murder at Excelsior Hotel 1\",\n URL = \"https://i.ibb.co/5cQ6LvN/Murder-at-Excelsior-Hotel-Alistair-Mitchell.jpg\"\n },\n {\n Name = \"Murder at Excelsior Hotel 2\",\n URL = \"https://i.ibb.co/vBQRHNS/Murder-at-Excelsior-Hotel-Romain-Bayle.jpg\"\n }\n },\n [\"War of the Outer Gods\"] = {\n {\n Name = \"War of the Outer Gods\",\n URL = \"https://i.ibb.co/wLNGFTG/War-of-the-Outer-Gods-Joshua-Cairos.jpg\"\n }\n }\n },\n [\"Fan-Made Campaigns\"] = {\n [\"Cyclopean Foundations\"] = {\n {\n Name = \"I - Lost Moorings 1\",\n URL = \"https://i.ibb.co/DQ76z3c/Cyclopean-1-Lost-Moorings-Care-Line-Art.png\"\n },\n {\n Name = \"I - Lost Moorings 2\",\n URL = \"https://i.ibb.co/c6LJNfr/Cyclopean-1-Lost-Moorings-Jake-Murray.png\"\n },\n {\n Name = \"II - Going Twice\",\n URL = \"https://i.ibb.co/P6h3vbm/Cyclopean-2-Going-Twice-Quentin-Bouilloud.png\"\n },\n {\n Name = \"III - Private Lives\",\n URL = \"https://i.ibb.co/9qK9Fzd/Cyclopean-3-Private-Lives-Christian-Bravery.png\"\n },\n {\n Name = \"IV - Crumbling Masonry 1\",\n URL = \"https://i.ibb.co/pdrGK6p/Cyclopean-4-Crumbling-Masonry-Pete-Amachree.png\"\n },\n {\n Name = \"IV - Crumbling Masonry 2\",\n URL = \"https://i.ibb.co/5RFcGyP/Cyclopean-4-Crumbling-Masonry-Simon-Craghead.png\"\n },\n {\n Name = \"V - Across Dreadful Waters\",\n URL = \"https://i.ibb.co/3mYfFNB/Cyclopean-5-Across-Dreadful-Waters-Ev-Shipard.png\"\n },\n {\n Name = \"VI - Blood From Stones\",\n URL = \"https://i.ibb.co/ynmQNSB/Cyclopean-6-Blood-From-Stones-Marc-Simonetti.png\"\n },\n {\n Name = \"VII - Pyroclastic Flow 1\",\n URL = \"https://i.ibb.co/s1JDkFv/Cyclopean-7-Pyroclastic-Flow-Bastien-Grivet.png\"\n },\n {\n Name = \"VII - Pyroclastic Flow 2\",\n URL = \"https://i.ibb.co/qs8Sk2N/Cyclopean-7-Pyroclastic-Flow-Rachid-Lotf.png\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 1\",\n URL = \"https://i.ibb.co/0MwX460/Cyclopean-8-Tomb-of-Dead-Dreams-Guillem-H-Pongiluppi.png\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 2\",\n URL = \"https://i.ibb.co/mGnKNcy/Cyclopean-8-Tomb-of-Dead-Dreams-Richard-Benning.png\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 3\",\n URL = \"https://i.ibb.co/vmBM8x2/Cyclopean-8-Tomb-of-Dead-Dreams-Walter-Brocca.png\"\n }\n },\n [\"Dark Matter\"] = {\n {\n Name = \"I - Tatterdemalion 1\",\n URL = \"https://i.ibb.co/DRMPGVt/Dark-Matter-1-Tatterdemalion-Andrey-Vozny.jpg\"\n },\n {\n Name = \"I - Tatterdemalion 2\",\n URL = \"https://i.ibb.co/1JzrrX2/Dark-Matter-1-Tatterdemalion-Brian-Taylor.jpg\"\n },\n {\n Name = \"I - Tatterdemalion 3\",\n URL = \"https://i.ibb.co/DzvvgGf/Dark-Matter-1-Tatterdemalion-John-Wallin-Liberto.jpg\"\n },\n {\n Name = \"I - Tatterdemalion 4\",\n URL = \"https://i.ibb.co/sQf85b8/Dark-Matter-1-Tatterdemalion-Paul-Pepera.jpg\"\n },\n {\n Name = \"II - Electric Nightmares 1\",\n URL = \"https://i.ibb.co/hLGVBt7/Dark-Matter-2-Electric-Nightmares-Dean-Lawrence.jpg\"\n },\n {\n Name = \"II - Electric Nightmares 2\",\n URL = \"https://i.ibb.co/cTKZQ61/Dark-Matter-2-Electric-Nightmares-Robert-Thoma.jpg\"\n },\n {\n Name = \"IIIa - Lost Quantum\",\n URL = \"https://i.ibb.co/6vyXv90/Dark-Matter-3-Lost-Quantum-Michael-Rajecki.jpg\"\n },\n {\n Name = \"IIIb - In the Shadow of Earth 1\",\n URL = \"https://i.ibb.co/DfbTKHP/Dark-Matter-4-In-the-Shadow-of-Earth-Jihoo-Kim.jpg\"\n },\n {\n Name = \"IIIb - In the Shadow of Earth 2\",\n URL = \"https://i.ibb.co/MCvPmCb/Dark-Matter-4-In-the-Shadow-of-Earth-N5-Luckybuuncle.jpg\"\n },\n {\n Name = \"IIIc - Strange Moons\",\n URL = \"https://i.ibb.co/b2d8qvg/Dark-Matter-5-Strange-Moons-Hongyu-Yin.jpg\"\n },\n {\n Name = \"V - Fragment of Carcosa 1\",\n URL = \"https://i.ibb.co/7WnTyYT/Dark-Matter-7-Fragment-of-Carcosa-Colin-Moore.jpg\"\n },\n {\n Name = \"V - Fragment of Carcosa 2\",\n URL = \"https://i.ibb.co/mG2Brrd/Dark-Matter-7-Fragments-of-Carcosa-Matthieu-Rebuffat.jpg\"\n },\n {\n Name = \"VI - Starfall 1\",\n URL = \"https://i.ibb.co/CJ3LKL7/Dark-Matter-8-Starfall-Vadim-Sadovski.jpg\"\n },\n {\n Name = \"VI - Starfall 2\",\n URL = \"https://i.ibb.co/Njd1FcB/Dark-Matter-8-Starfall-Vadim-Sadovski-2.jpg\"\n },\n {\n Name = \"VI - Starfall 3\",\n URL = \"https://i.ibb.co/W0Cx7bb/Dark-Matter-8-Starfall-Vadim-Sadovski-3.jpg\"\n }\n },\n [\"The Ghosts of Onigawa\"] = {\n {\n Name = \"I - The Ghosts of Onigawa\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-01.png?raw=true\"\n },\n {\n Name = \"II - In The Shadow Of Mount Kokoro\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-02.png?raw=true\"\n },\n {\n Name = \"III - The Onigawa River\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-03.png?raw=true\"\n },\n {\n Name = \"IV - The Crimson Butterfly\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-04.png?raw=true\"\n },\n {\n Name = \"V - The Koi Conspiracy\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-05.png?raw=true\"\n }\n }\n },\n [\"Fan-Made Scenarios\"] = {\n [\"Side Scenarios (FM)\"] = {\n {\n Name = \"Consternation on the Constellation\",\n URL = \"https://i.ibb.co/Tw2xBP1/Consternation-Constellation.jpg\"\n },\n {\n Name = \"Symphony of Erich Zann\",\n URL = \"https://i.ibb.co/SNr8tqN/Symphony-of-Erich-Zann-Hazel-Yingling.jpg\"\n }\n }\n },\n [\"Other Images\"] = {\n [\"Arkham Locations\"] = {\n {\n Name = \"Downtown 1\",\n URL = \"https://i.ibb.co/FzRk98n/Arkham-Downtown-Cristi-Balanescu.jpg\"\n },\n {\n Name = \"Downtown 2\",\n URL = \"https://i.ibb.co/W2yJ5QZ/Arkham-Downtown-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Eastside 1\",\n URL = \"https://i.ibb.co/W3QvdZW/Arkham-Eastside-Cristi-Balanescu.jpg\"\n },\n {\n Name = \"Eastside 2\",\n URL = \"https://i.ibb.co/xfn1Fp8/Arkham-Eastside-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"French Hill\",\n URL = \"https://i.ibb.co/N7Lk7jc/Arkham-French-Hill-Cristi-Balanescu.jpg\"\n },\n {\n Name = \"Merchant District\",\n URL = \"https://i.ibb.co/HTNCCq4/Arkham-Merchant-District-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Generic 1\",\n URL = \"https://i.ibb.co/hswfZD6/Arkham-Guillem-H-Pongiluppi.jpg\"\n },\n {\n Name = \"Generic 2\",\n URL = \"https://i.ibb.co/5h5cMyF/Arkham-Guillem-H-Pongiluppi-2.jpg\"\n },\n {\n Name = \"Generic 3\",\n URL = \"https://i.ibb.co/ZBdVsWt/Arkham-Guillem-H-Pongiluppi-3.jpg\"\n },\n {\n Name = \"Generic 4\",\n URL = \"https://i.ibb.co/6NwbM59/Arkham-Michele-Botticelli.jpg\"\n },\n {\n Name = \"Generic 5\",\n URL = \"https://i.ibb.co/N6sxyq5/Arkham-Mihail-Bila.jpg\"\n },\n {\n Name = \"Generic 6\",\n URL = \"https://i.ibb.co/B393zxv/Arkham-Tomasz-Jedruszek.jpg\"\n },\n {\n Name = \"Generic 7\",\n URL = \"https://i.ibb.co/2WQ2Vt6/Arkham-Tomasz-Jedruszek-2.jpg\"\n },\n {\n Name = \"Generic 8\",\n URL = \"https://i.ibb.co/R7pQ9Y7/Arkham-Tomasz-Jedruszek-3.jpg\"\n },\n {\n Name = \"Miskatonic University\",\n URL = \"https://i.ibb.co/ncz9xjP/Arkham-Miskatonic-University-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Northside\",\n URL = \"https://i.ibb.co/sVWx1R3/Arkham-Northside-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Rivertown\",\n URL = \"https://i.ibb.co/RyJnHmz/Arkham-Rivertown-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Southside\",\n URL = \"https://i.ibb.co/5GW5jg5/Arkham-Southside-Jokubas-Uogintas.jpg\"\n },\n {\n Name = \"Uptown\",\n URL = \"https://i.ibb.co/YXjvkMn/Arkham-Uptown-Jokubas-Uogintas.jpg\"\n }\n },\n [\"Default Image\"] = {\n {\n Name = \"Default Image\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/\"\n }\n },\n [\"Unsorted\"] = {\n {\n Name = \"Kingsport\",\n URL = \"https://i.ibb.co/rbkk7ys/Kingsport-Tomasz-Jedruszek.jpg\"\n },\n {\n Name = \"Devil\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2115062479282248687/DD84A3CB3C4A475A5D093CB413A16A5CEA5FBF79/\"\n },\n {\n Name = \"Mystic Board\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2115062479282248488/EC27B1215F558A39954C27477D8B4F916CA211E5/\"\n }\n }\n }\n}\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayAreaSelector\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayAreaSelector\")\nend)\n__bundle_register(\"core/PlayAreaSelector\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PlayAreaImageData\") -- this fills the variable \"PLAYAREA_IMAGE_DATA\"\nlocal optionPanelApi = require(\"core/OptionPanelApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal typeIndex, selectionIndex, plainNameCache\n\nfunction onSave() return JSON.encode({ typeIndex = typeIndex, selectionIndex = selectionIndex }) end\n\nfunction onLoad(savedData)\n self.createButton({\n function_owner = self,\n click_function = \"onClick_toggleGallery\",\n tooltip = \"Show Image Gallery\",\n position = {0, 0.06, 0},\n height = 1500,\n width = 1500,\n color = { 1, 1, 1, 0 }\n })\n\n local loadedData = JSON.decode(savedData) or {}\n typeIndex = loadedData.typeIndex or 1\n selectionIndex = loadedData.selectionIndex or 1\n Wait.time(updatePlayAreaGallery, 0.5)\n math.randomseed(os.time())\nend\n\n-- click function for main button\nfunction onClick_toggleGallery()\n Global.call(\"togglePlayAreaGallery\")\nend\n\nfunction onClick_defaultImage()\n playAreaApi.updateSurface()\n Global.call(\"togglePlayAreaGallery\")\nend\n\nfunction getDataSubTableByIndex(dataTable, index)\n local loopId = 1\n for i, v in pairs(dataTable) do\n if index == loopId then return v end\n loopId = loopId + 1\n end\n return {}\nend\n\nfunction updatePlayAreaGallery()\n -- get subtables\n local dataForType = getDataSubTableByIndex(PLAYAREA_IMAGE_DATA, typeIndex)\n local dataForSelection = getDataSubTableByIndex(dataForType, selectionIndex)\n\n -- get global xml to insert elements\n local globalXml = UI.getXmlTable()\n\n -- selectable items\n local itemSelection = getXmlTableElementById(globalXml, 'itemSelection')\n itemSelection.children = {}\n\n local i = 0\n for itemName, _ in pairs(dataForType) do\n i = i + 1\n table.insert(itemSelection.children,\n {\n tag = \"Panel\",\n attributes = { class = \"itemPanel\", id = \"typePanel\" .. i },\n children = {\n tag = \"Text\",\n value = itemName,\n attributes = { class = \"itemText\", id = \"typeListText\" .. i }\n }\n })\n end\n\n -- selectable images for that item\n local playareaList = getXmlTableElementById(globalXml, 'playareaList')\n playareaList.children = {}\n\n for i, v in ipairs(dataForSelection) do\n table.insert(playareaList.children,\n {\n tag = \"VerticalLayout\",\n attributes = { class = \"imageBox\", id = \"image\" .. i },\n children = {\n {\n tag = 'Image',\n attributes = { class = \"playareaImage\", image = v.URL }\n },\n {\n tag = 'Text',\n value = v.Name,\n attributes = { class = \"imageName\" }\n }\n }\n })\n end\n\n playareaList.attributes.height = round(#playareaList.children / 2, 0) * 380\n UI.setXmlTable(globalXml)\n Wait.time(highlightTabAndItem, 0.1)\nend\n\nfunction onClick_imageTab(_, _, tabId)\n typeIndex = tonumber(tabId:sub(9))\n selectionIndex = 1\n updatePlayAreaGallery()\nend\n\nfunction onClick_listItem(_, _, listId)\n selectionIndex = tonumber(listId:sub(10))\n updatePlayAreaGallery()\nend\n\nfunction onClick_image(_, _, id)\n local imageIndex = tonumber(id:sub(6))\n local dataForType = getDataSubTableByIndex(PLAYAREA_IMAGE_DATA, typeIndex)\n local dataForSelection = getDataSubTableByIndex(dataForType, selectionIndex)\n local newURL = dataForSelection[imageIndex].URL\n playAreaApi.updateSurface(newURL)\n Global.call(\"togglePlayAreaGallery\")\nend\n\nfunction highlightTabAndItem()\n -- highlight active tab\n for i = 1, 5 do\n local color = \"#888888\"\n if i == typeIndex then color = \"#ffffff\" end\n UI.setAttribute(\"imageTab\" .. i, \"color\", color)\n end\n\n -- highlight item\n UI.setAttribute(\"typePanel\" .. selectionIndex, \"color\", \"grey\")\n UI.setAttribute(\"typeListText\" .. selectionIndex, \"color\", \"black\")\nend\n\n-- loops through an XML table and returns the specified object\n---@param ui Table XmlTable (get this via getXmlTable)\n---@param id String Id of the object to return\nfunction getXmlTableElementById(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = getXmlTableElementById(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n-- utility function\nfunction round(num, numDecimalPlaces)\n local mult = 10 ^ (numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\nfunction maybeUpdatePlayAreaImage(scenarioName)\n -- check if option is enabled\n local optionPanelState = optionPanelApi.getOptions()\n if not optionPanelState[\"changePlayAreaImage\"] then return end\n\n -- initialize cache if nil\n if not plainNameCache then\n plainNameCache = {}\n for i, dataForType in pairs(PLAYAREA_IMAGE_DATA) do\n for j, dataForCycle in pairs(dataForType) do\n for k, data in ipairs(dataForCycle) do\n local plainName = getPlainName(data.Name)\n \n -- override plainName for all images in the \"Other Images\" category (except the default image)\n if i == \"Other Images\" and data.Name ~= \"Default Image\" then\n plainName = \"Generic\"\n end\n\n if not plainNameCache[plainName] then\n plainNameCache[plainName] = {}\n end\n table.insert(plainNameCache[plainName], data.URL)\n end\n end\n end\n end\n\n -- look for matching playarea image or use generic ones instead\n local listOfEligibleImages = {}\n if plainNameCache[scenarioName] then\n listOfEligibleImages = plainNameCache[scenarioName]\n else\n listOfEligibleImages = plainNameCache[\"Generic\"]\n end\n\n -- get a random entry from the eligible list\n local newImageIndex = math.random(#listOfEligibleImages)\n playAreaApi.updateSurface(listOfEligibleImages[newImageIndex])\nend\n\n-- attempts to extract the plain scenario name from the playarea image name\nfunction getPlainName(str)\n -- remove prefix type 1\n str = str:gsub(\"%w+%-%w%s%-%s\", \"\") -- matches \"II-B - Thousand Shapes of Horror 1\"\n \n -- remove prefix type 2\n str = str:gsub(\"%w+%-%w%s\", \"\") -- matches \"59-Z Congress of Keys 1\"\n\n -- remove prefix type 3\n str = str:gsub(\"%w+%s%-%s\", \"\") -- matches \"III - The Secret Name 4\"\n\n -- remove prefix type 4\n str = str:gsub(\"%?+%s%-%s\", \"\") -- matches \"??? - Fatal Mirage\"\n\n -- remove suffix (numbering)\n str = str:gsub(\"%s%d+\", \"\")\n\n return str\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/PlayAreaImageData\", function(require, _LOADED, __bundle_register, __bundle_modules)\nPLAYAREA_IMAGE_DATA = {\n [\"Official Campaigns\"] = {\n [\"Night of the Zealot\"] = {\n {\n Name = \"I - The Gathering 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725443007/D34B55D2637EF1DF22839D12F9CF74F92F8EB486/\"\n },\n {\n Name = \"III - The Devourer Below 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725443203/FBE04C8B89F79D18C6D29C28DC3B292A5A3A3DEB/\"\n },\n {\n Name = \"III - The Devourer Below 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725443345/FD10BC04B3F3AFD710C3C12EE14F85F9AFB265E6/\"\n }\n },\n [\"The Dunwich Legacy\"] = {\n {\n Name = \"I-A - Extracurricular Activity 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725401398/AC55F0754B7E4A39796A6F2236012AE03DA55E20/\"\n },\n {\n Name = \"I-A - Extracurricular Activity 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725401658/9F3ED6E256818C4528D55980B9D7E44B87170A4F/\"\n },\n {\n Name = \"I-A - Extracurricular Activity 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725401870/FE29404D9D93BE2735D41C115DDD9708A0931F3E/\"\n },\n {\n Name = \"I-B - The House Always Wins 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725402059/4C4A50D259ECFD4DFB94FABB9FA2AD3AABDCA0CA/\"\n },\n {\n Name = \"I-B - The House Always Wins 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725402263/8B0C981B78E803B3BFD64AC874F315B6810E579B/\"\n },\n {\n Name = \"I-B - The House Always Wins 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725402460/8599D17306C644D75D189591BC6D57C2F27F9E35/\"\n },\n {\n Name = \"I-B - The House Always Wins 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725402641/777865B25BCF86C2EFEAE232AFBC31561D12AE0F/\"\n },\n {\n Name = \"II - The Miskatonic Museum 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725402804/A44E68AC08E6568A757429B29E71C703B76FA159/\"\n },\n {\n Name = \"II - The Miskatonic Museum 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403000/B28D46D5B7BCE9EA9BF27D3A0A932393D8258A76/\"\n },\n {\n Name = \"III - The Essex County Express\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403150/956BE4B5C25805E57C8FC5CF28A94BD7EF07CA54/\"\n },\n {\n Name = \"IV - Blood on the Altar 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403290/07DD1508BA880AD1212A820BC29471C48DC90C53/\"\n },\n {\n Name = \"IV - Blood on the Altar 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403456/A74398E8CCD78657C2555832A3B340723E8C9117/\"\n },\n {\n Name = \"IV - Blood on the Altar 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403636/CD89D7D9CC020F41D5AD02D54E308877583EC45F/\"\n },\n {\n Name = \"IV - Blood on the Altar 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403818/AEFAC50DAC82271BCACC53B8FF69B5B094FA1078/\"\n },\n {\n Name = \"V - Undimensioned and Unseen 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725403955/E7C566E536CF6E910DB654FC1DBF4838F2BAF899/\"\n },\n {\n Name = \"V - Undimensioned and Unseen 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404127/F92F123BBD3D857C579B9284988C3AFFBCD84B2B/\"\n },\n {\n Name = \"V - Undimensioned and Unseen 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404273/7F8CFE6785BD74BB8D5E34C204AFB8AA580CA3E3/\"\n },\n {\n Name = \"V - Undimensioned and Unseen 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404424/C2AE08371CF2DE2777791BBD4AEF446E50532382/\"\n },\n {\n Name = \"VI - Where Doom Awaits 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404578/A520CE0F6B0C8591A48ADEF34E68B46AFC2BC83B/\"\n },\n {\n Name = \"VI - Where Doom Awaits 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404740/1FF9EF375BDBB73CA8F0A1562F215692AAEA7131/\"\n },\n {\n Name = \"VI - Where Doom Awaits 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725404914/5473D20CE0122F55EEADB16C4353D4EDD91E440E/\"\n },\n {\n Name = \"VI - Where Doom Awaits 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725405088/A0AA8CB864747152763D434D0737D81EB515E71B/\"\n },\n {\n Name = \"VI - Where Doom Awaits 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725405247/FAF408DAAD4FC72142DFDFE5FCEA4B84293AA72C/\"\n },\n {\n Name = \"VII - Lost in Time and Space 1\",\n URL = \"https://i.ibb.co/rtTpbDx/Dunwich-8-Lost-in-Time-amp-Space.jpg\"\n },\n {\n Name = \"VII - Lost in Time and Space 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725405746/771BAE40F98BB16F8D011FA794E4AC0095131AF1/\"\n },\n {\n Name = \"VII - Lost in Time and Space 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725406148/D15D56EA34F27C651D7E7AC202DA4DEBE395E310/\"\n }\n },\n [\"The Path to Carcosa\"] = {\n {\n Name = \"I - Curtain Call\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725426327/41F6192EDCFFD6AAE2EE44C2BB5708B19D7464A9/\"\n },\n {\n Name = \"II - The Last King 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725426499/114EAEA245AC51CA219364AF26341E7F7E649A7D/\"\n },\n {\n Name = \"II - The Last King 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725426683/A2762E95DD79D7A7BC749925166BBFC18B62EF3B/\"\n },\n {\n Name = \"II - The Last King 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725426818/A6A20773EA95CE3D9896B22E317A0E1ACCA911F0/\"\n },\n {\n Name = \"III - Echoes of the Past\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427005/25F51DE4B1F33C16A0E68C929E5002F0C4520A37/\"\n },\n {\n Name = \"IV - The Unspeakable Oath 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427178/9575E4F6E53DDAD2D3E61684AB9757B04E1EF787/\"\n },\n {\n Name = \"IV - The Unspeakable Oath 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427342/199A6C6411992ACFB8A417E86207FE6CE956EB97/\"\n },\n {\n Name = \"IV - The Unspeakable Oath 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427501/48525BCDFA281947FA9ED26507BC1F81C07056E8/\"\n },\n {\n Name = \"V - A Phantom of Truth 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427681/F72B02FF1A5E58CBCB0E53C8455310AF37064477/\"\n },\n {\n Name = \"V - A Phantom of Truth 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725427848/215A757FF28317EB3EF7CF1F9CAE6F1CFF735091/\"\n },\n {\n Name = \"VI - The Pallid Mask 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725428067/D46BAD80B112156A2D3DEFF247A74C74F27DDA12/\"\n },\n {\n Name = \"VI - The Pallid Mask 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725428250/464681CF59770BFD493A0D672C7CB70BA8CD3499/\"\n },\n {\n Name = \"VII - Black Stars Rise 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725428431/4766E1A4893E0EF16B576749B73CE449F10DA20C/\"\n },\n {\n Name = \"VII - Black Stars Rise 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725428896/05ED3D08F29C8E6EC080F0615DE130F2A687A9AC/\"\n },\n {\n Name = \"VIII - Dim Carcosa 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725429052/BA81DBDE7A12B993CB8B7001CA93095AD0512449/\"\n },\n {\n Name = \"VIII - Dim Carcosa 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725429235/C5C939E0213575B5EDCA6723D209892071DDE4B5/\"\n }\n },\n [\"The Forgotten Age\"] = {\n {\n Name = \"I - The Untamed Wilds 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725446729/7F5E48BC9A028AE5117231364F2D5B433A62239A/\"\n },\n {\n Name = \"I - The Untamed Wilds 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725446946/55C374DC5BE3620CB0D5BCA379EA55CF471D09B3/\"\n },\n {\n Name = \"I - The Untamed Wilds 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725447172/6EAE2CFD3AC552CFB744C75E4E26A79264DE17D3/\"\n },\n {\n Name = \"I - The Untamed Wilds 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725447409/FCF48C94D90F94FBFFD674B0650E288E7312C441/\"\n },\n {\n Name = \"I - The Untamed Wilds 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725447579/F7C3FB9E31147430C1384684887FC66E616D0302/\"\n },\n {\n Name = \"II - The Doom of Eztli 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725447752/44EF68E1BF3C2D9DCD5306DD90B4CCCFBE03891C/\"\n },\n {\n Name = \"II - The Doom of Eztli 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448027/F5F14EC590C33BC87D8F0CFF43D7E4DF80D61133/\"\n },\n {\n Name = \"II - The Doom of Eztli 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448215/BFD9D940DB8EC9AC8D818C48BBAE3338A8E48A3B/\"\n },\n {\n Name = \"III - Threads of Fate\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448393/67F3BE7DC1BEC807A17D3F8914328D408856E019/\"\n },\n {\n Name = \"IV - The Boundary Beyond 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448568/3C268415A47430CEEC3F9BFB216EF57E3DBF820A/\"\n },\n {\n Name = \"IV - The Boundary Beyond 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448701/3FA23DCA30505AD4C27D8914740AD3138C01122C/\"\n },\n {\n Name = \"IV - The Boundary Beyond 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725448863/266C3320AC326C30F08FBC11A95567E1249E7FB7/\"\n },\n {\n Name = \"V - Heart of the Elders 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449019/A6CC459ACA004C33DD9605BE8382437F6BBE24F7/\"\n },\n {\n Name = \"V - Heart of the Elders 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449150/241FA88572B6B4F652D7FC6D1EDB23DF94E3199C/\"\n },\n {\n Name = \"V - Heart of the Elders 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449310/DBD731498FAB399A4155F7B64F8710BF5FBB5C1F/\"\n },\n {\n Name = \"VI - The City of Archives 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449473/527CB6470F508D4E1F1E4AFC8A0D3AB0A65E046E/\"\n },\n {\n Name = \"VI - The City of Archives 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449630/A8E933F79A646990155CC18A2143B3BC16222750/\"\n },\n {\n Name = \"VI - The City of Archives 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449814/30BB7E4F8D9F1571A420372E78ACAF2D7792811F/\"\n },\n {\n Name = \"VII - The Depths of Yoth 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725449962/D69532827DFF2D654F8A606B7917D593F52D7624/\"\n },\n {\n Name = \"VII - The Depths of Yoth 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725450085/479A8A1BDD7BE80B43AE4F2C14DFA811D7B28482/\"\n },\n {\n Name = \"VII - The Depths of Yoth 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725450258/E617F5A78DFBE913652E20BF97D38B91087FACAE/\"\n },\n {\n Name = \"VIII - Shattered Aeons 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725450415/5631152D4830C00DB8D8EB2163CE773542A62C79/\"\n },\n {\n Name = \"VIII - Shattered Aeons 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725450556/C3000D020B0C32B4DA3420AEE5E286893453FC49/\"\n }\n },\n [\"The Circle Undone\"] = {\n {\n Name = \"0 - Disappearance at the Twilight Estate\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725457506/6E228F87CEDCD3A0CFA28B680C266B4C68C7682B/\"\n },\n {\n Name = \"I - The Witching Hour\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725457706/D0FDC0E9287C343745AE6135352194D654D98B64/\"\n },\n {\n Name = \"II - At Death's Doorstep 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725457864/3106851EC93B1FC01311BD68F02145BA2FD720B0/\"\n },\n {\n Name = \"II - At Death's Doorstep 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725458037/155EB572CF28F09A64A021CAC3A3219C31B2CD49/\"\n },\n {\n Name = \"II - At Death's Doorstep 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725458187/482CC6730F267061A055D6FD402603BC642A9635/\"\n },\n {\n Name = \"III - The Secret Name 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725458373/769D67103FACFB94E77465E85DBB2A250284B59B/\"\n },\n {\n Name = \"III - The Secret Name 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725458592/D70CE9B1AD7158AF206A25777A8BA6F284587A83/\"\n },\n {\n Name = \"III - The Secret Name 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725458848/2FC0D5AFFA97AB5E80244F1ED711036B2149B0EE/\"\n },\n {\n Name = \"III - The Secret Name 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459026/A1A5B18ECB38985A35781CBDFF53935541720AF4/\"\n },\n {\n Name = \"IV - The Wages of Sin 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459182/46870E1DBE623E93E675CB2D3C1E959B40CDCC83/\"\n },\n {\n Name = \"IV - The Wages of Sin 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459344/9552699A8CEC5E7BF22843990394BB977539CBE0/\"\n },\n {\n Name = \"IV - The Wages of Sin 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459466/9B6B55A6F76668929B6D6B1DD5FDAE7CEE427A1C/\"\n },\n {\n Name = \"IV - The Wages of Sin 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459609/054A60BDCD266C1A53F29067CFC83D0561666FE4/\"\n },\n {\n Name = \"IV - Wages of Sin 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459714/11B3D734AC5229A0DEA5372CD50F5C7841F9D5A0/\"\n },\n {\n Name = \"V - For the Greater Good 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459829/9AA9563CCD72A8593BDE3C6D1299E96325ECE747/\"\n },\n {\n Name = \"V - For the Greater Good 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725459933/13A103B7BC0ABB611F6A8E61D033C6AD95EED4D4/\"\n },\n {\n Name = \"V - For the Greater Good 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460088/C88DDC5CE898ACEF360B8AD72E05F15BF84DE171/\"\n },\n {\n Name = \"V - For the Greater Good 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460182/C086EDA78636624FC9C4EA1DBCD8F1D39B7A6A89/\"\n },\n {\n Name = \"VI - Union and Disillusioned\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460382/8EFB842A623A2D1E6D0E915268A207A5D7DFC6D4/\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460586/7E156BF93F211BC425CD37ED273FCC84FF1F4C4D/\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460740/72A39A0FACA806EF2E0A4E31AEDF6D8FCDF1A876/\"\n },\n {\n Name = \"VII - In the Clutches of Chaos 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725460884/5716F6E2CB3F8D14FA5B7B806555896088696057/\"\n },\n {\n Name = \"VIII - Before the Black Throne 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725461042/DFF7A992A9440E58CE32D4B8A96A02A8F785AC90/\"\n },\n {\n Name = \"VIII - Before the Black Throne 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725461161/18902B2F74C9D70F5EA79A34521E3FDEDEFC893D/\"\n }\n },\n [\"The Dream-Eaters\"] = {\n {\n Name = \"I-A - Beyond the Gates of Sleep 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725465733/828EE1FF16928EA0426BC68AAED4B9AA6B6FBB49/\"\n },\n {\n Name = \"I-A - Beyond the Gates of Sleep 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725465934/35A85E9056B7A212AC39E7043FDF546A425E62F2/\"\n },\n {\n Name = \"I-A - Beyond the Gates of Sleep 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466105/05D29313D2559B6683465A7034DE7B07DE675420/\"\n },\n {\n Name = \"I-B - Waking Nightmare\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466267/16FAE20612ED0A6A65836DD1B014AC5A801A172F/\"\n },\n {\n Name = \"II-A - The Search for Kadath 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466425/03CCD5F24999CC6CC905CB2FD021DB67D7769163/\"\n },\n {\n Name = \"II-A - The Search for Kadath 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466615/085ACE95FEF03D2BE91BAD5E1864E1D0263DCCC0/\"\n },\n {\n Name = \"II-A - The Search for Kadath 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466802/83861733568FCA9673B6F5EFE0C9D3337E3DFD27/\"\n },\n {\n Name = \"II-A - The Search for Kadath 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725466941/D4FDE1FE722DC6B03AD38D797F2E00531908583D/\"\n },\n {\n Name = \"II-A - The Search for Kadath 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725467396/C9A476395B9326142BBDBD06D22A14C83EAD2161/\"\n },\n {\n Name = \"II-B - A Thousand Shapes of Horror 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725467582/5EB69F3A3F20B312FE3FE3C64FEA96200EE51563/\"\n },\n {\n Name = \"II-B - A Thousand Shapes of Horror 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725467791/5FE437C821641EDD703D336205A37F8F0CACFD38/\"\n },\n {\n Name = \"II-B - A Thousand Shapes of Horror 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725467946/841CEC1D8B56C1CA52B5558E8E49CE04D95D2F4A/\"\n },\n {\n Name = \"III-A - Dark Side of the Moon 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725468100/2DD1038163AD5DAA759EA4BE49DB82A2718E931F/\"\n },\n {\n Name = \"III-A - Dark Side of the Moon 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725468293/E8145D05833864EEC70AF9AC401039D8E8AFDE3E/\"\n },\n {\n Name = \"III-B - Point of No Return 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725468506/1F2E3D425A4D97ADBCA59B4A9401C411F91F875F/\"\n },\n {\n Name = \"III-B - Point of No Return 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725468694/8631E68BA7CE69BECF1D476A03CBDC79112A60BF/\"\n },\n {\n Name = \"IV-A - Where the Gods Dwell\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725468880/2C8A9459149D33E526FDC4B68A063475305C15F8/\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725469060/9E6AF9E0D68EC0F44B82968CE99E433A25A0E0C4/\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725469224/8C969B8ABAEE6CFFEF165C2E4BBA0E7E9B33AA1A/\"\n },\n {\n Name = \"IV-B - Weaver of the Cosmos 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725469417/A94C14A64836FB9B5FAFAC5B790C51441F8D475F/\"\n }\n },\n [\"The Innsmouth Conspiracy\"] = {\n {\n Name = \"I - The Pit of Despair 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473070/57FEAA8135F62DBAD52E2AAB562EF45EB9A0194A/\"\n },\n {\n Name = \"I - The Pit of Despair 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473257/FEC6F9FAA1CC656BFD5861F58E4751BC94AB0424/\"\n },\n {\n Name = \"II - The Vanishing of Elina Harper 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473424/B0E2BFA9C7F61A5B7A72CD11AD1AFF4A070AFFA1/\"\n },\n {\n Name = \"II - The Vanishing of Elina Harper 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473570/D28C2DA099D656116A0D7BAA8B874E4ED6B6B50E/\"\n },\n {\n Name = \"II - The Vanishing of Elina Harper 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473731/EE9BED3522A1B7CD5E394A67AD7F692DB709A9B5/\"\n },\n {\n Name = \"II - The Vanishing of Elina Harper 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725473874/0A85B2CE9A3FFB048C932E1B014B2986D5D42A1B/\"\n },\n {\n Name = \"II - Vanishing of Elina Harper 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474056/C82E467216DF747AA954C614D7D0B8F649163EDA/\"\n },\n {\n Name = \"III - In Too Deep 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474234/C6A72CDEFCDF1F2A3C6036F349B5F368EFDACA2E/\"\n },\n {\n Name = \"III - In Too Deep 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474398/752D0CE313C58A5B1C3181503C841EB91D041492/\"\n },\n {\n Name = \"III - In Too Deep 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474562/308687DFB9B0F2286A9248698FD38C0BF66B89ED/\"\n },\n {\n Name = \"IV - Devil Reef 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474717/DCEC44D2F7F22A950B3CF52C81C8F931710EFADC/\"\n },\n {\n Name = \"IV - Devil Reef 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725474883/04913E71194BF766DFF2DF8646251AC461A35FE2/\"\n },\n {\n Name = \"V - Horror in High Gear 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475029/FAA34C92FA800E8DDF6449B1C48FCC7468D783BD/\"\n },\n {\n Name = \"V - Horror in High Gear 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475133/BC689B58040F74E7DB44CFD8F3F2BF32FE4081E1/\"\n },\n {\n Name = \"V - Horror in High Gear 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475307/53ADF5E957F88F1DDCE46828547E5808C3CAEFD7/\"\n },\n {\n Name = \"V - Horror in High Gear 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475402/C41EB1D2F8549669DD4323A339F5EC594996816C/\"\n },\n {\n Name = \"VI - A Light in the Fog 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475509/C526C9A3AC34195ACF6161D4821D1424A8A288B4/\"\n },\n {\n Name = \"VI - A Light in the Fog 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725475660/2C67D57967F300BD1FE1AFC08C49EBCF4A88D11C/\"\n },\n {\n Name = \"VII - The Lair of Dagon 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725476055/4BC221648012F7A7A37B2F65929705E973FF9CE3/\"\n },\n {\n Name = \"VII - The Lair of Dagon 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725476271/3F9CF0FE8ACCE12E26ACA5D5777177A10B49D6DA/\"\n },\n {\n Name = \"VIII - Into the Maelstrom 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725476474/AF8695342FBCE6F6BC7B353C86C6006F1629F43A/\"\n },\n {\n Name = \"VIII - Into the Maelstrom 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725476643/CB175401ECDF04F97334CBF8AE7EC76A43A85735/\"\n }\n },\n [\"Edge of the Earth\"] = {\n {\n Name = \"I - Ice and Death 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725482152/322E07021DC78455859C860D8B1574F1BA2E0F68/\"\n },\n {\n Name = \"I - Ice and Death 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725482327/BD14DDE856A2062A939F860743FFF15F8B0BFF5A/\"\n },\n {\n Name = \"I - Ice and Death 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725482520/0FB5AC83DF448994EC0A866ACF6AF57ADCC59C82/\"\n },\n {\n Name = \"??? - Fatal Mirage\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725481929/A35EDF11BD6AF52784BA6611C363CBBB373622EE/\"\n },\n {\n Name = \"II - Forbidden Peaks 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725482688/B50455616DFC14FE0B9398DBE2A3A1AE25040516/\"\n },\n {\n Name = \"II - Forbidden Peaks 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725482839/17786225AA56E75E558491E7E710F555AF3E5799/\"\n },\n {\n Name = \"III - City of Elder Things 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725483014/B74378E02A1A99F544CD98141EF62193A2A612FB/\"\n },\n {\n Name = \"III - City of Elder Things 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725483208/CDFF7A2D404485DE2B4C4ED54B34E197515F0094/\"\n },\n {\n Name = \"IV - The Heart of Madness 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725483349/A96BC4AA73C71FE86EF38110236BAEF710C00EE2/\"\n },\n {\n Name = \"IV - The Heart of Madness 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725483528/5BF0DD740C5D43EFBFEF0436EB35FF9DA748FA5E/\"\n }\n },\n [\"The Scarlet Keys\"] = {\n {\n Name = \"5-A Riddles and Rain\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358580/E9E5FE4028C08B3D4883406821221B73C8B5B2C7/\"\n },\n {\n Name = \"11-B Dead Heat\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566443853/CAD7771D90141EA6D5FFAFE1EC5E7AD9647C82DB/\"\n },\n {\n Name = \"16-D Sanguine Shadows\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358704/4A7261EB31511467CBC46E876476DD205F528A4B/\"\n },\n {\n Name = \"21-F Dealings in the Dark\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792057358816/7C9FE4C34CD0A7AE87EF054742D878F310C71AA7/\"\n },\n {\n Name = \"28-I Dancing Mad\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2037357792056955518/EAB857DD5629EC6A3078FB0A3A703B85B5F514B9/\"\n },\n {\n Name = \"23-K On Thin Ice\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444026/EB5628E254AE25DA89A9C999EAAD995ECF67068E/\"\n },\n {\n Name = \"38-N Dogs of War\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444199/194FD9A713907197471A55411AE300B62C5F5278/\"\n },\n {\n Name = \"46-Q Shades of Suffering\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444330/3ED2CCE95DE933546E1B5CBBF445D773E6D65465/\"\n },\n {\n Name = \"56-Y Without a Trace\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444450/FE4C335B0F72E83900A4EED0FD1A1D304D70D6B7/\"\n },\n {\n Name = \"59-Z Congress of Keys 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444576/5BB32469ED412D59BB0A46E57D226500B1D0568B/\"\n },\n {\n Name = \"59-Z Congress of Keys 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2038485431566444690/B01A1FEAB57473D9B6DF11B92D62C214AA1C2C02/\"\n }\n }\n },\n [\"Official Scenarios\"] = {\n [\"The Blob That Ate Everything\"] = {\n {\n Name = \"The Blob That Ate Everything 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725489144/53A920E2D1A9F41937B21B0A5B1A4E450ABFC460/\"\n },\n {\n Name = \"The Blob That Ate Everything 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725488396/9CC07F923BD1CBFC4BB06DD2CC6747D2C3541737/\"\n }\n },\n [\"Carnevale of Horrors\"] = {\n {\n Name = \"Carnevale of Horrors 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725496678/91164AF7C2ED06A3E50225794DE9C5E92D1D3B04/\"\n },\n },\n [\"Curse of the Rougarou\"] = {\n {\n Name = \"Curse of the Rougarou 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725494513/DF8E92EA5C1131A0C5D8FA06BFF6FD239412E11C/\"\n },\n {\n Name = \"Curse of the Rougarou 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725494706/5D2EDE5D07DDA6E5781DB70D13F9A17EF26D36F2/\"\n },\n {\n Name = \"Curse of the Rougarou 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725494855/44A751CB66CBE4D75E67A53FC392696F6A3BFD4C/\"\n },\n {\n Name = \"Curse of the Rougarou 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725495011/ADD3431B383236BCF057C1573CEF7E43F39FDE72/\"\n },\n {\n Name = \"Curse of the Rougarou 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725495146/79159992D5002AD3D7D23ED82D9BB76D437B94C3/\"\n }\n },\n [\"Guardians of the Abyss\"] = {\n {\n Name = \"Guardians of the Abyss 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725490870/9C03B2974D7776B8E2AFEEF025756D1885AF0AE3/\"\n },\n {\n Name = \"Guardians of the Abyss 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725491039/E81F05AB9C802F57F4D9F7229CE3D53231ACB70D/\"\n },\n {\n Name = \"Guardians of the Abyss 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725491202/384AA7DBA614B61C46D57EF5105A96F25F938B74/\"\n },\n {\n Name = \"Guardians of the Abyss 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725491392/1C8FF752DF97F362BA8937BFEC65140AE3ADF8A6/\"\n },\n {\n Name = \"Guardians of the Abyss 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725491512/06B1DCA10B44FF86567CEFCC135D619648CE5F19/\"\n },\n {\n Name = \"Guardians of the Abyss 6\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725491658/5446E231AEF72CF4F7B4892116671FF7175EFA0F/\"\n }\n },\n [\"Labyrinths of Lunacy\"] = {\n {\n Name = \"Labyrinths of Lunacy 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725489685/D2D342844212C8A21E030418935A227C2E3279DB/\"\n },\n {\n Name = \"Labyrinths of Lunacy 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725489820/E3E18B0940C2604F62E564AD43F178FF9F13B3C9/\"\n },\n {\n Name = \"Labyrinths of Lunacy 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725489972/6A34CF53190EAAAF57C31FB97A3C2ACBD27FEE40/\"\n }\n },\n [\"Murder at Excelsior Hotel\"] = {\n {\n Name = \"Murder at Excelsior Hotel 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725488868/7F7FE8BB3C7E3645B4377F86366C6073CDB8F113/\"\n },\n {\n Name = \"Murder at Excelsior Hotel 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725489144/53A920E2D1A9F41937B21B0A5B1A4E450ABFC460/\"\n }\n },\n [\"War of the Outer Gods\"] = {\n {\n Name = \"War of the Outer Gods\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725487627/43A19A6D97A6DA63A487EB247EE95884E2D9F5FD/\"\n }\n }\n },\n [\"Fan-Made Campaigns\"] = {\n [\"Cyclopean Foundations\"] = {\n {\n Name = \"I - Lost Moorings 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725499518/02DA17FC9D6A1174E484977269F44AE6995C6F7C/\"\n },\n {\n Name = \"I - Lost Moorings 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725499680/1556F230B59D42FCA47A5A87135330B03C231E92/\"\n },\n {\n Name = \"II - Going Twice\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725499855/1220C81273EFA6F36C2AEBA713E31DE1E2F92454/\"\n },\n {\n Name = \"III - Private Lives\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500069/452E4427185A7F1AFB3F2CBB263DC55B6A144D49/\"\n },\n {\n Name = \"IV - Crumbling Masonry 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500260/94FE8506AB13CA51F087ABF155799F73BCBAB1E9/\"\n },\n {\n Name = \"IV - Crumbling Masonry 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500508/04B6C6D8845BF5411D28C79D185EAF6FFBB409F5/\"\n },\n {\n Name = \"V - Across Dreadful Waters\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500640/447069BBBF70474439D3CC4F970F6617C8B738F4/\"\n },\n {\n Name = \"VI - Blood From Stones\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500803/23C46C5F08E3F911F565D9EC38CFACFFAA5F5B11/\"\n },\n {\n Name = \"VII - Pyroclastic Flow 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725500952/804B531E517B1AD2294E304AA6F72F8CC3E6FC4E/\"\n },\n {\n Name = \"VII - Pyroclastic Flow 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725501115/E771289EB848A695DF47C405300B1EC7CA925009/\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725501272/CAE6C4185540F3F8FFA2A8E37458A5B80DBD70FC/\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725501415/DA9C07488DA2753FF5621D1731A84D6D0B1CC1BD/\"\n },\n {\n Name = \"VIII - Tomb of Dead Dreams 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725501813/030E5DB9F8F6C5F092EFDF2C42AD631318B0923A/\"\n }\n },\n [\"Dark Matter\"] = {\n {\n Name = \"I - Tatterdemalion 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504118/AC852F478D5BDA0C8A54A499B07A66E872560EC7/\"\n },\n {\n Name = \"I - Tatterdemalion 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504319/5B24BB2080AC76D836708AABC1BC90FD884F043D/\"\n },\n {\n Name = \"I - Tatterdemalion 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504461/73E4632A2EAAFA918924E60A64B03838CA6DDD77/\"\n },\n {\n Name = \"I - Tatterdemalion 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504602/6DB8F081CC907A0D6F364E5045BB7E8FADA91B5C/\"\n },\n {\n Name = \"II - Electric Nightmares 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504770/C6FB5FDD153ACD07565259AE013FDC7FF567037D/\"\n },\n {\n Name = \"II - Electric Nightmares 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725504974/80E29EA68B88B78CDADC475998E832C7245409F4/\"\n },\n {\n Name = \"IIIa - Lost Quantum\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725505211/07E1254B1C601496E47B7E60B736D1699AAD38C8/\"\n },\n {\n Name = \"IIIb - In the Shadow of Earth 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725505419/7E8B50470AD6AD27429B58A42271755289FC90EB/\"\n },\n {\n Name = \"IIIb - In the Shadow of Earth 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725505603/DCD5B255FE66F8D8F47FB6C928D80583F3F950AC/\"\n },\n {\n Name = \"IIIc - Strange Moons\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506071/78597C2FBE2DE55BFC86AEC9F42FE1B20D26544C/\"\n },\n {\n Name = \"V - Fragment of Carcosa 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506388/A299C8D58171A6D78CF55D911C2B81C63D88444F/\"\n },\n {\n Name = \"V - Fragment of Carcosa 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506567/C36509CB6520803355E7AE1E9EC8CD35641B28C8/\"\n },\n {\n Name = \"VI - Starfall 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506714/327D0E565039B7FA9157FDA04A302DF178C64C44/\"\n },\n {\n Name = \"VI - Starfall 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506809/E637DAAD8BEB00E4305756D101E1E6B370CB1644/\"\n },\n {\n Name = \"VI - Starfall 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725506978/A17CD45A7770BAC7196218ADD2FB6CEB0E7A0E6B/\"\n }\n },\n [\"The Ghosts of Onigawa\"] = {\n {\n Name = \"I - The Ghosts of Onigawa\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-01.png?raw=true\"\n },\n {\n Name = \"II - In The Shadow Of Mount Kokoro\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-02.png?raw=true\"\n },\n {\n Name = \"III - The Onigawa River\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-03.png?raw=true\"\n },\n {\n Name = \"IV - The Crimson Butterfly\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-04.png?raw=true\"\n },\n {\n Name = \"V - The Koi Conspiracy\",\n URL = \"https://github.com/ArkhamDotCards/theghostsofonigawa/blob/main/product/onigawa-playmat-05.png?raw=true\"\n }\n }\n },\n [\"Fan-Made Scenarios\"] = {\n [\"Side Scenarios (FM)\"] = {\n {\n Name = \"Consternation on the Constellation\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725512402/37F34A14CEEA9D2F889F7B97B065C0193F268FE1/\"\n },\n {\n Name = \"Symphony of Erich Zann\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725512613/B23EA91E9489E0DDE250DD33F9AF1A12EEE52E0C/\"\n }\n }\n },\n [\"Other Images\"] = {\n [\"Arkham Locations\"] = {\n {\n Name = \"Downtown 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725516086/53F48F8AA9CFE4BF544BF03A616AC12A5344615C/\"\n },\n {\n Name = \"Downtown 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725516316/1A337F5D66D7B5F59C66F465710717340B1D56AB/\"\n },\n {\n Name = \"Eastside 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725516542/09B4BE1E5487C3B11C0178B0B6FFD51620BE6AA6/\"\n },\n {\n Name = \"Eastside 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725516744/9B7F54E99D9B85884D5E363B97B25DA2DD3F03CC/\"\n },\n {\n Name = \"French Hill\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725516949/8BFEF09FDB6608173280F887C1BA3906427678CC/\"\n },\n {\n Name = \"Generic 1\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725517086/93E00AA823FBA1C6531BBA143408E1E7D89BE3F0/\"\n },\n {\n Name = \"Generic 2\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725517270/1450BCB6698058F833FAE770D31D0D064B82F5C2/\"\n },\n {\n Name = \"Generic 3\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725517434/5B529D9DEF3550E898744CE19AAD4CC0AB3F12DF/\"\n },\n {\n Name = \"Generic 4\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725517622/FE0C331881B776E66D3A2C60D70147A0CABFDAC6/\"\n },\n {\n Name = \"Generic 5\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725517833/A123F1A2D1B8BE960AAB371D9FD06F27C282CB9B/\"\n },\n {\n Name = \"Generic 6\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725518026/10D4F06C8A1AEC3ACAEC5C3B9DA142D3BA5818FE/\"\n },\n {\n Name = \"Generic 7\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725518144/72D4A60264C2DD201AAA5FFDCA95C6FF04EF8AC8/\"\n },\n {\n Name = \"Generic 8\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725518292/A1848A68389FBECA5BC847F90A921C18133B17D6/\"\n },\n {\n Name = \"Merchant District\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725518454/BD6694DCCD12E31997202B2020B4A29FDC96FC7B/\"\n },\n {\n Name = \"Miskatonic University\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725518846/79D6BEB0D8C274E3D308A67CD3181418B02D3A7E/\"\n },\n {\n Name = \"Northside\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725519012/E4B527768AFEFE0E4FB4518CA2AFDD69A98AB5D1/\"\n },\n {\n Name = \"Rivertown\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725519190/7A9A09861EECE2D98B5C1EB694E88C2073ABDFDF/\"\n },\n {\n Name = \"Southside\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725519353/FE43349A25231F48662309FEB331DB2C418A5E80/\"\n },\n {\n Name = \"Uptown\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725519551/3630457608AD2DB605EC4BCF4332C1D0983305C0/\"\n }\n },\n [\"Default Image\"] = {\n {\n Name = \"Default Image\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/\"\n }\n },\n [\"Unsorted\"] = {\n {\n Name = \"Kingsport\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2279446315725522594/1EA2C0AF5D4D346AD3FFDC38215BB20AAA72CE8D/\"\n },\n {\n Name = \"Devil\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2115062479282248687/DD84A3CB3C4A475A5D093CB413A16A5CEA5FBF79/\"\n },\n {\n Name = \"Mystic Board\",\n URL = \"http://cloud-3.steamusercontent.com/ugc/2115062479282248488/EC27B1215F558A39954C27477D8B4F916CA211E5/\"\n }\n }\n }\n}\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"selectionIndex\":1,\"typeIndex\":1}", "MeasureMovement": false, "Name": "Custom_Token", @@ -89577,7 +88377,7 @@ }, "Description": "The Anomaly", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Manifold.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"89001\",\n \"type\": \"Investigator\",\n \"class\": \"Neutral\",\n \"traits\": \"Manifold.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "758b0a", "Grid": true, "GridProjection": false, @@ -89700,7 +88500,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89003\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Power.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"89003\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Power.\",\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "0a1b3a", "Grid": true, "GridProjection": false, @@ -89761,7 +88561,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89004\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Power.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"89004\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Power.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "0a1b3a", "Grid": true, "GridProjection": false, @@ -89822,7 +88622,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89005\",\r\n \"type\": \"Story\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"89005\",\n \"type\": \"Story\",\n \"class\": \"Neutral\",\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "858b0a", "Grid": true, "GridProjection": false, @@ -89883,7 +88683,7 @@ }, "Description": "(Un)-Controlled Hunger", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"startsInPlay\": true,\r\n \"traits\": \"Talent.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"89002\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Talent.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "558b0a", "Grid": true, "GridProjection": false, @@ -90006,7 +88806,7 @@ }, "Description": "The Bootlegger", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04003\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04003\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 4,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "dd40c0", "Grid": true, "GridProjection": false, @@ -90068,7 +88868,7 @@ }, "Description": "The Archeologist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08007\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Wayfarer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 5,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08007\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Wayfarer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 5,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "46b145", "Grid": true, "GridProjection": false, @@ -90104,6 +88904,192 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13600, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "136": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520738/82315ABC94958A349B8144CD56E5988E53BF2294/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520906/D92C977B92A6B9CCBFB1EDF94ABE919BF22E0FD4/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Archeologist", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"08007-p\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Wayfarer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 5,\n \"cycle\": \"Relics of the Past\"\n}", + "GUID": "46b146", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Monterey Jack (Parallel)", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 53.274, + "posY": 3.137, + "posZ": 22.081, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13800, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "138": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520738/82315ABC94958A349B8144CD56E5988E53BF2294/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517531830/EC1E6D6443C07256771BE6E913FFF97949E8FB7D/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Archeologist", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"08007-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Wayfarer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 5,\n \"cycle\": \"Relics of the Past\"\n}", + "GUID": "46b148", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Monterey Jack (Parallel Back)", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 53.274, + "posY": 3.137, + "posZ": 22.081, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13700, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "137": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517531692/2F83981C724FECFD69619EFE558B675129FEE563/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520906/D92C977B92A6B9CCBFB1EDF94ABE919BF22E0FD4/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Archeologist", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"08007-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Wayfarer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 5,\n \"cycle\": \"Relics of the Past\"\n}", + "GUID": "46b147", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Monterey Jack (Parallel Front)", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 53.274, + "posY": 3.137, + "posZ": 22.081, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -90130,7 +89116,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02225\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02225\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "acf2b0", "Grid": true, "GridProjection": false, @@ -90191,7 +89177,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01028\",\r\n \"alternate_ids\": [\r\n \"01528\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Police.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01028\",\n \"alternate_ids\": [\n \"01528\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Ally. Police.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "7001be", "Grid": true, "GridProjection": false, @@ -90227,6 +89213,252 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 8500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "85": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528306779/F60D99AAA35122A9553F0B5FD736DB6FB73BE7EF/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Chronicle of Wonders", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10013\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tome. Blessed. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "c5fb1f", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Book of Living Myths", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 1000, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "10": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528307333/8668BDBDA77DF0DA43A153536C7ED6ED22AC05D0/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10014\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Geist.\",\n \"weakness\": true,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "541bd9", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Weeping Yurei", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.325, + "posY": 3.548, + "posZ": -3.112, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 84700, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "847": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528307132/8E82D44E2F6AB7BFF189CB763611C59EF9EC1431/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528307218/ADD29232375EB7B3F78A33CB4BBA79A283DC7172/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10012-m\",\n \"type\": \"Minicard\"\n}", + "GUID": "cea427", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Kōhaku Narukami", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Minicard" + ], + "Tooltip": true, + "Transform": { + "posX": 5.756, + "posY": 3.649, + "posZ": 15.392, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.6, + "scaleY": 1, + "scaleZ": 0.6 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 1200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "12": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528306921/0A76D03B8AF90DA47EDD0910372D3039F8F721CF/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447041528307014/97D703914FF15C0251BBAF2719502EC26BDCDD5F/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Folklorist", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10012\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Scholar. Blessed. Cursed.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 4,\n \"combatIcons\": 3,\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "54eaa7", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Kōhaku Narukami", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.227, + "posY": 3.548, + "posZ": 2.42, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -90437,7 +89669,7 @@ "Description": "The Handyman", "DragSelectable": true, "GMNotes": "{\n \"id\": \"10001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", - "GUID": "54eab5", + "GUID": "55eab5", "Grid": true, "GridProjection": false, "Hands": true, @@ -90472,6 +89704,1358 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 4900, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "49": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447674651244606/B2275AD213AF8DD0B65170BD4E5E5E98E233A6C7/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10019\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm. Blessed.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "c1fb1f", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Ancestral Token", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 1700, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "17": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875866961/175F57B97C6DEC14F1F6E6420A318A76D38FFE8A/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10007\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Science.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "84ad64", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Aetheric Current (Yoth)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 12700, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "127": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867121/DD34A54C059F9DE340A3C54406A276D202D1C329/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10006\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Science.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "84ad65", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Aetheric Current (Yuggoth)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 57200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "572": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867257/845C4AF7C4ECDFA6EB547F4C8CBB4B192EFCF159/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10008\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Blunder.\",\n \"weakness\": true,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "acd281", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Failed Experiment", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.132, + "posY": 5.018, + "posZ": -16.723, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 78400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "784": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867375/0BEDB302FC862640FDBAB3CB2C014FE1BBA2B9DD/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867499/17C5348F996E1044F4ABA802807FAB9589E0C154/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": true + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10005\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Item. Tool. Science.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"10006\"\n },\n {\n \"count\": 1,\n \"id\": \"10007\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "55990a", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Flux Stabilizer", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 98.638, + "posY": 1.95, + "posZ": 13.549, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 12100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "121": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867646/87E93B4F71674659B01C9ED280E573D7BD929882/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867768/A54D29440DD5A9DA4E059B861C7AC22F5ACD9BE4/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Scientist", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10004\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic. Scholar.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 4,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "ce2322", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Kate Winthrop", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.227, + "posY": 3.548, + "posZ": 2.42, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "23": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867871/EB5C687183CDE5C99EB5DD7ADD3FB4BDD6FEAF90/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875867965/C9915CEC416F68E17D14095E2699FA7268826D66/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10004-m\",\n \"type\": \"Minicard\"\n}", + "GUID": "ce2323", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Kate Winthrop", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Minicard" + ], + "Tooltip": true, + "Transform": { + "posX": 5.756, + "posY": 3.649, + "posZ": 15.392, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.6, + "scaleY": 1, + "scaleZ": 0.6 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 52200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "522": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2280574378887536210/F43975F08B2C9DE8717AC605520379B3C3F0FE33/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10117\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Tool. Weapon. Ranged.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "2ea0d3", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hatchet (1)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.005, + "posY": 3.859, + "posZ": -16.695, + "rotX": 1, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 52100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "521": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2280574378887536350/F17918D27323F466AD8835E5DCE218FB81BD5804/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10126\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Charm. Blessed.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "2ea0d1", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Token of Faith (3)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.005, + "posY": 3.859, + "posZ": -16.695, + "rotX": 1, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 123100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1231": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875868083/4DA5C631FAAB5B6A2B7FD46DFC47C3EAF9ACB71A/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10050\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Gambit. Science.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "9965dd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Transmogrify", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 125300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1253": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186529136565/AE4B753BBB284EB12A0BDE36CEA3CD763C835AC0/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10024\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "aef183", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Absolution", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 124100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1241": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186529136671/AC1530FE71D9E5CF4F816A488E07076AC8064BD8/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10057\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Insight. Trick.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "9965de", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Confound (3)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "21": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186534148818/349C8EF53B9C78E4A0A9C22F7322423DF23AD5C7/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10031\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 1,\n \"traits\": \"Innate.\",\n \"agilityIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "294d6", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Strong-Armed (1)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 52200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "522": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186534148947/3C443D851F06103A1FC8D98195AE4B907A442385/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10123\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent. Science.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "2ea0d4", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Survival Technique (2)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.005, + "posY": 3.859, + "posZ": -16.695, + "rotX": 1, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 49100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "491": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186529136814/A09D725A3E1532BDD790011406D8BB68D1F4D2C5/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "From Distant Shores", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10068\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm. Cursed.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "c1fb2e", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Scrimshaw Charm", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 14500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "145": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186529136955/D4A382DBA69D8CBD9671F2E9F1B55DAFA95F4C3D/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10081\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Trick.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "add233", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Vamp (3)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 362500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "3625": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008875868194/EE49215440FE21B738BBF0E69644A32701A19FC0/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10130\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Practiced. Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "c6ac33", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Well-Dressed", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 29.34, + "posY": 3.372, + "posZ": -58.908, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "25": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279447674651244793/501B12FC5970ACC35866C564F2AF1635D23377CD/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10054\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Insight. Upgrade.\",\n \"agilityIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "103fbd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Fine Tuning (1)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.174, + "posY": 2.934, + "posZ": -16.731, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 11400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "114": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008872128556/C009C807744F221A9E7A2F8B67BA9EF291EA17C8/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Lens to the Otherworld", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10056\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic. Cursed.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "3adcf5", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Prismatic Spectacles (2)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 12100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "121": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008872128231/B3D4EF69ABE3736988B015629C5862F69EB42BDC/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10094\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "9965aa", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Drain Essence", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 7400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "74": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008872128378/E8199C752F09FB88E1A7D5F56FBC4B9D772F820D/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10066\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Illicit.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "acd38d", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Fake Credentials", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 40300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "403": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186559601365/6C247C82793481C97E24F74A26AF905E3B708C50/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Capricious Meddler", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10084\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm. Mask.\",\n \"combatIcons\": 1,\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "847ed6", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Cat Mask", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -90498,7 +91082,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90048\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Hardship.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90048\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Hardship.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "876557", "Grid": true, "GridProjection": false, @@ -90559,7 +91143,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90047\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Instrument.\",\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90047\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Instrument.\",\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "876557", "Grid": true, "GridProjection": false, @@ -90621,7 +91205,7 @@ }, "Description": "The Drifter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02005-pf\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02005-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5294c3", "Grid": true, "GridProjection": false, @@ -90683,7 +91267,7 @@ }, "Description": "The Drifter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02005-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02005-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5294c3", "Grid": true, "GridProjection": false, @@ -90745,7 +91329,7 @@ }, "Description": "The Drifter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02005-p\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02005-p\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5294c3", "Grid": true, "GridProjection": false, @@ -90788,14 +91372,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 100, + "CardID": 33100, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "331": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2172484009099794816/E5700422279C3B3100E11698F95F7FF2403C6362/", @@ -90807,7 +91391,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10128\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10128\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "e8765a", "Grid": true, "GridProjection": false, @@ -90850,14 +91434,136 @@ "z": 0 }, "Autoraise": true, - "CardID": 100, + "CardID": 2200, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "22": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279446315725170768/AA2426A7A410FEA47066203B1965D849D4AC43DA/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10028\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight. Upgrade.\",\n \"agilityIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "102fbd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Tinker", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.174, + "posY": 2.934, + "posZ": -16.731, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "21": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279446315725170600/22FCF4406C090610E507C757FAEECC820E7F1E23/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10030\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"combatIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "102fcd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Hand-Eye Coordination (1)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.174, + "posY": 2.934, + "posZ": -16.731, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 34100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "341": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2172484009099794971/0D542175146E0E2FBBBDCC8110B32A573FDBB03E/", @@ -90904,6 +91610,129 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 65100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "651": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008871909441/F9E7E4782DF158E035B6692FF54B509467764C2E/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10029\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate. Blessed.\",\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "294d6a", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Purified", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 34500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "345": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2279448008871909588/C2A18B9B3FFC42C2420E348FDA928FCE02DF8E71/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Secrets of the Unknown", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10104\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Tome. Blessed. Cursed.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 2,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "ae54c6", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "The Key of Solomon (4)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -90930,7 +91759,7 @@ }, "Description": "John Dee Translation (Advanced)", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90003\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item. Tome.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90003\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"traits\": \"Item. Tome.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "5b2e10", "Grid": true, "GridProjection": false, @@ -90992,7 +91821,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01006\",\r\n \"alternate_ids\": [\r\n \"01506\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01006\",\n \"alternate_ids\": [\n \"01506\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "4edb91", "Grid": true, "GridProjection": false, @@ -91054,7 +91883,7 @@ }, "Description": "Enemy", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01103\",\r\n \"alternate_ids\": [\r\n \"01603\"\r\n ],\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Detective.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01103\",\n \"alternate_ids\": [\n \"01603\"\n ],\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Detective.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "4ea68b", "Grid": true, "GridProjection": false, @@ -91115,7 +91944,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02194\",\r\n \"alternate_ids\": [\r\n \"01693\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Supply.\",\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02194\",\n \"alternate_ids\": [\n \"01693\"\n ],\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Supply.\",\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "8948c4", "Grid": true, "GridProjection": false, @@ -91176,7 +92005,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02158\",\r\n \"alternate_ids\": [\r\n \"01694\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02158\",\n \"alternate_ids\": [\n \"01694\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9e6c55", "Grid": true, "GridProjection": false, @@ -91238,7 +92067,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02157\",\r\n \"alternate_ids\": [\r\n \"01695\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02157\",\n \"alternate_ids\": [\n \"01695\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "3c959c", "Grid": true, "GridProjection": false, @@ -91300,7 +92129,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01039\",\r\n \"alternate_ids\": [\r\n \"60219\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01039\",\n \"alternate_ids\": [\n \"60219\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "b265c4", "Grid": true, "GridProjection": false, @@ -91361,7 +92190,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01021\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Creature.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "08bdf1", "Grid": true, "GridProjection": false, @@ -91423,7 +92252,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51011\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact. Mystery.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51011\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact. Mystery.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "fd9c56", "Grid": true, "GridProjection": false, @@ -91484,7 +92313,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07269\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Spirit. Blessed.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07269\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Spirit. Blessed.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "176836", "Grid": true, "GridProjection": false, @@ -91545,7 +92374,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04024\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04024\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f763e8", "Grid": true, "GridProjection": false, @@ -91606,7 +92435,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07029\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07029\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9c32e2", "Grid": true, "GridProjection": false, @@ -91668,7 +92497,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04305\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04305\",\n \"type\": \"Asset\",\n \"slot\": \"Body|Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "cf4f15", "Grid": true, "GridProjection": false, @@ -91730,7 +92559,7 @@ }, "Description": "Recalling Ancient Things", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02217\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Dunwich.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02217\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Dunwich.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "6714b2", "Grid": true, "GridProjection": false, @@ -91792,7 +92621,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07268\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 4,\r\n \"traits\": \"Item. Instrument. Relic. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07268\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"level\": 4,\n \"traits\": \"Item. Instrument. Relic. Cursed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3cc1e2", "Grid": true, "GridProjection": false, @@ -91801,7 +92630,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FluteoftheOuterGods4\")\nend)\n__bundle_register(\"playercards/cards/FluteoftheOuterGods4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FluteoftheOuterGods4\")\nend)\n__bundle_register(\"playercards/cards/FluteoftheOuterGods4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -91854,7 +92683,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08061\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08061\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Spirit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "ef46e9", "Grid": true, "GridProjection": false, @@ -91915,7 +92744,7 @@ }, "Description": "Repossess the Past", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04303\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04303\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "87718c", "Grid": true, "GridProjection": false, @@ -91977,7 +92806,7 @@ }, "Description": "Unleash the Timestream", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04343\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04343\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "35bc58", "Grid": true, "GridProjection": false, @@ -92039,7 +92868,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08129\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Favor. Synergy.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08129\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Favor. Synergy.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1d1901", "Grid": true, "GridProjection": false, @@ -92100,7 +92929,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08111\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08111\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue|Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5ade28", "Grid": true, "GridProjection": false, @@ -92162,7 +92991,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04310\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04310\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "b10a71", "Grid": true, "GridProjection": false, @@ -92171,7 +93000,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShardsoftheVoid3\")\nend)\n__bundle_register(\"playercards/cards/ShardsoftheVoid3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"0\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShardsoftheVoid3\")\nend)\n__bundle_register(\"playercards/cards/ShardsoftheVoid3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"0\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -92224,7 +93053,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53006\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "8dda2d", "Grid": true, "GridProjection": false, @@ -92286,7 +93115,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07161\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07161\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "45956a", "Grid": true, "GridProjection": false, @@ -92347,7 +93176,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06201\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06201\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "8e8a14", "Grid": true, "GridProjection": false, @@ -92408,7 +93237,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Talent.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03010\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Talent.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "7b6ab5", "Grid": true, "GridProjection": false, @@ -92470,7 +93299,7 @@ }, "Description": "Mystic", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05189\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05189\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "194d88", "Grid": true, "GridProjection": false, @@ -92479,7 +93308,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -92532,7 +93361,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04204\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Weapon. Ranged.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04204\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Item. Relic. Weapon. Ranged.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "2acced", "Grid": true, "GridProjection": false, @@ -92594,7 +93423,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06017\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Extradimensional.\",\r\n \"weakness\": true,\r\n \"hidden\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06017\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Extradimensional.\",\n \"weakness\": true,\n \"hidden\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "6945f7", "Grid": true, "GridProjection": false, @@ -92655,7 +93484,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08095\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Survivor\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Item. Armor.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08095\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian|Survivor\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Item. Armor.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "9a5cb1", "Grid": true, "GridProjection": false, @@ -92717,7 +93546,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04203\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04203\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Clothing.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "ba560e", "Grid": true, "GridProjection": false, @@ -92779,7 +93608,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01014\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01014\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "27b4ea", "Grid": true, "GridProjection": false, @@ -92841,7 +93670,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50009\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "0414b4", "Grid": true, "GridProjection": false, @@ -92903,7 +93732,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60505\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60505\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "101a41", "Grid": true, "GridProjection": false, @@ -92965,7 +93794,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03312\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 5,\r\n \"traits\": \"Spell. Expert.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03312\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 5,\n \"traits\": \"Spell. Expert.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "91e890", "Grid": true, "GridProjection": false, @@ -93026,7 +93855,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53002\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 2,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "c1d796", "Grid": true, "GridProjection": false, @@ -93088,7 +93917,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ritual. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07006\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ritual. Blessed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3c0249", "Grid": true, "GridProjection": false, @@ -93211,7 +94040,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03310\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 5,\r\n \"traits\": \"Trick. Fated.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03310\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 5,\n \"traits\": \"Trick. Fated.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "3add54", "Grid": true, "GridProjection": false, @@ -93272,7 +94101,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02020\",\r\n \"alternate_ids\": [\r\n \"60212\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic. Science.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02020\",\n \"alternate_ids\": [\n \"60212\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic. Science.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "147cb2", "Grid": true, "GridProjection": false, @@ -93334,7 +94163,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06331\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"wildIcons\": 2,\r\n \"negativeIcons\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06331\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"wildIcons\": 2,\n \"negativeIcons\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ae16e8", "Grid": true, "GridProjection": false, @@ -93395,7 +94224,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07220\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Charm. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07220\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Charm. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "2d2246", "Grid": true, "GridProjection": false, @@ -93457,7 +94286,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02025\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02025\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "6fec31", "Grid": true, "GridProjection": false, @@ -93518,7 +94347,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60419\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced. Augury.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60419\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Practiced. Augury.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "7e7873", "Grid": true, "GridProjection": false, @@ -93579,7 +94408,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02272\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02272\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Clothing.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5cb973", "Grid": true, "GridProjection": false, @@ -93641,7 +94470,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60125\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spirit. Bold.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60125\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spirit. Bold.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "14424c", "Grid": true, "GridProjection": false, @@ -93702,7 +94531,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05276\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05276\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "4ea716", "Grid": true, "GridProjection": false, @@ -93764,7 +94593,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03228\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03228\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "80628f", "Grid": true, "GridProjection": false, @@ -93825,7 +94654,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01035\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "ba16cb", "Grid": true, "GridProjection": false, @@ -93887,7 +94716,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07190\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Ritual. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07190\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Ritual. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "205385", "Grid": true, "GridProjection": false, @@ -93949,7 +94778,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02107\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02107\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Insight. Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "acd0da", "Grid": true, "GridProjection": false, @@ -94010,7 +94839,7 @@ }, "Description": "The Fateful Step", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05040\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05040\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "52a677", "Grid": true, "GridProjection": false, @@ -94133,7 +94962,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03117\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Desperate.\",\r\n \"intellectIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03117\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Desperate.\",\n \"intellectIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "45bdf0", "Grid": true, "GridProjection": false, @@ -94194,7 +95023,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07227\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07227\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Spell. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "f68105", "Grid": true, "GridProjection": false, @@ -94256,7 +95085,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07037\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Blessed. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07037\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Fortune. Blessed. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "33f906", "Grid": true, "GridProjection": false, @@ -94317,7 +95146,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60515\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60515\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a92a90", "Grid": true, "GridProjection": false, @@ -94378,7 +95207,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03233\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Gambit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03233\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Gambit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "c40cb4", "Grid": true, "GridProjection": false, @@ -94439,7 +95268,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04107\",\r\n \"alternate_ids\": [\r\n \"60308\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04107\",\n \"alternate_ids\": [\n \"60308\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "c607c5", "Grid": true, "GridProjection": false, @@ -94501,7 +95330,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05115\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Rogue\",\r\n \"cost\": 6,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05115\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian|Rogue\",\n \"cost\": 6,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "2c6509", "Grid": true, "GridProjection": false, @@ -94563,7 +95392,7 @@ }, "Description": "Trap.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"81020\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Trap.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"81020\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Trap.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "74840a", "Grid": true, "GridProjection": false, @@ -94625,7 +95454,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60315\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60315\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "cc9563", "Grid": true, "GridProjection": false, @@ -94686,7 +95515,7 @@ }, "Description": "Ally. Believer.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"82022\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Believer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"82022\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Believer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "a4b514", "Grid": true, "GridProjection": false, @@ -94748,7 +95577,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06239\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06239\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "1bd139", "Grid": true, "GridProjection": false, @@ -94810,7 +95639,7 @@ }, "Description": "Took You Long Enough", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05261\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Socialite.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05261\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Socialite.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "726d1d", "Grid": true, "GridProjection": false, @@ -94872,7 +95701,7 @@ }, "Description": "Acuity", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06243\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06243\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "3d22c4", "Grid": true, "GridProjection": false, @@ -94934,7 +95763,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04109\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04109\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "e425d0", "Grid": true, "GridProjection": false, @@ -94996,7 +95825,7 @@ }, "Description": "Signs of the Black Stars", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05235\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05235\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b40b98", "Grid": true, "GridProjection": false, @@ -95058,7 +95887,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02151\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Trick. Spirit.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02151\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Trick. Spirit.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "62cf25", "Grid": true, "GridProjection": false, @@ -95119,7 +95948,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04012\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Blunder.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04012\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Blunder.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "ecd087", "Grid": true, "GridProjection": false, @@ -95180,7 +96009,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60422\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Clothing.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60422\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Clothing.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "ef43db", "Grid": true, "GridProjection": false, @@ -95242,7 +96071,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06031\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"traits\": \"Ally. Creature. Dreamlands.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06031\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"traits\": \"Ally. Creature. Dreamlands.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "45c582", "Grid": true, "GridProjection": false, @@ -95304,7 +96133,7 @@ }, "Description": "The Murder Weapon", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"84006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Weapon. Melee. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"84006\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Weapon. Melee. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "d71f11", "Grid": true, "GridProjection": false, @@ -95366,7 +96195,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03028\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03028\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "ddee79", "Grid": true, "GridProjection": false, @@ -95428,7 +96257,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07014\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07014\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "4e405d", "Grid": true, "GridProjection": false, @@ -95490,7 +96319,7 @@ }, "Description": "The Ferryman's Pay", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03308\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03308\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Item. Relic.\",\n \"permanent\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1dbc95", "Grid": true, "GridProjection": false, @@ -95552,7 +96381,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07119\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07119\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell. Cursed.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "a565d5", "Grid": true, "GridProjection": false, @@ -95614,7 +96443,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04229\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 8,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04229\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 8,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "b1ad65", "Grid": true, "GridProjection": false, @@ -95676,7 +96505,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05281\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05281\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "869d4c", "Grid": true, "GridProjection": false, @@ -95737,7 +96566,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06167\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06167\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "eca1c8", "Grid": true, "GridProjection": false, @@ -95799,7 +96628,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04010\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Supply. Illicit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04010\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Supply. Illicit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "1f3880", "Grid": true, "GridProjection": false, @@ -95860,7 +96689,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04309\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 5,\r\n \"traits\": \"Fortune.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04309\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 5,\n \"traits\": \"Fortune.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "7d3a27", "Grid": true, "GridProjection": false, @@ -95921,7 +96750,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51010\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 3,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51010\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 3,\n \"traits\": \"Innate.\",\n \"wildIcons\": 2,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "bb501b", "Grid": true, "GridProjection": false, @@ -95982,7 +96811,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05313\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Occult. Blessed.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 3,\r\n \"id\": \"05314\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05313\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Relic. Occult. Blessed.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"05314\"\n }\n ],\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "312d38", "Grid": true, "GridProjection": false, @@ -96044,7 +96873,7 @@ }, "Description": "Cat General of Ulthar", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Creature. Dreamlands.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06031\"\r\n },\r\n {\r\n \"count\": 1,\r\n \"id\": \"06032\"\r\n },\r\n {\r\n \"count\": 1,\r\n \"id\": \"06033\"\r\n }\r\n ],\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06030\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Ally. Creature. Dreamlands.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06031\"\n },\n {\n \"count\": 1,\n \"id\": \"06032\"\n },\n {\n \"count\": 1,\n \"id\": \"06033\"\n }\n ],\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "e1aedf", "Grid": true, "GridProjection": false, @@ -96106,7 +96935,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01085\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01085\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "0027f2", "Grid": true, "GridProjection": false, @@ -96167,7 +96996,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02193\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02193\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "dffe4a", "Grid": true, "GridProjection": false, @@ -96229,7 +97058,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98012\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task. Dreamlands.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98012\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task. Dreamlands.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "00b6c3", "Grid": true, "GridProjection": false, @@ -96290,7 +97119,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03189\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03189\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "84ba9d", "Grid": true, "GridProjection": false, @@ -96351,7 +97180,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54004\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome. Occult.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 3,\r\n \"id\": \"05317\"\r\n }\r\n ],\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54004\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tome. Occult.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"05317\"\n }\n ],\n \"intellectIcons\": 2,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "71d99c", "Grid": true, "GridProjection": false, @@ -96413,7 +97242,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03020\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03020\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "b0f851", "Grid": true, "GridProjection": false, @@ -96475,7 +97304,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04304\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04304\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "25ad44", "Grid": true, "GridProjection": false, @@ -96537,7 +97366,7 @@ }, "Description": "Monster. Extradimensional. Tindalos.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06283\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Extradimensional. Tindalos.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06283\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Extradimensional. Tindalos.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "86cf9c", "Grid": true, "GridProjection": false, @@ -96598,7 +97427,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01019\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01019\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent. Science.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "5cd622", "Grid": true, "GridProjection": false, @@ -96660,7 +97489,7 @@ }, "Description": "Lookin' Out For #1", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02265\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02265\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Criminal.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "b51688", "Grid": true, "GridProjection": false, @@ -96722,7 +97551,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02184\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02184\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "831b6b", "Grid": true, "GridProjection": false, @@ -96783,7 +97612,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05273\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Weapon. Ranged.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05273\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Ranged.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0ab574", "Grid": true, "GridProjection": false, @@ -96845,7 +97674,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60202\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60202\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2fdcc9", "Grid": true, "GridProjection": false, @@ -96907,7 +97736,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05025\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05025\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "13413d", "Grid": true, "GridProjection": false, @@ -96968,7 +97797,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01037\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01037\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "eb6165", "Grid": true, "GridProjection": false, @@ -97029,7 +97858,7 @@ }, "Description": "The Purifier", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60107\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Hunter.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60107\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 0,\n \"traits\": \"Ally. Hunter.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f6dfe5", "Grid": true, "GridProjection": false, @@ -97091,7 +97920,7 @@ }, "Description": "Minds in Harmony", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"04231\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", + "GMNotes": "{\n \"id\": \"04231\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9c56d3", "Grid": true, "GridProjection": false, @@ -97153,7 +97982,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60420\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60420\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Spell. Spirit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e84eff", "Grid": true, "GridProjection": false, @@ -97214,7 +98043,7 @@ }, "Description": "Unidentified", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04022\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04022\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9bc46e", "Grid": true, "GridProjection": false, @@ -97276,7 +98105,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "180b5b", "Grid": true, "GridProjection": false, @@ -97337,7 +98166,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07155\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07155\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell. Cursed.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "b7c316", "Grid": true, "GridProjection": false, @@ -97398,7 +98227,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04152\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04152\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "d64c99", "Grid": true, "GridProjection": false, @@ -97459,7 +98288,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04265\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Police.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04265\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Police.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "5f33be", "Grid": true, "GridProjection": false, @@ -97521,7 +98350,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05274\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 7,\r\n \"level\": 5,\r\n \"traits\": \"Ally. Agency.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05274\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 7,\n \"level\": 5,\n \"traits\": \"Ally. Agency.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d6eda3", "Grid": true, "GridProjection": false, @@ -97583,7 +98412,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06033\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"traits\": \"Ally. Creature. Dreamlands.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06033\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"traits\": \"Ally. Creature. Dreamlands.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "cf9ca8", "Grid": true, "GridProjection": false, @@ -97645,7 +98474,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04271\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04271\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "68fce2", "Grid": true, "GridProjection": false, @@ -97707,7 +98536,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02111\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"victory\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02111\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"victory\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "14e212", "Grid": true, "GridProjection": false, @@ -97768,7 +98597,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04041\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04041\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "85e7d9", "Grid": true, "GridProjection": false, @@ -97829,7 +98658,7 @@ }, "Description": "Permanent", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53010\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "2ebdf1", "Grid": true, "GridProjection": false, @@ -97891,7 +98720,7 @@ }, "Description": "Symbol of Righteousness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Charm.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02006\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Charm.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "66d810", "Grid": true, "GridProjection": false, @@ -97953,7 +98782,7 @@ }, "Description": "Symbol of Conviction (Advanced)", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"90060\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Charm.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Path of the Righteous\"\n}", + "GMNotes": "{\n \"id\": \"90060\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Charm.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Path of the Righteous\"\n}", "GUID": "66d811", "Grid": true, "GridProjection": false, @@ -98015,7 +98844,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07270\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07270\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "734b45", "Grid": true, "GridProjection": false, @@ -98077,7 +98906,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06159\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06159\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Science.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "98c5af", "Grid": true, "GridProjection": false, @@ -98139,7 +98968,7 @@ }, "Description": "Stealing Time", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02305\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02305\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "62d930", "Grid": true, "GridProjection": false, @@ -98201,7 +99030,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98005\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98005\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "274daa", "Grid": true, "GridProjection": false, @@ -98262,7 +99091,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60126\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"combatIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60126\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 2,\n \"traits\": \"Practiced. Expert.\",\n \"combatIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "017e1f", "Grid": true, "GridProjection": false, @@ -98323,7 +99152,7 @@ }, "Description": "The Purifier", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60128\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Hunter.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60128\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 3,\n \"traits\": \"Ally. Hunter.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "b39b78", "Grid": true, "GridProjection": false, @@ -98385,7 +99214,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02153\",\r\n \"alternate_ids\": [\r\n \"60414\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02153\",\n \"alternate_ids\": [\n \"60414\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "8f3c8e", "Grid": true, "GridProjection": false, @@ -98446,7 +99275,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04235\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04235\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Relic. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "949ca2", "Grid": true, "GridProjection": false, @@ -98455,7 +99284,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/CrystallineElderSign3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"+1\"] = true,\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/CrystallineElderSign3\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/CrystallineElderSign3\")\nend)\n__bundle_register(\"playercards/cards/CrystallineElderSign3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"+1\"] = true,\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -98508,7 +99337,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05030\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05030\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "e2767a", "Grid": true, "GridProjection": false, @@ -98569,7 +99398,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02108\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02108\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "7f99cc", "Grid": true, "GridProjection": false, @@ -98631,7 +99460,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60408\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60408\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "b67371", "Grid": true, "GridProjection": false, @@ -98693,7 +99522,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60525\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60525\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0c433b", "Grid": true, "GridProjection": false, @@ -98754,7 +99583,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05275\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05275\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b7c503", "Grid": true, "GridProjection": false, @@ -98815,7 +99644,7 @@ }, "Description": "Let Your Arrow Fly True", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05023\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "c4d436", "Grid": true, "GridProjection": false, @@ -98877,7 +99706,7 @@ }, "Description": "Consult Experts", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90027\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "2d9256", "Grid": true, "GridProjection": false, @@ -98939,7 +99768,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05028\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Condition.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05028\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Condition.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "66b7d5", "Grid": true, "GridProjection": false, @@ -98948,7 +99777,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/WellConnected\")\nend)\n__bundle_register(\"playercards/cards/WellConnected\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between both the level 0 and the upgraded level 3 version of the card\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal modValue, loopId\nlocal buttonParameters = {\n click_function = \"toggleCounter\",\n tooltip = \"disable counter\",\n function_owner = self,\n position = { 0.88, 0.5, -1.33 },\n font_size = 150,\n width = 175,\n height = 175\n}\n\nfunction onSave() return JSON.encode({ loopId = loopId }) end\n\nfunction onLoad(savedData)\n -- use metadata to detect level and adjust modValue accordingly\n if JSON.decode(self.getGMNotes()).level == 0 then\n modValue = 5\n else\n modValue = 4\n end\n\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.loopId then\n self.createButton(buttonParameters)\n loopId = Wait.time(updateDisplay, 2, -1)\n end\n end\n\n self.addContextMenuItem(\"Toggle Counter\", toggleCounter)\nend\n\nfunction toggleCounter()\n if loopId ~= nil then\n Wait.stop(loopId)\n loopId = nil\n self.clearButtons()\n else\n self.createButton(buttonParameters)\n updateDisplay()\n loopId = Wait.time(updateDisplay, 2, -1)\n end\nend\n\nfunction updateDisplay()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n local resources = playmatApi.getCounterValue(matColor, \"ResourceCounter\")\n local count = tostring(math.floor(resources / modValue))\n self.editButton({ index = 0, label = count })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/WellConnected\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between both the level 0 and the upgraded level 3 version of the card\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal modValue, loopId\nlocal buttonParameters = {\n click_function = \"toggleCounter\",\n tooltip = \"disable counter\",\n function_owner = self,\n position = { 0.88, 0.5, -1.33 },\n font_size = 150,\n width = 175,\n height = 175\n}\n\nfunction onSave() return JSON.encode({ loopId = loopId }) end\n\nfunction onLoad(savedData)\n -- use metadata to detect level and adjust modValue accordingly\n if JSON.decode(self.getGMNotes()).level == 0 then\n modValue = 5\n else\n modValue = 4\n end\n\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.loopId then\n self.createButton(buttonParameters)\n loopId = Wait.time(updateDisplay, 2, -1)\n end\n end\n\n self.addContextMenuItem(\"Toggle Counter\", toggleCounter)\nend\n\nfunction toggleCounter()\n if loopId ~= nil then\n Wait.stop(loopId)\n loopId = nil\n self.clearButtons()\n else\n self.createButton(buttonParameters)\n updateDisplay()\n loopId = Wait.time(updateDisplay, 2, -1)\n end\nend\n\nfunction updateDisplay()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n local resources = playmatApi.getCounterValue(matColor, \"ResourceCounter\")\n local count = tostring(math.floor(resources / modValue))\n self.editButton({ index = 0, label = count })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/WellConnected\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -99001,7 +99830,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05280\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 5,\r\n \"traits\": \"Spell. Paradox.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05280\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 5,\n \"traits\": \"Spell. Paradox.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d24531", "Grid": true, "GridProjection": false, @@ -99062,7 +99891,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60320\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Item. Illicit.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60320\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Item. Illicit.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "5065a6", "Grid": true, "GridProjection": false, @@ -99124,7 +99953,7 @@ }, "Description": "Doorway to Another World", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"86052\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Spell.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"86052\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Spell.\",\n \"wildIcons\": 2,\n \"cycle\": \"Standalone\"\n}", "GUID": "35e8e2", "Grid": true, "GridProjection": false, @@ -99186,7 +100015,7 @@ }, "Description": "Jewel of the Gods", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06277\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Item. Relic. Blessed.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06277\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"traits\": \"Item. Relic. Blessed.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "464ca1", "Grid": true, "GridProjection": false, @@ -99248,7 +100077,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07012\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "ad63bc", "Grid": true, "GridProjection": false, @@ -99310,7 +100139,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60410\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature. Summon.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60410\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ally. Creature. Summon.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "971d52", "Grid": true, "GridProjection": false, @@ -99372,7 +100201,7 @@ }, "Description": "From the Brink", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05039\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05039\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "46187b", "Grid": true, "GridProjection": false, @@ -99434,7 +100263,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51003\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51003\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "5e32a5", "Grid": true, "GridProjection": false, @@ -99495,7 +100324,7 @@ }, "Description": "Mask of the Burning Pit", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"86055\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"86055\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "a4775a", "Grid": true, "GridProjection": false, @@ -99557,7 +100386,7 @@ }, "Description": "Dreams of a Child", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06238\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome. Charm.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06113\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06238\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tome. Charm.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06113\"\n }\n ],\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ea40f6", "Grid": true, "GridProjection": false, @@ -99619,7 +100448,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03147\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03147\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "0d4eb9", "Grid": true, "GridProjection": false, @@ -99681,7 +100510,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04103\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Bold.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04103\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Bold.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "ab37af", "Grid": true, "GridProjection": false, @@ -99742,7 +100571,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02155\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02155\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ee20c9", "Grid": true, "GridProjection": false, @@ -99804,7 +100633,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07116\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 2,\r\n \"traits\": \"Covenant. Cursed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07116\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Cursed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3442f5", "Grid": true, "GridProjection": false, @@ -99866,7 +100695,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02307\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 5,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02307\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 5,\n \"traits\": \"Spell. Spirit.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "7bc995", "Grid": true, "GridProjection": false, @@ -99927,7 +100756,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02235\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02235\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "be4abe", "Grid": true, "GridProjection": false, @@ -99988,7 +100817,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06166\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Developed.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06166\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate. Developed.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "fb9b7e", "Grid": true, "GridProjection": false, @@ -100049,7 +100878,7 @@ }, "Description": "A Gift Unlooked For", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03142\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03142\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "f295d9", "Grid": true, "GridProjection": false, @@ -100111,7 +100940,7 @@ }, "Description": "Soldier in a New War", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07082\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Agency. Veteran.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07082\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Agency. Veteran.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "1f7e6e", "Grid": true, "GridProjection": false, @@ -100173,7 +101002,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02260\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02260\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "83d8d7", "Grid": true, "GridProjection": false, @@ -100234,7 +101063,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02186\",\r\n \"alternate_ids\": [\r\n \"60218\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02186\",\n \"alternate_ids\": [\n \"60218\"\n ],\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "60b353", "Grid": true, "GridProjection": false, @@ -100295,7 +101124,7 @@ }, "Description": "Doom Begets Doom", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04026\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Cursed.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04026\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Item. Relic. Cursed.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "07350b", "Grid": true, "GridProjection": false, @@ -100357,7 +101186,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05033\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05033\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spell. Spirit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "24eb36", "Grid": true, "GridProjection": false, @@ -100418,7 +101247,7 @@ }, "Description": "Renowned Historian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04051\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04051\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Wayfarer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "c49b4b", "Grid": true, "GridProjection": false, @@ -100480,7 +101309,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07308\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 5,\r\n \"traits\": \"Spell. Blessed. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07308\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 5,\n \"traits\": \"Spell. Blessed. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "315b45", "Grid": true, "GridProjection": false, @@ -100541,7 +101370,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03029\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03029\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "819aee", "Grid": true, "GridProjection": false, @@ -100602,7 +101431,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06329\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06329\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b4b991", "Grid": true, "GridProjection": false, @@ -100664,7 +101493,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60111\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60111\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3319be", "Grid": true, "GridProjection": false, @@ -100725,7 +101554,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04267\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04267\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "bc4788", "Grid": true, "GridProjection": false, @@ -100787,7 +101616,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05231\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05231\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "6de21b", "Grid": true, "GridProjection": false, @@ -100848,7 +101677,7 @@ }, "Description": "Stamina", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06241\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06241\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ffe4dd", "Grid": true, "GridProjection": false, @@ -100971,7 +101800,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60329\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60329\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "7baf75", "Grid": true, "GridProjection": false, @@ -101032,7 +101861,7 @@ }, "Description": "Hour of the Huntress", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"98002\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Promo\"\n}", + "GMNotes": "{\n \"id\": \"98002\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Promo\"\n}", "GUID": "c729ab", "Grid": true, "GridProjection": false, @@ -101094,7 +101923,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06240\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 2,\r\n \"traits\": \"Fortune. Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06240\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 2,\n \"traits\": \"Fortune. Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b3cad4", "Grid": true, "GridProjection": false, @@ -101155,7 +101984,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60104\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60104\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2204cc", "Grid": true, "GridProjection": false, @@ -101216,7 +102045,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07021\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "4f3142", "Grid": true, "GridProjection": false, @@ -101278,7 +102107,7 @@ }, "Description": "Acidic Ichor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02263\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Science.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02263\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Science.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "fa61ba", "Grid": true, "GridProjection": false, @@ -101340,7 +102169,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05021\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Spirit. Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05021\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Spirit. Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "683937", "Grid": true, "GridProjection": false, @@ -101401,7 +102230,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03199\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Trap. Improvised.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03199\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Trap. Improvised.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "f66dd9", "Grid": true, "GridProjection": false, @@ -101462,7 +102291,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04276\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 5,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04276\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 5,\n \"level\": 5,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "d3e55b", "Grid": true, "GridProjection": false, @@ -101524,7 +102353,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03191\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03191\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "812175", "Grid": true, "GridProjection": false, @@ -101585,7 +102414,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ritual. Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54008\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ritual. Talent.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "f998c5", "Grid": true, "GridProjection": false, @@ -101647,7 +102476,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60507\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Key\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60507\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Key\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "5888da", "Grid": true, "GridProjection": false, @@ -101709,7 +102538,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03235\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03235\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "79287f", "Grid": true, "GridProjection": false, @@ -101770,7 +102599,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03021\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e25dc1", "Grid": true, "GridProjection": false, @@ -101894,7 +102723,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60109\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60109\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "af3efd", "Grid": true, "GridProjection": false, @@ -101956,7 +102785,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52013\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"hidden\": true,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52013\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"hidden\": true,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "ea0fa1", "Grid": true, "GridProjection": false, @@ -102017,7 +102846,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98003\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Dark Young.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98003\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Dark Young.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "46812e", "Grid": true, "GridProjection": false, @@ -102078,7 +102907,7 @@ }, "Description": "Hunter of Rare Books", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60213\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60213\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3c5099", "Grid": true, "GridProjection": false, @@ -102140,7 +102969,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05118\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic|Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05118\",\n \"type\": \"Asset\",\n \"slot\": \"Hand|Arcane\",\n \"class\": \"Mystic|Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "c7d9b5", "Grid": true, "GridProjection": false, @@ -102202,7 +103031,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60302\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 6,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60302\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 6,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2c563c", "Grid": true, "GridProjection": false, @@ -102263,7 +103092,7 @@ }, "Description": "Charge Ever Onward", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54005\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "159f82", "Grid": true, "GridProjection": false, @@ -102325,7 +103154,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"05154\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", + "GMNotes": "{\n \"id\": \"05154\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "5ada0a", "Grid": true, "GridProjection": false, @@ -102387,7 +103216,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04194\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04194\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "19ab7c", "Grid": true, "GridProjection": false, @@ -102449,7 +103278,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07030\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07030\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "823e49", "Grid": true, "GridProjection": false, @@ -102510,7 +103339,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98009\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Extradimensional. Tindalos.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98009\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Extradimensional. Tindalos.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "ce3a1a", "Grid": true, "GridProjection": false, @@ -102571,7 +103400,7 @@ }, "Description": "Alacrity", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06242\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06242\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "4c0f00", "Grid": true, "GridProjection": false, @@ -102633,7 +103462,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03153\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03153\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "9c922f", "Grid": true, "GridProjection": false, @@ -102694,7 +103523,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02036\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02036\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "756a35", "Grid": true, "GridProjection": false, @@ -102756,7 +103585,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60528\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Fortune.\",\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60528\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Fortune.\",\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "04d33d", "Grid": true, "GridProjection": false, @@ -102817,7 +103646,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60406\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60406\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "6446d1", "Grid": true, "GridProjection": false, @@ -102879,7 +103708,7 @@ }, "Description": "Vessel of Good and Evil", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07225\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic. Blessed. Cursed.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07225\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic. Blessed. Cursed.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "df182a", "Grid": true, "GridProjection": false, @@ -102941,7 +103770,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06009\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Blunder. Mystery.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06009\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Blunder. Mystery.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "f4dd3d", "Grid": true, "GridProjection": false, @@ -103002,7 +103831,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04032\",\r\n \"alternate_ids\": [\r\n \"60417\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Augury.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04032\",\n \"alternate_ids\": [\n \"60417\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Augury.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "da7613", "Grid": true, "GridProjection": false, @@ -103063,7 +103892,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07221\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07221\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "06abe0", "Grid": true, "GridProjection": false, @@ -103072,7 +103901,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShieldofFaith2\")\nend)\n__bundle_register(\"playercards/cards/ShieldofFaith2\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ShieldofFaith2\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShieldofFaith2\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -103125,7 +103954,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05277\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Favor. Service.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05277\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Favor. Service.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "bf5a5f", "Grid": true, "GridProjection": false, @@ -103186,7 +104015,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07036\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07036\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "b4666d", "Grid": true, "GridProjection": false, @@ -103247,7 +104076,7 @@ }, "Description": "Logistical Genius", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"85032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Agency. Veteran.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"85032\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Agency. Veteran.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "4120f3", "Grid": true, "GridProjection": false, @@ -103309,7 +104138,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60103\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Criminal. Syndicate.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60103\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Criminal. Syndicate.\",\n \"weakness\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "c3a014", "Grid": true, "GridProjection": false, @@ -103370,7 +104199,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03040\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03040\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "88a9b3", "Grid": true, "GridProjection": false, @@ -103431,7 +104260,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51006\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51006\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "3e0653", "Grid": true, "GridProjection": false, @@ -103492,7 +104321,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05111\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Favor. Service.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05111\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Favor. Service.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "5115d9", "Grid": true, "GridProjection": false, @@ -103553,7 +104382,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03106\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03106\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bb0f6a", "Grid": true, "GridProjection": false, @@ -103614,7 +104443,7 @@ }, "Description": "Esteemed Eschatologist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03112\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Patron.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03112\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Patron.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1f8539", "Grid": true, "GridProjection": false, @@ -103676,7 +104505,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04150\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced. Bold.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04150\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Practiced. Bold.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "50fb37", "Grid": true, "GridProjection": false, @@ -103737,7 +104566,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04019\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Upgrade.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04019\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Upgrade.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "1bc300", "Grid": true, "GridProjection": false, @@ -103798,7 +104627,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60304\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60304\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "c45e67", "Grid": true, "GridProjection": false, @@ -103859,7 +104688,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90031\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Clue\",\r\n \"token\": \"clue\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90031\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Clue\",\n \"token\": \"clue\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "f802e3", "Grid": true, "GridProjection": false, @@ -103920,7 +104749,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03152\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03152\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5f19e0", "Grid": true, "GridProjection": false, @@ -103981,7 +104810,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04157\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04157\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "a5c780", "Grid": true, "GridProjection": false, @@ -104042,7 +104871,7 @@ }, "Description": "Due Diligence", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90025\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90025\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "133521", "Grid": true, "GridProjection": false, @@ -104104,7 +104933,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02017\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02017\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d5cac6", "Grid": true, "GridProjection": false, @@ -104165,7 +104994,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07154\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07154\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "ca1b5c", "Grid": true, "GridProjection": false, @@ -104226,7 +105055,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03265\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03265\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bbfe9b", "Grid": true, "GridProjection": false, @@ -104287,7 +105116,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06036\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Talent.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06036\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Talent.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "447a08", "Grid": true, "GridProjection": false, @@ -104349,7 +105178,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07032\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced. Cursed.\",\r\n \"wildIcons\": 4,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07032\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Practiced. Cursed.\",\n \"wildIcons\": 4,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "d8b64b", "Grid": true, "GridProjection": false, @@ -104410,7 +105239,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07015\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Tool.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07015\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tool.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "4f11a2", "Grid": true, "GridProjection": false, @@ -104472,7 +105301,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04312\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Improvised.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04312\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Improvised.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9591ac", "Grid": true, "GridProjection": false, @@ -104533,7 +105362,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60331\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60331\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "91da6b", "Grid": true, "GridProjection": false, @@ -104595,7 +105424,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02148\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02148\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "cd7b97", "Grid": true, "GridProjection": false, @@ -104656,7 +105485,7 @@ }, "Description": "Acquisitions and Solicitation", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03149\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Patron.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03149\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Patron.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "4a2a36", "Grid": true, "GridProjection": false, @@ -104718,7 +105547,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60412\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60412\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Clothing.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "d9292f", "Grid": true, "GridProjection": false, @@ -104780,7 +105609,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07226\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07226\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Spell. Cursed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "32e5a4", "Grid": true, "GridProjection": false, @@ -104842,7 +105671,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05024\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b9bb2a", "Grid": true, "GridProjection": false, @@ -104904,7 +105733,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90019\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Spell.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90019\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Spell.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "580a4d", "Grid": true, "GridProjection": false, @@ -104965,7 +105794,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01091\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01091\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"combatIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "5ab9f4", "Grid": true, "GridProjection": false, @@ -105026,7 +105855,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05323\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05323\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "1a90a4", "Grid": true, "GridProjection": false, @@ -105087,7 +105916,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60122\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60122\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spirit. Tactic.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "92436b", "Grid": true, "GridProjection": false, @@ -105148,7 +105977,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06200\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Talent. Illicit.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06200\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Talent. Illicit.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "2aeb8a", "Grid": true, "GridProjection": false, @@ -105210,7 +106039,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60117\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60117\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "22bb1e", "Grid": true, "GridProjection": false, @@ -105271,7 +106100,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60303\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"wildIcons\": 1,\r\n \"negativeIcons\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60303\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"wildIcons\": 1,\n \"negativeIcons\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "b2e5b0", "Grid": true, "GridProjection": false, @@ -105332,7 +106161,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04110\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04110\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "2236f6", "Grid": true, "GridProjection": false, @@ -105393,7 +106222,7 @@ }, "Description": "Mysterious Soothsayer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05283\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Ally. Clairvoyant.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05283\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Ally. Clairvoyant.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "03a4de", "Grid": true, "GridProjection": false, @@ -105455,7 +106284,7 @@ }, "Description": "Seeker", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05188\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05188\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0b12ac", "Grid": true, "GridProjection": false, @@ -105464,7 +106293,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -105517,7 +106346,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60328\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60328\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e503ce", "Grid": true, "GridProjection": false, @@ -105578,7 +106407,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07023\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "b176fc", "Grid": true, "GridProjection": false, @@ -105639,7 +106468,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07229\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Ritual. Blessed. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07229\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Ritual. Blessed. Cursed.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e5901b", "Grid": true, "GridProjection": false, @@ -105701,7 +106530,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03111\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Talent. Composure.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03111\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Talent. Composure.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5fe780", "Grid": true, "GridProjection": false, @@ -105763,7 +106592,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03017\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Monster. Ghoul.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03017\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Monster. Ghoul.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "80b7c6", "Grid": true, "GridProjection": false, @@ -105824,7 +106653,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06160\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Fated.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06160\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Tactic. Fated.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d3dcf1", "Grid": true, "GridProjection": false, @@ -105885,7 +106714,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06011\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "1186a1", "Grid": true, "GridProjection": false, @@ -105947,7 +106776,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02029\",\r\n \"alternate_ids\": [\r\n \"60405\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02029\",\n \"alternate_ids\": [\n \"60405\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "0a4db3", "Grid": true, "GridProjection": false, @@ -106009,7 +106838,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04104\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04104\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "6a9021", "Grid": true, "GridProjection": false, @@ -106070,7 +106899,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06165\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06165\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "7651f3", "Grid": true, "GridProjection": false, @@ -106131,7 +106960,7 @@ }, "Description": "Gift of the Homunculi", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02269\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02269\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "6bae15", "Grid": true, "GridProjection": false, @@ -106193,7 +107022,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06282\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Summon.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06283\"\r\n }\r\n ],\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06282\",\n \"type\": \"Asset\",\n \"slot\": \"Ally|Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Ally. Summon.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06283\"\n }\n ],\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ab4fb3", "Grid": true, "GridProjection": false, @@ -106255,7 +107084,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53007\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "3d57b4", "Grid": true, "GridProjection": false, @@ -106317,7 +107146,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05234\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Favor. Service.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05234\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Favor. Service.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "2ee50e", "Grid": true, "GridProjection": false, @@ -106378,7 +107207,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02034\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02034\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2c2d9a", "Grid": true, "GridProjection": false, @@ -106439,7 +107268,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02105\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Science.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02105\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Science.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9c46da", "Grid": true, "GridProjection": false, @@ -106500,7 +107329,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60110\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60110\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "8d6ae6", "Grid": true, "GridProjection": false, @@ -106562,7 +107391,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52005\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "26a3bf", "Grid": true, "GridProjection": false, @@ -106624,7 +107453,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60203\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60203\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3eef18", "Grid": true, "GridProjection": false, @@ -106685,7 +107514,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07113\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 2,\r\n \"traits\": \"Covenant. Cursed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07113\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Cursed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "10b087", "Grid": true, "GridProjection": false, @@ -106747,7 +107576,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51002\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "37a2b5", "Grid": true, "GridProjection": false, @@ -106809,7 +107638,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06280\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06280\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b45c82", "Grid": true, "GridProjection": false, @@ -106871,7 +107700,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06029\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06029\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "a33acd", "Grid": true, "GridProjection": false, @@ -106932,7 +107761,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07228\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07228\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell. Cursed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "12bdf1", "Grid": true, "GridProjection": false, @@ -106994,7 +107823,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03271\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Doom\",\r\n \"token\": \"doom\"\r\n },\r\n {\r\n \"count\": 2,\r\n \"type\": \"Horror\",\r\n \"token\": \"horror\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03271\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Ally. Sorcerer.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Doom\",\n \"token\": \"doom\"\n },\n {\n \"count\": 2,\n \"type\": \"Horror\",\n \"token\": \"horror\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "65b30d", "Grid": true, "GridProjection": false, @@ -107056,7 +107885,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02273\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02273\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "523b76", "Grid": true, "GridProjection": false, @@ -107117,7 +107946,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60509\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60509\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ally. Creature.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "59e40d", "Grid": true, "GridProjection": false, @@ -107179,7 +108008,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06235\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06235\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 2,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "80fafa", "Grid": true, "GridProjection": false, @@ -107240,7 +108069,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"82024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Mask.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"82024\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Mask.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "6179d5", "Grid": true, "GridProjection": false, @@ -107302,7 +108131,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02117\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "0c859f", "Grid": true, "GridProjection": false, @@ -107364,7 +108193,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07301\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07301\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e40802", "Grid": true, "GridProjection": false, @@ -107425,7 +108254,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Core\"\n}", "GUID": "79b4af", "Grid": true, "GridProjection": false, @@ -107486,7 +108315,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50003\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50003\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "23c3e5", "Grid": true, "GridProjection": false, @@ -107548,7 +108377,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07019\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Ritual. Blessed.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07019\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Ritual. Blessed.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "974743", "Grid": true, "GridProjection": false, @@ -107557,7 +108386,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/RiteofSanctification\")\nend)\n__bundle_register(\"playercards/cards/RiteofSanctification\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/RiteofSanctification\")\nend)\n__bundle_register(\"playercards/cards/RiteofSanctification\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -107610,7 +108439,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98015\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"wildIcons\": 2,\r\n \"negativeIcons\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98015\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"wildIcons\": 2,\n \"negativeIcons\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "13eaf0", "Grid": true, "GridProjection": false, @@ -107671,7 +108500,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04153\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04153\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "4167c0", "Grid": true, "GridProjection": false, @@ -107732,7 +108561,7 @@ }, "Description": "The Dead Listen", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Instrument. Relic.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02012\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Instrument. Relic.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "03c6a7", "Grid": true, "GridProjection": false, @@ -107794,7 +108623,7 @@ }, "Description": "Big Man on Campus", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02035\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ally. Miskatonic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "e1e098", "Grid": true, "GridProjection": false, @@ -107856,7 +108685,7 @@ }, "Description": "Freezing Variant", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02264\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Science.\",\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02264\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Science.\",\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9afe23", "Grid": true, "GridProjection": false, @@ -107918,7 +108747,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07108\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07108\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "55fc3d", "Grid": true, "GridProjection": false, @@ -107980,7 +108809,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98008\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "67e006", "Grid": true, "GridProjection": false, @@ -108042,7 +108871,7 @@ }, "Description": "Seeing Things Unseen", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02219\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item.\",\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02219\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item.\",\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "f96ed0", "Grid": true, "GridProjection": false, @@ -108104,7 +108933,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06038\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06038\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "406ab2", "Grid": true, "GridProjection": false, @@ -108165,7 +108994,7 @@ }, "Description": "finis omnium nunc est", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04013\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic. Tome. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04013\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic. Tome. Blessed.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "df9809", "Grid": true, "GridProjection": false, @@ -108174,7 +109003,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheCodexofAges\")\nend)\n__bundle_register(\"playercards/cards/TheCodexofAges\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheCodexofAges\")\nend)\n__bundle_register(\"playercards/cards/TheCodexofAges\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -108227,7 +109056,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08034\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08034\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "320bbe", "Grid": true, "GridProjection": false, @@ -108288,7 +109117,7 @@ }, "Description": "Hyperborean Grimoire", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08005\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic. Tome.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "55001f", "Grid": true, "GridProjection": false, @@ -108350,7 +109179,7 @@ }, "Description": "Omen of Misfortune", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07224\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Charm. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07224\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Charm. Cursed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "aae31c", "Grid": true, "GridProjection": false, @@ -108412,7 +109241,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08083\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08083\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian|Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic. Science.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e419b4", "Grid": true, "GridProjection": false, @@ -108474,7 +109303,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08060\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08060\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "331b58", "Grid": true, "GridProjection": false, @@ -108536,7 +109365,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08006\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Omen. Endtimes.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08006\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Omen. Endtimes.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e9fef2", "Grid": true, "GridProjection": false, @@ -108597,7 +109426,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08077\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Synergy.\",\r\n \"wildIcons\": 1,\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08077\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate. Synergy.\",\n \"wildIcons\": 1,\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "4e6d80", "Grid": true, "GridProjection": false, @@ -108658,7 +109487,7 @@ }, "Description": "Experienced Hunter", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"08086\",\n \"type\": \"Asset\",\n \"class\": \"Guardian|Seeker\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Ally. Detective.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", + "GMNotes": "{\n \"id\": \"08086\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian|Seeker\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Ally. Detective.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "573765", "Grid": true, "GridProjection": false, @@ -108720,7 +109549,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08109\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Mystic\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08109\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue|Mystic\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5be76d", "Grid": true, "GridProjection": false, @@ -108782,7 +109611,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08101\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Mystic\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Augury.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08101\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker|Mystic\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Spell. Augury.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "658588", "Grid": true, "GridProjection": false, @@ -108844,7 +109673,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08025\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08025\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5779d3", "Grid": true, "GridProjection": false, @@ -108906,7 +109735,7 @@ }, "Description": "Aspiring Actor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05155\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05155\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Criminal.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "9df9df", "Grid": true, "GridProjection": false, @@ -108968,7 +109797,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98021\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Endtimes.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98021\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Endtimes.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "242a11", "Grid": true, "GridProjection": false, @@ -109029,7 +109858,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60411\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60411\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "6c3156", "Grid": true, "GridProjection": false, @@ -109091,7 +109920,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98014\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Innate. Developed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98014\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Innate. Developed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "9d6e9a", "Grid": true, "GridProjection": false, @@ -109152,7 +109981,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04031\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ritual. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04031\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ritual. Blessed.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "0fd4ae", "Grid": true, "GridProjection": false, @@ -109161,7 +109990,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ProtectiveIncantation1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {}\n\nINVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nUPDATE_ON_HOVER = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ProtectiveIncantation1\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ProtectiveIncantation1\")\nend)\n__bundle_register(\"playercards/cards/ProtectiveIncantation1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {}\n\nINVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nUPDATE_ON_HOVER = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -109214,7 +110043,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"85029\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Science.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"85029\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Science.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "2f1166", "Grid": true, "GridProjection": false, @@ -109276,7 +110105,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05153\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05153\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "1339b0", "Grid": true, "GridProjection": false, @@ -109338,7 +110167,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03238\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03238\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "0edef1", "Grid": true, "GridProjection": false, @@ -109399,7 +110228,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04016\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse. Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04016\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse. Pact.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f93ea8", "Grid": true, "GridProjection": false, @@ -109460,7 +110289,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06037\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06037\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "57e648", "Grid": true, "GridProjection": false, @@ -109521,7 +110350,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52008\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52008\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 2,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "1e9213", "Grid": true, "GridProjection": false, @@ -109582,7 +110411,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03024\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "d6771f", "Grid": true, "GridProjection": false, @@ -109644,7 +110473,7 @@ }, "Description": "Hunter of Rare Books", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60223\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60223\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Ally. Miskatonic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "854c79", "Grid": true, "GridProjection": false, @@ -109706,7 +110535,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60326\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60326\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0feb74", "Grid": true, "GridProjection": false, @@ -109768,7 +110597,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07271\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Pact. Cursed.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07271\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Pact. Cursed.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "542a70", "Grid": true, "GridProjection": false, @@ -109777,7 +110606,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FavoroftheMoon1\")\nend)\n__bundle_register(\"playercards/cards/FavoroftheMoon1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FavoroftheMoon1\")\nend)\n__bundle_register(\"playercards/cards/FavoroftheMoon1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -109830,7 +110659,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07158\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Pact.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07158\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell. Pact.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "fc709b", "Grid": true, "GridProjection": false, @@ -109892,7 +110721,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03306\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03306\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "814ce2", "Grid": true, "GridProjection": false, @@ -109953,7 +110782,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60129\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60129\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "14dcc4", "Grid": true, "GridProjection": false, @@ -110014,7 +110843,7 @@ }, "Description": "Knows Too Much", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07083\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Agency. Detective.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07083\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Agency. Detective.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "7e2896", "Grid": true, "GridProjection": false, @@ -110076,7 +110905,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03196\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03196\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "edd34a", "Grid": true, "GridProjection": false, @@ -110137,7 +110966,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60403\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Omen. Endtimes.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60403\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Omen. Endtimes.\",\n \"weakness\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3aa40e", "Grid": true, "GridProjection": false, @@ -110198,7 +111027,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05114\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05114\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "a57f19", "Grid": true, "GridProjection": false, @@ -110260,7 +111089,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07152\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07152\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "0dc75e", "Grid": true, "GridProjection": false, @@ -110322,7 +111151,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60504\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60504\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a3bc7a", "Grid": true, "GridProjection": false, @@ -110383,7 +111212,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03014\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03014\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a33470", "Grid": true, "GridProjection": false, @@ -110445,7 +111274,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60522\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60522\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f8a977", "Grid": true, "GridProjection": false, @@ -110507,7 +111336,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03019\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03019\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "367aac", "Grid": true, "GridProjection": false, @@ -110568,7 +111397,7 @@ }, "Description": "Dark Revelations", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98020\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Artist.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98020\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Artist.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "782e0a", "Grid": true, "GridProjection": false, @@ -110630,7 +111459,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07264\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07264\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 2,\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "78adda", "Grid": true, "GridProjection": false, @@ -110692,7 +111521,7 @@ }, "Description": "Red Tape", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90026\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90026\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "706176", "Grid": true, "GridProjection": false, @@ -110754,7 +111583,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05116\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05116\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker|Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "230835", "Grid": true, "GridProjection": false, @@ -110763,7 +111592,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -110816,7 +111645,7 @@ }, "Description": "Huntress of Bast", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07262\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Ally. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07262\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Ally. Blessed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "5659d1", "Grid": true, "GridProjection": false, @@ -110825,7 +111654,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/Nephthys4\")\nend)\n__bundle_register(\"playercards/cards/Nephthys4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_MULTI_RELEASE = 3\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/Nephthys4\")\nend)\n__bundle_register(\"playercards/cards/Nephthys4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_MULTI_RELEASE = 3\nSHOW_MULTI_RETURN = 3\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -110878,7 +111707,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05229\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05229\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic. Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "ec38db", "Grid": true, "GridProjection": false, @@ -110939,7 +111768,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03007\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Practiced. Expert.\",\r\n \"combatIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03007\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Practiced. Expert.\",\n \"combatIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "b80459", "Grid": true, "GridProjection": false, @@ -111000,7 +111829,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"agilityIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02010\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Neutral\",\n \"traits\": \"Item. Weapon. Firearm.\",\n \"agilityIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d87128", "Grid": true, "GridProjection": false, @@ -111062,7 +111891,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07033\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07033\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "2ea0d0", "Grid": true, "GridProjection": false, @@ -111124,7 +111953,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04029\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04029\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "5558f1", "Grid": true, "GridProjection": false, @@ -111186,7 +112015,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02022\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02022\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Tactic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d4fd4a", "Grid": true, "GridProjection": false, @@ -111247,7 +112076,7 @@ }, "Description": "Chained to the Waking World", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06079\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Dreamer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06079\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Dreamer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d253a6", "Grid": true, "GridProjection": false, @@ -111309,7 +112138,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05314\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05314\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "53f076", "Grid": true, "GridProjection": false, @@ -111370,7 +112199,7 @@ }, "Description": "Petrus de Dacia Translation", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60233\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 5,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60233\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 5,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "96ba38", "Grid": true, "GridProjection": false, @@ -111432,7 +112261,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60530\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 4,\r\n \"traits\": \"Condition.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60530\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"level\": 4,\n \"traits\": \"Condition.\",\n \"permanent\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3bbc0b", "Grid": true, "GridProjection": false, @@ -111494,7 +112323,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07038\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Cultist. Cursed.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07038\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Cultist. Cursed.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "ef91a9", "Grid": true, "GridProjection": false, @@ -111555,7 +112384,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05112\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ritual. Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05112\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ritual. Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "05d263", "Grid": true, "GridProjection": false, @@ -111617,7 +112446,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07118\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 5,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07118\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 5,\n \"level\": 0,\n \"traits\": \"Spell. Cursed.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9a5782", "Grid": true, "GridProjection": false, @@ -111679,7 +112508,7 @@ }, "Description": "Artifact from Another Life (Advanced)", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90018\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90018\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Standalone\"\n}", "GUID": "bf151d", "Grid": true, "GridProjection": false, @@ -111741,7 +112570,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07196\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07196\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "45386d", "Grid": true, "GridProjection": false, @@ -111750,7 +112579,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/Unrelenting1\")\nend)\n__bundle_register(\"playercards/cards/Unrelenting1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {}\nINVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nUPDATE_ON_HOVER = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/Unrelenting1\")\nend)\n__bundle_register(\"playercards/cards/Unrelenting1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {}\nINVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nUPDATE_ON_HOVER = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -111802,7 +112631,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53009\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53009\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "9e4e11", "Grid": true, "GridProjection": false, @@ -111863,7 +112692,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"82023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Mask.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"82023\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Mask.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "9c9196", "Grid": true, "GridProjection": false, @@ -111925,7 +112754,7 @@ }, "Description": "Curse.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"81029\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"81029\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "2e33f7", "Grid": true, "GridProjection": false, @@ -111986,7 +112815,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02270\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02270\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "3f3488", "Grid": true, "GridProjection": false, @@ -112047,7 +112876,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05237\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Fortune. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05237\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Fortune. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "e674e8", "Grid": true, "GridProjection": false, @@ -112108,7 +112937,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02299\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02299\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 2,\n \"traits\": \"Practiced. Expert.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d2e026", "Grid": true, "GridProjection": false, @@ -112169,7 +112998,7 @@ }, "Description": "Text of the Elder Guardian", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"07192\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Tome. Blessed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", + "GMNotes": "{\n \"id\": \"07192\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Tome. Blessed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "416f12", "Grid": true, "GridProjection": false, @@ -112231,7 +113060,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03108\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03108\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a8e495", "Grid": true, "GridProjection": false, @@ -112292,7 +113121,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06025\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06025\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "aec357", "Grid": true, "GridProjection": false, @@ -112353,7 +113182,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04199\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Augury.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04199\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Augury.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "e470cd", "Grid": true, "GridProjection": false, @@ -112414,7 +113243,7 @@ }, "Description": "Unscrupulous Investor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03151\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Patron.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03151\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Patron.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5ec1a2", "Grid": true, "GridProjection": false, @@ -112476,7 +113305,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06164\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06164\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "db90e2", "Grid": true, "GridProjection": false, @@ -112537,7 +113366,7 @@ }, "Description": "Untranslated", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06112\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome. Charm.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06113\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06112\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome. Charm.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06113\"\n }\n ],\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b81dcf", "Grid": true, "GridProjection": false, @@ -112599,7 +113428,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02189\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02189\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d7dbac", "Grid": true, "GridProjection": false, @@ -112661,7 +113490,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04159\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Try\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04159\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Try\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "3dc82f", "Grid": true, "GridProjection": false, @@ -112723,7 +113552,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02007\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02007\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "58f534", "Grid": true, "GridProjection": false, @@ -112845,7 +113674,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tool. Weapon. Melee.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52010\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 2,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "96a440", "Grid": true, "GridProjection": false, @@ -112907,7 +113736,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53014\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53014\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "39452d", "Grid": true, "GridProjection": false, @@ -112968,7 +113797,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60416\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60416\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0988b2", "Grid": true, "GridProjection": false, @@ -113029,7 +113858,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07261\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell. Upgrade.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07261\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell. Upgrade.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "33455f", "Grid": true, "GridProjection": false, @@ -113090,7 +113919,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03195\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent. Illicit.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03195\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent. Illicit.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "2f4db2", "Grid": true, "GridProjection": false, @@ -113152,7 +113981,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06327\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06327\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "4f5f0f", "Grid": true, "GridProjection": false, @@ -113214,7 +114043,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02154\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02154\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "b3ce16", "Grid": true, "GridProjection": false, @@ -113276,7 +114105,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02013\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Endtimes.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02013\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Endtimes.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2c901b", "Grid": true, "GridProjection": false, @@ -113337,7 +114166,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03270\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03270\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell. Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "4d74f6", "Grid": true, "GridProjection": false, @@ -113398,7 +114227,7 @@ }, "Description": "Smarter Than He Lets On", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02218\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Dunwich.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02218\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Dunwich.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "f14dce", "Grid": true, "GridProjection": false, @@ -113460,7 +114289,7 @@ }, "Description": "Book of Books", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60206\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60206\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "d287bc", "Grid": true, "GridProjection": false, @@ -113522,7 +114351,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60324\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60324\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "4a45c6", "Grid": true, "GridProjection": false, @@ -113583,7 +114412,7 @@ }, "Description": "Poision.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04102\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Poison.\",\r\n \"permanent\": true,\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04102\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Poison.\",\n \"permanent\": true,\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "819f52", "Grid": true, "GridProjection": false, @@ -113644,7 +114473,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05037\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Gambit.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05037\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Tactic. Gambit.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0bea17", "Grid": true, "GridProjection": false, @@ -113705,7 +114534,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07035\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Blessed.\",\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07035\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Fortune. Blessed.\",\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "ec7702", "Grid": true, "GridProjection": false, @@ -113766,7 +114595,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02027\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ally. Criminal.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "cdd6aa", "Grid": true, "GridProjection": false, @@ -113828,7 +114657,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07310\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Fortune. Blessed. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Offering\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07310\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Fortune. Blessed. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "1934c6", "Grid": true, "GridProjection": false, @@ -113889,7 +114718,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60506\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60506\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "1d75d0", "Grid": true, "GridProjection": false, @@ -113951,7 +114780,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04037\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04037\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f59085", "Grid": true, "GridProjection": false, @@ -114013,7 +114842,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60404\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60404\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "fc4168", "Grid": true, "GridProjection": false, @@ -114074,7 +114903,7 @@ }, "Description": "Muckraker", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06162\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Criminal. Dreamer.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 9,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06162\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Criminal. Dreamer.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 9,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "90bf93", "Grid": true, "GridProjection": false, @@ -114136,7 +114965,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06325\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 5,\r\n \"traits\": \"Spell. Practiced.\",\r\n \"wildIcons\": 4,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06325\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 5,\n \"traits\": \"Spell. Practiced.\",\n \"wildIcons\": 4,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d6085d", "Grid": true, "GridProjection": false, @@ -114197,7 +115026,7 @@ }, "Description": "Seeker", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05194\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05194\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Charm. Cursed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "1433eb", "Grid": true, "GridProjection": false, @@ -114259,7 +115088,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06323\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06323\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "26922c", "Grid": true, "GridProjection": false, @@ -114321,7 +115150,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53003\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 3,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53003\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 3,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "45cd73", "Grid": true, "GridProjection": false, @@ -114382,7 +115211,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06198\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 10,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06198\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 10,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "3dc25c", "Grid": true, "GridProjection": false, @@ -114443,7 +115272,7 @@ }, "Description": "Abandoned by the Gods", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06276\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Relic. Blessed.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06277\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06276\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Relic. Blessed.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06277\"\n }\n ],\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "c0d236", "Grid": true, "GridProjection": false, @@ -114505,7 +115334,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04108\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Connection. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04108\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Connection. Illicit.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "2423e7", "Grid": true, "GridProjection": false, @@ -114567,7 +115396,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06117\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06117\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "75eca5", "Grid": true, "GridProjection": false, @@ -114628,7 +115457,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07162\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07162\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "5606b3", "Grid": true, "GridProjection": false, @@ -114689,7 +115518,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60402\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60402\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "4fbdb2", "Grid": true, "GridProjection": false, @@ -114751,7 +115580,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Research.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06023\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Research.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "7686cb", "Grid": true, "GridProjection": false, @@ -114812,7 +115641,7 @@ }, "Description": "Speaker to the Dead", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02232\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02232\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Sorcerer.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "53867b", "Grid": true, "GridProjection": false, @@ -114874,7 +115703,7 @@ }, "Description": "Rogue", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05187\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 5,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05187\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Rogue\",\n \"cost\": 5,\n \"level\": 3,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d4dbc7", "Grid": true, "GridProjection": false, @@ -114936,7 +115765,7 @@ }, "Description": "Stygian Waymark", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53008\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Relic. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "a775ad", "Grid": true, "GridProjection": false, @@ -114945,7 +115774,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheChthonianStone3\")\nend)\n__bundle_register(\"playercards/cards/TheChthonianStone3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheChthonianStone3\")\nend)\n__bundle_register(\"playercards/cards/TheChthonianStone3\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -114998,7 +115827,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90009\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90009\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Standalone\"\n}", "GUID": "9c4900", "Grid": true, "GridProjection": false, @@ -115059,7 +115888,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse. Flora.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53012\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse. Flora.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "121b2d", "Grid": true, "GridProjection": false, @@ -115121,7 +115950,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03263\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03263\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a13ca4", "Grid": true, "GridProjection": false, @@ -115182,7 +116011,7 @@ }, "Description": "Signature", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01008\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "96c9be", "Grid": true, "GridProjection": false, @@ -115244,7 +116073,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07028\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Pact. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07028\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Pact. Cursed.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "17d34b", "Grid": true, "GridProjection": false, @@ -115305,7 +116134,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03035\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "90a106", "Grid": true, "GridProjection": false, @@ -115367,7 +116196,7 @@ }, "Description": "Professor of Archaeology", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02080\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02080\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Miskatonic.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "f03306", "Grid": true, "GridProjection": false, @@ -115429,7 +116258,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"81030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Talent.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"81030\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Talent.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "a49751", "Grid": true, "GridProjection": false, @@ -115491,7 +116320,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03154\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03154\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "35166c", "Grid": true, "GridProjection": false, @@ -115553,7 +116382,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60131\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60131\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "ab51ce", "Grid": true, "GridProjection": false, @@ -115615,7 +116444,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02114\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02114\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Tool. Melee.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "8a4673", "Grid": true, "GridProjection": false, @@ -115677,7 +116506,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02115\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02115\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Tactic.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "017821", "Grid": true, "GridProjection": false, @@ -115738,7 +116567,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05322\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05322\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "060943", "Grid": true, "GridProjection": false, @@ -115800,7 +116629,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05233\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Connection.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05233\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Connection.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b65011", "Grid": true, "GridProjection": false, @@ -115862,7 +116691,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07189\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Ritual. Armor.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07189\",\n \"type\": \"Asset\",\n \"slot\": \"Body|Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Ritual. Armor.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9509e3", "Grid": true, "GridProjection": false, @@ -115924,7 +116753,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07160\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Paradox. Blessed. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07160\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Paradox. Blessed. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "22fc6c", "Grid": true, "GridProjection": false, @@ -115985,7 +116814,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02190\",\r\n \"alternate_ids\": [\r\n \"60418\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02190\",\n \"alternate_ids\": [\n \"60418\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "59b24f", "Grid": true, "GridProjection": false, @@ -116046,7 +116875,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60226\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60226\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "9b1c5b", "Grid": true, "GridProjection": false, @@ -116107,7 +116936,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07121\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07121\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "4e2d75", "Grid": true, "GridProjection": false, @@ -116169,7 +116998,7 @@ }, "Description": "Madness. Paradox.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04264\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Paradox.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04264\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Paradox.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "d64b8f", "Grid": true, "GridProjection": false, @@ -116230,7 +117059,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02309\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02309\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "f1b0f9", "Grid": true, "GridProjection": false, @@ -116292,7 +117121,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06234\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06234\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "93381d", "Grid": true, "GridProjection": false, @@ -116353,7 +117182,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07027\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "5ec6d0", "Grid": true, "GridProjection": false, @@ -116415,7 +117244,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04027\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04027\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight. Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "256da2", "Grid": true, "GridProjection": false, @@ -116476,7 +117305,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03113\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Talent. Composure.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03113\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Talent. Composure.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "98fc57", "Grid": true, "GridProjection": false, @@ -116538,7 +117367,7 @@ }, "Description": "Wrong Place, Wrong Time", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06118\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Wayfarer. Cursed.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Damage\",\r\n \"token\": \"damage\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06118\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Ally. Wayfarer. Cursed.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Damage\",\n \"token\": \"damage\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b8380d", "Grid": true, "GridProjection": false, @@ -116600,7 +117429,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03314\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03314\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "c803ba", "Grid": true, "GridProjection": false, @@ -116661,7 +117490,7 @@ }, "Description": "Custom Marlin Model 1894", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06006\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "587589", "Grid": true, "GridProjection": false, @@ -116723,7 +117552,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04033\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Improvised.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04033\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Improvised.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "30f90b", "Grid": true, "GridProjection": false, @@ -116784,7 +117613,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06026\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06026\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "cdbb37", "Grid": true, "GridProjection": false, @@ -116845,7 +117674,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51008\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "a53344", "Grid": true, "GridProjection": false, @@ -116907,7 +117736,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07018\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee. Blessed.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07018\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee. Blessed.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "cf4571", "Grid": true, "GridProjection": false, @@ -116969,7 +117798,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60209\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60209\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a614de", "Grid": true, "GridProjection": false, @@ -117031,7 +117860,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"startsInPlay\": true,\r\n \"traits\": \"Job.\",\r\n \"permanent\": true,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Bounty\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06010\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Job.\",\n \"permanent\": true,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Bounty\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "4d9b32", "Grid": true, "GridProjection": false, @@ -117093,7 +117922,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07025\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07025\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "a5087b", "Grid": true, "GridProjection": false, @@ -117155,7 +117984,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01074\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01074\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "48e103", "Grid": true, "GridProjection": false, @@ -117217,7 +118046,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03305\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Item. Armor. Relic.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03305\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Item. Armor. Relic.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "f7a9ab", "Grid": true, "GridProjection": false, @@ -117279,7 +118108,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05230\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Upgrade.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05230\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Upgrade.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "db2c81", "Grid": true, "GridProjection": false, @@ -117340,7 +118169,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60330\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 3,\r\n \"traits\": \"Gambit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60330\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 3,\n \"traits\": \"Gambit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "de40c8", "Grid": true, "GridProjection": false, @@ -117401,7 +118230,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60221\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60221\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "6e4d54", "Grid": true, "GridProjection": false, @@ -117462,7 +118291,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05159\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05159\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "6d9881", "Grid": true, "GridProjection": false, @@ -117524,7 +118353,7 @@ }, "Description": "Madness.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02178\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02178\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "fb943f", "Grid": true, "GridProjection": false, @@ -117585,7 +118414,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06245\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Blessed. Fortune.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06245\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Blessed. Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "f21109", "Grid": true, "GridProjection": false, @@ -117646,7 +118475,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05008\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05008\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Horror\",\n \"token\": \"horror\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "1c7a00", "Grid": true, "GridProjection": false, @@ -117707,7 +118536,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03155\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03155\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "00af4f", "Grid": true, "GridProjection": false, @@ -117768,7 +118597,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60431\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60431\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e21200", "Grid": true, "GridProjection": false, @@ -117830,7 +118659,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60503\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60503\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e628de", "Grid": true, "GridProjection": false, @@ -117891,7 +118720,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05316\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome. Occult.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 3,\r\n \"id\": \"05317\"\r\n }\r\n ],\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05316\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome. Occult.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"05317\"\n }\n ],\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "5d6728", "Grid": true, "GridProjection": false, @@ -117953,7 +118782,7 @@ }, "Description": "Ruthless Tactician", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51052\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 5,\r\n \"traits\": \"Ally. Criminal. Syndicate.\",\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51052\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 5,\n \"traits\": \"Ally. Criminal. Syndicate.\",\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "7f7ecc", "Grid": true, "GridProjection": false, @@ -118015,7 +118844,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60123\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60123\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "415ca2", "Grid": true, "GridProjection": false, @@ -118076,7 +118905,7 @@ }, "Description": "Feisty Mechanic", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60309\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60309\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally.\",\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "ad0ef0", "Grid": true, "GridProjection": false, @@ -118138,7 +118967,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04156\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04156\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "ce1b89", "Grid": true, "GridProjection": false, @@ -118200,7 +119029,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05020\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Insight.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05020\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic. Insight.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "c70ad8", "Grid": true, "GridProjection": false, @@ -118261,7 +119090,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06203\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Dreamlands.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06203\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic. Dreamlands.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "0d006f", "Grid": true, "GridProjection": false, @@ -118323,7 +119152,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51009\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51009\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "70772b", "Grid": true, "GridProjection": false, @@ -118384,7 +119213,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07195\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Ritual. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07195\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Ritual. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3199f2", "Grid": true, "GridProjection": false, @@ -118446,7 +119275,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60511\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60511\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "c8505c", "Grid": true, "GridProjection": false, @@ -118508,7 +119337,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04036\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Gambit.\",\r\n \"wildIcons\": 5,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04036\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Gambit.\",\n \"wildIcons\": 5,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "1fe462", "Grid": true, "GridProjection": false, @@ -118569,7 +119398,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07039\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07039\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "c54d7e", "Grid": true, "GridProjection": false, @@ -118630,7 +119459,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02023\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "f69e10", "Grid": true, "GridProjection": false, @@ -118691,7 +119520,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03032\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "54832d", "Grid": true, "GridProjection": false, @@ -118753,7 +119582,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Occult. Blessed.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 3,\r\n \"id\": \"05314\"\r\n }\r\n ],\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54002\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Relic. Occult. Blessed.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"05314\"\n }\n ],\n \"willpowerIcons\": 2,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "78858f", "Grid": true, "GridProjection": false, @@ -118815,7 +119644,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Tome.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03011\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"traits\": \"Tome.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "016b72", "Grid": true, "GridProjection": false, @@ -118877,7 +119706,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06110\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06110\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "0bb3da", "Grid": true, "GridProjection": false, @@ -118938,7 +119767,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60224\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60224\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "870bdc", "Grid": true, "GridProjection": false, @@ -118999,7 +119828,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07011\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Cultist.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07011\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Cultist.\",\n \"weakness\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9be144", "Grid": true, "GridProjection": false, @@ -119060,7 +119889,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90002\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Standalone\"\n}", "GUID": "cf41be", "Grid": true, "GridProjection": false, @@ -119122,7 +119951,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60208\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60208\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "dbb0e0", "Grid": true, "GridProjection": false, @@ -119184,7 +120013,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05109\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05109\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "a3f105", "Grid": true, "GridProjection": false, @@ -119246,7 +120075,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03272\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03272\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "d1d7fa", "Grid": true, "GridProjection": false, @@ -119307,7 +120136,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01023\",\r\n \"alternate_ids\": [\r\n \"60113\",\r\n \"01523\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01023\",\n \"alternate_ids\": [\n \"60113\",\n \"01523\"\n ],\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "e0dff3", "Grid": true, "GridProjection": false, @@ -119368,7 +120197,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05010\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Insight. Mystery.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05010\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Insight. Mystery.\",\n \"weakness\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "22d886", "Grid": true, "GridProjection": false, @@ -119429,7 +120258,7 @@ }, "Description": "The Exotic Morgana", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98017\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Assistant.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98017\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Assistant.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "692ced", "Grid": true, "GridProjection": false, @@ -119491,7 +120320,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04006\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Wayfarer.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f91fd9", "Grid": true, "GridProjection": false, @@ -119553,7 +120382,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05041\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Omen.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05041\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Omen.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "c1ce8e", "Grid": true, "GridProjection": false, @@ -119614,7 +120443,7 @@ }, "Description": "Spell.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05177\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Spell.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05177\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Spell.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "863f1a", "Grid": true, "GridProjection": false, @@ -119676,7 +120505,7 @@ }, "Description": "In Way Over His Head", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05259\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Assistant.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05259\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Assistant.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d99735", "Grid": true, "GridProjection": false, @@ -119738,7 +120567,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"02226\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", + "GMNotes": "{\n \"id\": \"02226\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "a7944d", "Grid": true, "GridProjection": false, @@ -119800,7 +120629,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60512\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60512\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "dc4a2c", "Grid": true, "GridProjection": false, @@ -119861,7 +120690,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53001\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53001\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Spell. Spirit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "5efc92", "Grid": true, "GridProjection": false, @@ -119922,7 +120751,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06007\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Blunder. Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06007\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Blunder. Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "e567ff", "Grid": true, "GridProjection": false, @@ -119983,7 +120812,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60428\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60428\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "ca23d4", "Grid": true, "GridProjection": false, @@ -120045,7 +120874,7 @@ }, "Description": "What��‚��s in the Box?", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05196\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"countPerInvestigator\": 1,\r\n \"type\": \"Lock\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05196\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"countPerInvestigator\": 1,\n \"type\": \"Lock\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0e39c2", "Grid": true, "GridProjection": false, @@ -120107,7 +120936,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07263\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 10,\r\n \"level\": 3,\r\n \"traits\": \"Insight. Cursed.\",\r\n \"willpowerIcons\": 3,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07263\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 10,\n \"level\": 3,\n \"traits\": \"Insight. Cursed.\",\n \"willpowerIcons\": 3,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "c4ae95", "Grid": true, "GridProjection": false, @@ -120168,7 +120997,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06199\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Fortune. Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06199\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Fortune. Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "30062e", "Grid": true, "GridProjection": false, @@ -120229,7 +121058,7 @@ }, "Description": "Humanoid. Elite.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03059\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Elite.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03059\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Elite.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "6720ef", "Grid": true, "GridProjection": false, @@ -120290,7 +121119,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60215\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60215\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "ff2776", "Grid": true, "GridProjection": false, @@ -120351,7 +121180,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06012\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Monster. Deep One.\",\r\n \"weakness\": true,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Doom\",\r\n \"token\": \"doom\"\r\n },\r\n {\r\n \"count\": 1,\r\n \"type\": \"Bounty\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06012\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Monster. Deep One.\",\n \"weakness\": true,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Doom\",\n \"token\": \"doom\"\n },\n {\n \"count\": 1,\n \"type\": \"Bounty\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d6f8d1", "Grid": true, "GridProjection": false, @@ -120412,7 +121241,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60425\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60425\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "c5fb42", "Grid": true, "GridProjection": false, @@ -120474,7 +121303,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54014\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse. Omen.\",\r\n \"permanent\": true,\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54014\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse. Omen.\",\n \"permanent\": true,\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "bad8cb", "Grid": true, "GridProjection": false, @@ -120535,7 +121364,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07120\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 2,\r\n \"traits\": \"Covenant. Blessed. Cursed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07120\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Blessed. Cursed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "541ee9", "Grid": true, "GridProjection": false, @@ -120597,7 +121426,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03229\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Spirit. Bold.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03229\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Spirit. Bold.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "c55160", "Grid": true, "GridProjection": false, @@ -120658,7 +121487,7 @@ }, "Description": "Let the Storm Rage", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03315\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03315\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1c98ff", "Grid": true, "GridProjection": false, @@ -120720,7 +121549,7 @@ }, "Description": "Item. Weapon. Relic. Melee.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"83057\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Item. Weapon. Relic. Melee.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"83057\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Item. Weapon. Relic. Melee.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "dc674e", "Grid": true, "GridProjection": false, @@ -120782,7 +121611,7 @@ }, "Description": "Mind-Expanding Ideas", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04307\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 5,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04307\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 5,\n \"level\": 5,\n \"traits\": \"Item. Relic. Tome.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "344d98", "Grid": true, "GridProjection": false, @@ -120844,7 +121673,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50002\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50002\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "e35bc2", "Grid": true, "GridProjection": false, @@ -120905,7 +121734,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Charm.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54012\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Charm.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "72deff", "Grid": true, "GridProjection": false, @@ -120967,7 +121796,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06116\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06116\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "0d926f", "Grid": true, "GridProjection": false, @@ -121029,7 +121858,7 @@ }, "Description": "Pure of Spirit", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02106\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 1,\r\n \"traits\": \"Ally. \",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02106\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 1,\n \"traits\": \"Ally. \",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "3c9617", "Grid": true, "GridProjection": false, @@ -121091,7 +121920,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06161\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Tactic. Trick.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06161\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Tactic. Trick.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "2cfa4f", "Grid": true, "GridProjection": false, @@ -121152,7 +121981,7 @@ }, "Description": "Syndicate Assassin", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06281\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Criminal. Syndicate.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06281\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Criminal. Syndicate.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "97a795", "Grid": true, "GridProjection": false, @@ -121214,7 +122043,7 @@ }, "Description": "Rogue", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05190\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05190\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Illicit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b5e5f1", "Grid": true, "GridProjection": false, @@ -121276,7 +122105,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04042\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04042\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "6cbc01", "Grid": true, "GridProjection": false, @@ -121337,7 +122166,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02011\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02011\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "426d28", "Grid": true, "GridProjection": false, @@ -121398,7 +122227,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04112\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04112\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "58c435", "Grid": true, "GridProjection": false, @@ -121459,7 +122288,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06204\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Developed.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06204\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate. Developed.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "4d9a97", "Grid": true, "GridProjection": false, @@ -121520,7 +122349,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03022\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03022\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "36c0cb", "Grid": true, "GridProjection": false, @@ -121581,7 +122410,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02147\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02147\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "82775a", "Grid": true, "GridProjection": false, @@ -121643,7 +122472,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60306\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60306\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f32343", "Grid": true, "GridProjection": false, @@ -121705,7 +122534,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01049\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01049\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "68744b", "Grid": true, "GridProjection": false, @@ -121767,7 +122596,7 @@ }, "Description": "Tough Old Bird", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60508\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60508\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "1cccfe", "Grid": true, "GridProjection": false, @@ -121829,7 +122658,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02016\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02016\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "097dcc", "Grid": true, "GridProjection": false, @@ -121891,7 +122720,7 @@ }, "Description": "... Or Are They?", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02230\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02230\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "07b163", "Grid": true, "GridProjection": false, @@ -121953,7 +122782,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60232\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 4,\r\n \"traits\": \"Grant.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60232\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"level\": 4,\n \"traits\": \"Grant.\",\n \"permanent\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "1a1b58", "Grid": true, "GridProjection": false, @@ -122015,7 +122844,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07008\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07008\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "c5d8a9", "Grid": true, "GridProjection": false, @@ -122076,7 +122905,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05319\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Favor. Gambit.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05319\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Favor. Gambit.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d27d12", "Grid": true, "GridProjection": false, @@ -122137,7 +122966,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60520\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60520\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "5a2b49", "Grid": true, "GridProjection": false, @@ -122199,7 +123028,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07024\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07024\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "96fd5d", "Grid": true, "GridProjection": false, @@ -122260,7 +123089,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60204\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60204\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a2e7d7", "Grid": true, "GridProjection": false, @@ -122321,7 +123150,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05034\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05034\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "493b03", "Grid": true, "GridProjection": false, @@ -122382,7 +123211,7 @@ }, "Description": "No-Nonsense Archaeologist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04196\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04196\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Wayfarer.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "8bec05", "Grid": true, "GridProjection": false, @@ -122444,7 +123273,7 @@ }, "Description": "The Forgotten Guardian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04147\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Eztli. Wayfarer.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04147\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Eztli. Wayfarer.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "29fc24", "Grid": true, "GridProjection": false, @@ -122506,7 +123335,7 @@ }, "Description": "Elegant and Elusive", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05227\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Cultist. Silver Twilight.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05227\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Cultist. Silver Twilight.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "83b588", "Grid": true, "GridProjection": false, @@ -122568,7 +123397,7 @@ }, "Description": "Signature", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01013\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Spell.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01013\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Spell.\",\n \"weakness\": true,\n \"cycle\": \"Core\"\n}", "GUID": "c025bf", "Grid": true, "GridProjection": false, @@ -122629,7 +123458,7 @@ }, "Description": "Prophecy Foretold", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03193\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03193\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "3d35aa", "Grid": true, "GridProjection": false, @@ -122691,7 +123520,7 @@ }, "Description": "Worlds within Worlds", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06013\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"startsInPlay\": true,\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06015a\"\r\n }\r\n ],\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06013\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"cost\": 3,\n \"traits\": \"Item. Relic.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06015a\"\n }\n ],\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b8c891", "Grid": true, "GridProjection": false, @@ -122753,7 +123582,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02037\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"permanent\": true,\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02037\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"permanent\": true,\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "b2ef43", "Grid": true, "GridProjection": false, @@ -122814,7 +123643,7 @@ }, "Description": "Survivor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05191\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05191\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Illicit.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "cbe256", "Grid": true, "GridProjection": false, @@ -122876,7 +123705,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60225\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60225\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Insight. Tactic.\",\n \"intellectIcons\": 2,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "344e90", "Grid": true, "GridProjection": false, @@ -122937,7 +123766,7 @@ }, "Description": "Dark Knowledge", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60229\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60229\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Relic. Tome.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2f4507", "Grid": true, "GridProjection": false, @@ -122999,7 +123828,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04306\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04306\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "2f9ab1", "Grid": true, "GridProjection": false, @@ -123060,7 +123889,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60526\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60526\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2f2190", "Grid": true, "GridProjection": false, @@ -123121,7 +123950,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60521\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Item. Armor.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60521\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Item. Armor.\",\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "5b1550", "Grid": true, "GridProjection": false, @@ -123183,7 +124012,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04154\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04154\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "092e92", "Grid": true, "GridProjection": false, @@ -123245,7 +124074,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05236\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Geist.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05236\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ally. Geist.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "9375f4", "Grid": true, "GridProjection": false, @@ -123307,7 +124136,7 @@ }, "Description": "Transient Thoughts", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"53004\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", + "GMNotes": "{\n \"id\": \"53004\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "3289b0", "Grid": true, "GridProjection": false, @@ -123369,7 +124198,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07265\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Pact.\",\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07265\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Pact.\",\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "b7223c", "Grid": true, "GridProjection": false, @@ -123431,7 +124260,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03034\",\r\n \"alternate_ids\": [\r\n \"60413\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03034\",\n \"alternate_ids\": [\n \"60413\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "31d087", "Grid": true, "GridProjection": false, @@ -123492,7 +124321,7 @@ }, "Description": "Assistant Curator", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Assistant.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04021\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Assistant.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "27e7b3", "Grid": true, "GridProjection": false, @@ -123554,7 +124383,7 @@ }, "Description": "Dreams of an Explorer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06236\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome. Charm.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06113\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06236\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tome. Charm.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06113\"\n }\n ],\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "5f9a10", "Grid": true, "GridProjection": false, @@ -123616,7 +124445,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07031\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07031\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "69116c", "Grid": true, "GridProjection": false, @@ -123677,7 +124506,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02038\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Injury.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02038\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Injury.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "4fb446", "Grid": true, "GridProjection": false, @@ -123738,7 +124567,7 @@ }, "Description": "Two Days Until Retirement", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"84008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 5,\r\n \"traits\": \"Ally. Police.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"84008\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 5,\n \"traits\": \"Ally. Police.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "5630c2", "Grid": true, "GridProjection": false, @@ -123800,7 +124629,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07159\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07159\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "a2d392", "Grid": true, "GridProjection": false, @@ -123862,7 +124691,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05157\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05157\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d946d9", "Grid": true, "GridProjection": false, @@ -123924,7 +124753,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53011\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "389a34", "Grid": true, "GridProjection": false, @@ -123986,7 +124815,7 @@ }, "Description": "Sanctum's Reward", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05013\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic. Weapon.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05013\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Relic. Weapon.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "223ba3", "Grid": true, "GridProjection": false, @@ -124048,7 +124877,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02152\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02152\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2fba3b", "Grid": true, "GridProjection": false, @@ -124110,7 +124939,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60432\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60432\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f00301", "Grid": true, "GridProjection": false, @@ -124172,7 +125001,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02188\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02188\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "dc3b07", "Grid": true, "GridProjection": false, @@ -124234,7 +125063,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02008\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02008\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "4156cf", "Grid": true, "GridProjection": false, @@ -124295,7 +125124,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04200\",\r\n \"alternate_ids\": [\r\n \"60516\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04200\",\n \"alternate_ids\": [\n \"60516\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "050ba1", "Grid": true, "GridProjection": false, @@ -124356,7 +125185,7 @@ }, "Description": "Protective Amulet", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60207\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60207\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "d6c44a", "Grid": true, "GridProjection": false, @@ -124418,7 +125247,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05009\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "f4bac6", "Grid": true, "GridProjection": false, @@ -124480,7 +125309,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50007\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "644af9", "Grid": true, "GridProjection": false, @@ -124542,7 +125371,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06027\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Augury.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06028\"\r\n }\r\n ],\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06027\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight. Augury.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06028\"\n }\n ],\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "968a26", "Grid": true, "GridProjection": false, @@ -124603,7 +125432,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04007\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04007\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "275dc3", "Grid": true, "GridProjection": false, @@ -124664,7 +125493,7 @@ }, "Description": "Markings of Isis", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52004\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52004\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "66d5a3", "Grid": true, "GridProjection": false, @@ -124726,7 +125555,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07112\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Cursed.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07112\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight. Cursed.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e99f0d", "Grid": true, "GridProjection": false, @@ -124787,7 +125616,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05156\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Gambit.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05156\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Gambit.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "c2d211", "Grid": true, "GridProjection": false, @@ -124848,7 +125677,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54010\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54010\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 2,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "76978f", "Grid": true, "GridProjection": false, @@ -124909,7 +125738,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06158\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06158\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "df0e22", "Grid": true, "GridProjection": false, @@ -124971,7 +125800,7 @@ }, "Description": "Ally. Government.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"83055\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Government.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"83055\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Government.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "cfb393", "Grid": true, "GridProjection": false, @@ -125033,7 +125862,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03016\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Task.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"victory\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03016\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Task.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"victory\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e6efe6", "Grid": true, "GridProjection": false, @@ -125094,7 +125923,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60426\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60426\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f5d382", "Grid": true, "GridProjection": false, @@ -125156,7 +125985,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05032\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Paradox.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05032\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spell. Paradox.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "8aa0c3", "Grid": true, "GridProjection": false, @@ -125217,7 +126046,7 @@ }, "Description": "Madness. Pact.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03227\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03227\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Pact.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "4f903e", "Grid": true, "GridProjection": false, @@ -125278,7 +126107,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05318\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 5,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 3,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05318\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 5,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 3,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "090fcf", "Grid": true, "GridProjection": false, @@ -125339,7 +126168,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07017\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07017\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tome. Blessed.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "cc1ef3", "Grid": true, "GridProjection": false, @@ -125401,7 +126230,7 @@ }, "Description": "Doom Begets Doom", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53005\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Item. Relic. Cursed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "946a58", "Grid": true, "GridProjection": false, @@ -125463,7 +126292,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06115\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06115\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d753d7", "Grid": true, "GridProjection": false, @@ -125524,7 +126353,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05117\",\n \"type\": \"Asset\",\n \"class\": \"Rogue|Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Illicit.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "be33f5", "Grid": true, "GridProjection": false, @@ -125586,7 +126415,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03041\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact. Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03041\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact. Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "438cca", "Grid": true, "GridProjection": false, @@ -125647,7 +126476,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05320\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05320\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0e0530", "Grid": true, "GridProjection": false, @@ -125709,7 +126538,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98018\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse. Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98018\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse. Pact.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "bd65dc", "Grid": true, "GridProjection": false, @@ -125770,7 +126599,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07010\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"agilityIcons\": 2,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07010\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Tactic.\",\n \"agilityIcons\": 2,\n \"wildIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "2561b9", "Grid": true, "GridProjection": false, @@ -125831,7 +126660,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60220\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60220\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "fab3a9", "Grid": true, "GridProjection": false, @@ -125893,7 +126722,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04233\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Illicit. Fated.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04233\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Illicit. Fated.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9f0b34", "Grid": true, "GridProjection": false, @@ -125954,7 +126783,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04155\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04155\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "857238", "Grid": true, "GridProjection": false, @@ -126015,7 +126844,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60105\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60105\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon.\",\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "db4a43", "Grid": true, "GridProjection": false, @@ -126077,7 +126906,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03148\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03148\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a1fd61", "Grid": true, "GridProjection": false, @@ -126138,7 +126967,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60323\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60323\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0b963c", "Grid": true, "GridProjection": false, @@ -126199,7 +127028,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07272\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Pact. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07272\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Pact. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "1e6a06", "Grid": true, "GridProjection": false, @@ -126208,7 +127037,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FavoroftheSun1\")\nend)\n__bundle_register(\"playercards/cards/FavoroftheSun1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FavoroftheSun1\")\nend)\n__bundle_register(\"playercards/cards/FavoroftheSun1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -126261,7 +127090,7 @@ }, "Description": "A Liar, or a Prophet, or Both", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06285\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 5,\r\n \"traits\": \"Ally. Avatar. Dreamlands.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06285\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 5,\n \"traits\": \"Ally. Avatar. Dreamlands.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "16e57b", "Grid": true, "GridProjection": false, @@ -126323,7 +127152,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03036\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03036\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e66002", "Grid": true, "GridProjection": false, @@ -126385,7 +127214,7 @@ }, "Description": "Forestalling the Future", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04191\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04191\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "7667ef", "Grid": true, "GridProjection": false, @@ -126447,7 +127276,7 @@ }, "Description": "��‚��A Device, of Some Sort", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04061\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04061\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "e27a30", "Grid": true, "GridProjection": false, @@ -126509,7 +127338,7 @@ }, "Description": "My Muse", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06016\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Instrument.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06016\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Instrument.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ea0007", "Grid": true, "GridProjection": false, @@ -126571,7 +127400,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03039\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03039\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "334f03", "Grid": true, "GridProjection": false, @@ -126632,7 +127461,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04160\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04160\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "c6c260", "Grid": true, "GridProjection": false, @@ -126694,7 +127523,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02030\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "8e57b8", "Grid": true, "GridProjection": false, @@ -126756,7 +127585,7 @@ }, "Description": "Olaus Wormius Translation", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02140\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02140\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d45f10", "Grid": true, "GridProjection": false, @@ -126818,7 +127647,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02116\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02116\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "603e29", "Grid": true, "GridProjection": false, @@ -126880,7 +127709,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04234\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04234\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f2877e", "Grid": true, "GridProjection": false, @@ -126941,7 +127770,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Condition.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54006\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Condition.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "170127", "Grid": true, "GridProjection": false, @@ -126950,7 +127779,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/WellConnected\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between both the level 0 and the upgraded level 3 version of the card\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal modValue, loopId\nlocal buttonParameters = {\n click_function = \"toggleCounter\",\n tooltip = \"disable counter\",\n function_owner = self,\n position = { 0.88, 0.5, -1.33 },\n font_size = 150,\n width = 175,\n height = 175\n}\n\nfunction onSave() return JSON.encode({ loopId = loopId }) end\n\nfunction onLoad(savedData)\n -- use metadata to detect level and adjust modValue accordingly\n if JSON.decode(self.getGMNotes()).level == 0 then\n modValue = 5\n else\n modValue = 4\n end\n\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.loopId then\n self.createButton(buttonParameters)\n loopId = Wait.time(updateDisplay, 2, -1)\n end\n end\n\n self.addContextMenuItem(\"Toggle Counter\", toggleCounter)\nend\n\nfunction toggleCounter()\n if loopId ~= nil then\n Wait.stop(loopId)\n loopId = nil\n self.clearButtons()\n else\n self.createButton(buttonParameters)\n updateDisplay()\n loopId = Wait.time(updateDisplay, 2, -1)\n end\nend\n\nfunction updateDisplay()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n local resources = playmatApi.getCounterValue(matColor, \"ResourceCounter\")\n local count = tostring(math.floor(resources / modValue))\n self.editButton({ index = 0, label = count })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/WellConnected\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/WellConnected\")\nend)\n__bundle_register(\"playercards/cards/WellConnected\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between both the level 0 and the upgraded level 3 version of the card\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal modValue, loopId\nlocal buttonParameters = {\n click_function = \"toggleCounter\",\n tooltip = \"disable counter\",\n function_owner = self,\n position = { 0.88, 0.5, -1.33 },\n font_size = 150,\n width = 175,\n height = 175\n}\n\nfunction onSave() return JSON.encode({ loopId = loopId }) end\n\nfunction onLoad(savedData)\n -- use metadata to detect level and adjust modValue accordingly\n if JSON.decode(self.getGMNotes()).level == 0 then\n modValue = 5\n else\n modValue = 4\n end\n\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.loopId then\n self.createButton(buttonParameters)\n loopId = Wait.time(updateDisplay, 2, -1)\n end\n end\n\n self.addContextMenuItem(\"Toggle Counter\", toggleCounter)\nend\n\nfunction toggleCounter()\n if loopId ~= nil then\n Wait.stop(loopId)\n loopId = nil\n self.clearButtons()\n else\n self.createButton(buttonParameters)\n updateDisplay()\n loopId = Wait.time(updateDisplay, 2, -1)\n end\nend\n\nfunction updateDisplay()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n local resources = playmatApi.getCounterValue(matColor, \"ResourceCounter\")\n local count = tostring(math.floor(resources / modValue))\n self.editButton({ index = 0, label = count })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -127003,7 +127832,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07020\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07020\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell. Blessed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "1ad931", "Grid": true, "GridProjection": false, @@ -127064,7 +127893,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60415\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Augury.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60415\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Augury.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "47bdba", "Grid": true, "GridProjection": false, @@ -127125,7 +127954,7 @@ }, "Description": "The Council's Chosen", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07267\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07267\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Sorcerer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9d7d4a", "Grid": true, "GridProjection": false, @@ -127187,7 +128016,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53013\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53013\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "e27c93", "Grid": true, "GridProjection": false, @@ -127248,7 +128077,7 @@ }, "Description": "Guardian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05192\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05192\",\n \"type\": \"Asset\",\n \"slot\": \"Hand|Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "84b918", "Grid": true, "GridProjection": false, @@ -127310,7 +128139,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03037\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03037\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "3fe6de", "Grid": true, "GridProjection": false, @@ -127372,7 +128201,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04038\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04038\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "dd3d09", "Grid": true, "GridProjection": false, @@ -127433,7 +128262,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05119\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor|Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05119\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor|Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "a20887", "Grid": true, "GridProjection": false, @@ -127495,7 +128324,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03038\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03038\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "dd130e", "Grid": true, "GridProjection": false, @@ -127556,7 +128385,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"85031\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Weapon. Science.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"85031\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Weapon. Science.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "2fc31c", "Grid": true, "GridProjection": false, @@ -127618,7 +128447,7 @@ }, "Description": "Devoted Enchantress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54041\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Witch.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54041\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "6abfbc", "Grid": true, "GridProjection": false, @@ -127680,7 +128509,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52012\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"hidden\": true,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52012\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"hidden\": true,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "f6aba5", "Grid": true, "GridProjection": false, @@ -127741,7 +128570,7 @@ }, "Description": "Stygian Waymark", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Cursed.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04030\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic. Cursed.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "fc4ce8", "Grid": true, "GridProjection": false, @@ -127750,7 +128579,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheChthonianStone\")\nend)\n__bundle_register(\"playercards/cards/TheChthonianStone\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/TheChthonianStone\")\nend)\n__bundle_register(\"playercards/cards/TheChthonianStone\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -127803,7 +128632,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06332\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06332\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ff4aea", "Grid": true, "GridProjection": false, @@ -127865,7 +128694,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60305\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60305\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool. Illicit.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "cc11e4", "Grid": true, "GridProjection": false, @@ -127927,7 +128756,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07114\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07114\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "31cfbf", "Grid": true, "GridProjection": false, @@ -127988,7 +128817,7 @@ }, "Description": "The Nightmare is Over", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05260\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Assistant.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05260\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Assistant.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "73bccf", "Grid": true, "GridProjection": false, @@ -128050,7 +128879,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02266\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Trick.\",\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02266\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Trick.\",\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "074858", "Grid": true, "GridProjection": false, @@ -128111,7 +128940,7 @@ }, "Description": "... Or Are They?", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07307\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07307\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "c8bb2a", "Grid": true, "GridProjection": false, @@ -128173,7 +129002,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60116\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60116\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "63b3e5", "Grid": true, "GridProjection": false, @@ -128234,7 +129063,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05158\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05158\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "6eceef", "Grid": true, "GridProjection": false, @@ -128296,7 +129125,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06246\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Developed.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06246\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate. Developed.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ea8324", "Grid": true, "GridProjection": false, @@ -128357,7 +129186,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02228\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02228\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2e93fd", "Grid": true, "GridProjection": false, @@ -128418,7 +129247,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04015\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04015\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "41a9ec", "Grid": true, "GridProjection": false, @@ -128480,7 +129309,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "97781f", "Grid": true, "GridProjection": false, @@ -128541,7 +129370,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04266\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04266\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Spell. Spirit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "53d765", "Grid": true, "GridProjection": false, @@ -128602,7 +129431,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07197\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07197\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Practiced. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "c73bb0", "Grid": true, "GridProjection": false, @@ -128663,7 +129492,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60214\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60214\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0d29be", "Grid": true, "GridProjection": false, @@ -128724,7 +129553,7 @@ }, "Description": "Knowledge of the Elders", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"04230\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", + "GMNotes": "{\n \"id\": \"04230\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "863f91", "Grid": true, "GridProjection": false, @@ -128786,7 +129615,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07156\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Blessed. Cursed.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07156\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ally. Blessed. Cursed.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "48e4a3", "Grid": true, "GridProjection": false, @@ -128848,7 +129677,7 @@ }, "Description": "Interwoven Distortion", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"86051\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic. Clothing.\",\r\n \"agilityIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"86051\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic. Clothing.\",\n \"agilityIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "e4ab48", "Grid": true, "GridProjection": false, @@ -128910,7 +129739,7 @@ }, "Description": "Ally", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Ally.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01117\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Ally.\",\n \"cycle\": \"Core\"\n}", "GUID": "3c1944", "Grid": true, "GridProjection": false, @@ -128972,7 +129801,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07111\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07111\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "f6b1b6", "Grid": true, "GridProjection": false, @@ -129034,7 +129863,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04270\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic. Cursed.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04270\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Relic. Cursed.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "5d559a", "Grid": true, "GridProjection": false, @@ -129096,7 +129925,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02032\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9da37c", "Grid": true, "GridProjection": false, @@ -129158,7 +129987,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05036\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Clothing. Footwear.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05036\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Clothing. Footwear.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "6fa7fa", "Grid": true, "GridProjection": false, @@ -129220,7 +130049,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"82026\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Mask.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"82026\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Mask.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "d0e108", "Grid": true, "GridProjection": false, @@ -129282,7 +130111,7 @@ }, "Description": "Professor of Languages", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02061\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02061\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "42806b", "Grid": true, "GridProjection": false, @@ -129344,7 +130173,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04148\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04148\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9dc3d4", "Grid": true, "GridProjection": false, @@ -129406,7 +130235,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02018\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02018\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "eab2ed", "Grid": true, "GridProjection": false, @@ -129467,7 +130296,7 @@ }, "Description": "Too Noble for His Own Good", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06155\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Police.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06155\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Police.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "08e5a6", "Grid": true, "GridProjection": false, @@ -129529,7 +130358,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03266\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03266\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "536b52", "Grid": true, "GridProjection": false, @@ -129591,7 +130420,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03313\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03313\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "9bcdee", "Grid": true, "GridProjection": false, @@ -129653,7 +130482,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02112\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Song.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02112\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell. Song.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2ae3ce", "Grid": true, "GridProjection": false, @@ -129715,7 +130544,7 @@ }, "Description": "Regalia Dementia", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03143\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Clothing.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03143\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Clothing.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5d30a1", "Grid": true, "GridProjection": false, @@ -129777,7 +130606,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04106\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04106\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "658d38", "Grid": true, "GridProjection": false, @@ -129839,7 +130668,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60130\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60130\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "85fe46", "Grid": true, "GridProjection": false, @@ -129900,7 +130729,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03026\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03026\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "44cf4a", "Grid": true, "GridProjection": false, @@ -129961,7 +130790,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02229\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02229\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "99989c", "Grid": true, "GridProjection": false, @@ -130022,7 +130851,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05014\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"startsInHand\": true,\r\n \"cost\": 2,\r\n \"traits\": \"Insight.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05014\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"startsInHand\": true,\n \"cost\": 2,\n \"traits\": \"Insight.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "f08934", "Grid": true, "GridProjection": false, @@ -130083,7 +130912,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04198\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04198\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "bf3dd1", "Grid": true, "GridProjection": false, @@ -130144,7 +130973,7 @@ }, "Description": "O'Bannion Driver", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60332\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60332\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Ally. Criminal.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0e72b6", "Grid": true, "GridProjection": false, @@ -130206,7 +131035,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50001\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50001\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "d708d9", "Grid": true, "GridProjection": false, @@ -130268,7 +131097,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06008\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Insight. Research.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06008\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Insight. Research.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "3586e6", "Grid": true, "GridProjection": false, @@ -130329,7 +131158,7 @@ }, "Description": "Text of the Elder Herald", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"07191\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Tome. Cursed.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", + "GMNotes": "{\n \"id\": \"07191\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Tome. Cursed.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e8b179", "Grid": true, "GridProjection": false, @@ -130391,7 +131220,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02227\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02227\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5c3aea", "Grid": true, "GridProjection": false, @@ -130452,7 +131281,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06111\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06111\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "91e53c", "Grid": true, "GridProjection": false, @@ -130513,7 +131342,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50010\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50010\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Charm.\",\n \"wildIcons\": 1,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "3f91af", "Grid": true, "GridProjection": false, @@ -130575,7 +131404,7 @@ }, "Description": "Trap.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"81021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Trap.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"81021\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Trap.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "c7b748", "Grid": true, "GridProjection": false, @@ -130637,7 +131466,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60502\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60502\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "6da7c4", "Grid": true, "GridProjection": false, @@ -130698,7 +131527,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04272\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Improvised.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04272\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Improvised.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "aa3984", "Grid": true, "GridProjection": false, @@ -130759,7 +131588,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05232\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tome.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05232\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Tome.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "0ce005", "Grid": true, "GridProjection": false, @@ -130821,7 +131650,7 @@ }, "Description": "Dangerous Bokor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"81019\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"81019\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Sorcerer.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "ab24a6", "Grid": true, "GridProjection": false, @@ -130883,7 +131712,7 @@ }, "Description": "Secrets Revealed", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60230\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60230\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Relic. Tome.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "f375bf", "Grid": true, "GridProjection": false, @@ -130945,7 +131774,7 @@ }, "Description": "Expert Dreamer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06059\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Dreamer.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06059\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Dreamer.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b04c8e", "Grid": true, "GridProjection": false, @@ -131007,7 +131836,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05029\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Favor. Gambit.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05029\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Favor. Gambit.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "276477", "Grid": true, "GridProjection": false, @@ -131068,7 +131897,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07181\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07181\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e44c96", "Grid": true, "GridProjection": false, @@ -131130,7 +131959,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02009\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02009\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "033a35", "Grid": true, "GridProjection": false, @@ -131191,7 +132020,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60321\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60321\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "725690", "Grid": true, "GridProjection": false, @@ -131253,7 +132082,7 @@ }, "Description": "Library Intern", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06324\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06324\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "97e9ce", "Grid": true, "GridProjection": false, @@ -131315,7 +132144,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04011\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "848d9c", "Grid": true, "GridProjection": false, @@ -131377,7 +132206,7 @@ }, "Description": "Every Trial a Lesson", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54009\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "c7fe4a", "Grid": true, "GridProjection": false, @@ -131439,7 +132268,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06202\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06202\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "26853e", "Grid": true, "GridProjection": false, @@ -131500,7 +132329,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54013\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"level\": 4,\r\n \"traits\": \"Blessed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54013\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"level\": 4,\n \"traits\": \"Blessed.\",\n \"permanent\": true,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "cf5ac8", "Grid": true, "GridProjection": false, @@ -131562,7 +132391,7 @@ }, "Description": "Mysterious Benefactress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03198\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Patron.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03198\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Patron.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1ee492", "Grid": true, "GridProjection": false, @@ -131624,7 +132453,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03027\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "7b42b6", "Grid": true, "GridProjection": false, @@ -131686,7 +132515,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60217\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60217\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "010509", "Grid": true, "GridProjection": false, @@ -131747,7 +132576,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07305\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07305\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "4425b5", "Grid": true, "GridProjection": false, @@ -131809,7 +132638,7 @@ }, "Description": "Big Man on Campus", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02033\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02033\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ffdeb5", "Grid": true, "GridProjection": false, @@ -131871,7 +132700,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60421\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60421\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "6b2e97", "Grid": true, "GridProjection": false, @@ -131933,7 +132762,7 @@ }, "Description": "Untranslated", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07022\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome. Occult.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07022\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tome. Occult.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "fbfa24", "Grid": true, "GridProjection": false, @@ -131995,7 +132824,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03307\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 5,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03307\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 5,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1f3f16", "Grid": true, "GridProjection": false, @@ -132056,7 +132885,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04009\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04009\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "86feae", "Grid": true, "GridProjection": false, @@ -132117,7 +132946,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03268\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03268\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e7f37b", "Grid": true, "GridProjection": false, @@ -132179,7 +133008,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52003\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 3,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52003\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 3,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "1258c6", "Grid": true, "GridProjection": false, @@ -132240,7 +133069,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98006\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98006\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Promo\"\n}", "GUID": "fe68c6", "Grid": true, "GridProjection": false, @@ -132301,7 +133130,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07304\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Ritual.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07304\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Ritual.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "27f6aa", "Grid": true, "GridProjection": false, @@ -132363,7 +133192,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03030\",\r\n \"alternate_ids\": [\r\n \"60313\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Gambit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03030\",\n \"alternate_ids\": [\n \"60313\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Gambit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "cc6b14", "Grid": true, "GridProjection": false, @@ -132424,7 +133253,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02024\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Illicit.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "c33a10", "Grid": true, "GridProjection": false, @@ -132486,7 +133315,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06113\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Practiced. Expert.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06113\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"traits\": \"Practiced. Expert.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "6ad46b", "Grid": true, "GridProjection": false, @@ -132547,7 +133376,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02303\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02303\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "8b0193", "Grid": true, "GridProjection": false, @@ -132608,7 +133437,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07013\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07013\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item.\",\n \"weakness\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "6aea76", "Grid": true, "GridProjection": false, @@ -132670,7 +133499,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05012\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 10,\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05012\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 10,\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "acce72", "Grid": true, "GridProjection": false, @@ -132731,7 +133560,7 @@ }, "Description": "Key to the Gate of Dreams", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06189\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Charm. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06189\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Charm. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "61fd07", "Grid": true, "GridProjection": false, @@ -132793,7 +133622,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02031\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02031\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ba1460", "Grid": true, "GridProjection": false, @@ -132854,7 +133683,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02026\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02026\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "efb09b", "Grid": true, "GridProjection": false, @@ -132915,7 +133744,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03194\",\r\n \"alternate_ids\": [\r\n \"60312\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03194\",\n \"alternate_ids\": [\n \"60312\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "b8c93a", "Grid": true, "GridProjection": false, @@ -132976,7 +133805,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51005\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Supply. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51005\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Supply. Illicit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "620b6e", "Grid": true, "GridProjection": false, @@ -133037,7 +133866,7 @@ }, "Description": "Guiding Stones", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03192\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03192\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a14a11", "Grid": true, "GridProjection": false, @@ -133099,7 +133928,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04025\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04025\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Ally. Wayfarer.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "18927e", "Grid": true, "GridProjection": false, @@ -133161,7 +133990,7 @@ }, "Description": "Working on Something Big", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02302\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02302\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "14d04f", "Grid": true, "GridProjection": false, @@ -133223,7 +134052,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03267\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03267\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "f6ff32", "Grid": true, "GridProjection": false, @@ -133284,7 +134113,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04158\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Augury. Ritual.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04158\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Augury. Ritual.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "a06aa7", "Grid": true, "GridProjection": false, @@ -133346,7 +134175,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04149\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Bold.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04149\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit. Bold.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "baef55", "Grid": true, "GridProjection": false, @@ -133407,7 +134236,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07302\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Item. Weapon. Melee. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07302\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Item. Weapon. Melee. Blessed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "28289a", "Grid": true, "GridProjection": false, @@ -133416,7 +134245,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/HolySpear5\")\nend)\n__bundle_register(\"playercards/cards/HolySpear5\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nSHOW_MULTI_SEAL = 2\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/HolySpear5\")\nend)\n__bundle_register(\"playercards/cards/HolySpear5\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nSHOW_MULTI_SEAL = 2\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -133469,7 +134298,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60311\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60311\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a973aa", "Grid": true, "GridProjection": false, @@ -133531,7 +134360,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02019\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02019\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9956d5", "Grid": true, "GridProjection": false, @@ -133592,7 +134421,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07007\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07007\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "8b68f4", "Grid": true, "GridProjection": false, @@ -133653,7 +134482,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52009\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "bda4fd", "Grid": true, "GridProjection": false, @@ -133715,7 +134544,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60322\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Gambit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60322\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Gambit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "fc82a5", "Grid": true, "GridProjection": false, @@ -133776,7 +134605,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04105\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Trick.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04105\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Trick.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "1b0235", "Grid": true, "GridProjection": false, @@ -133837,7 +134666,7 @@ }, "Description": "Fearless Flatfoot", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05151\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Detective. Police.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05151\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Detective. Police.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "ae20e0", "Grid": true, "GridProjection": false, @@ -133899,7 +134728,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02234\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Condition.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02234\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Condition.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "1b4434", "Grid": true, "GridProjection": false, @@ -133961,7 +134790,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60222\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60222\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "2172e2", "Grid": true, "GridProjection": false, @@ -134023,7 +134852,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03110\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03110\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5690d1", "Grid": true, "GridProjection": false, @@ -134085,7 +134914,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02149\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02149\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "07a8f0", "Grid": true, "GridProjection": false, @@ -134147,7 +134976,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04028\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04028\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "dcdcea", "Grid": true, "GridProjection": false, @@ -134208,7 +135037,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06114\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06114\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "0cc3e7", "Grid": true, "GridProjection": false, @@ -134269,7 +135098,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04274\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04274\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "5b14dc", "Grid": true, "GridProjection": false, @@ -134331,7 +135160,7 @@ }, "Description": "Not Going Down That Easily", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05258\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Veteran.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05258\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Veteran.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "2237f4", "Grid": true, "GridProjection": false, @@ -134393,7 +135222,7 @@ }, "Description": "Madness.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"84007\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"84007\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "2c76d9", "Grid": true, "GridProjection": false, @@ -134454,7 +135283,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05321\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05321\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "f57a6f", "Grid": true, "GridProjection": false, @@ -134516,7 +135345,7 @@ }, "Description": "Calamitous Blade of Celephaïs", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"06018\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Weapon. Melee. Relic. Cursed.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"06019\"\n }\n ],\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", + "GMNotes": "{\n \"id\": \"06018\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Weapon. Melee. Relic. Cursed.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"06019\"\n }\n ],\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "2d94ed", "Grid": true, "GridProjection": false, @@ -134578,7 +135407,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60423\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60423\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e2bc49", "Grid": true, "GridProjection": false, @@ -134639,7 +135468,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50006\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 5,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50006\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 5,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "f2508d", "Grid": true, "GridProjection": false, @@ -134700,7 +135529,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02300\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 5,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02300\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 5,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "e21854", "Grid": true, "GridProjection": false, @@ -134761,7 +135590,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07306\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 3,\r\n \"traits\": \"Practiced. Cursed.\",\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07306\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 3,\n \"traits\": \"Practiced. Cursed.\",\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "025ed2", "Grid": true, "GridProjection": false, @@ -134822,7 +135651,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07179\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07179\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "591284", "Grid": true, "GridProjection": false, @@ -134884,7 +135713,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04201\",\r\n \"alternate_ids\": [\r\n \"60519\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04201\",\n \"alternate_ids\": [\n \"60519\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "cc6e4d", "Grid": true, "GridProjection": false, @@ -134945,7 +135774,7 @@ }, "Description": "Will Try Anything Once", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04197\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Witch.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04197\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9683d0", "Grid": true, "GridProjection": false, @@ -135007,7 +135836,7 @@ }, "Description": "Tried Everything Once", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10097\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10097\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "9683d2", "Grid": true, "GridProjection": false, @@ -135020,7 +135849,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", - "Nickname": "Olive McBride", + "Nickname": "Olive McBride (2)", "SidewaysCard": false, "Snap": true, "Sticky": true, @@ -135069,7 +135898,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60112\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60112\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "20645e", "Grid": true, "GridProjection": false, @@ -135130,7 +135959,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07230\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Fortune. Blessed.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07230\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Fortune. Blessed.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "7885cf", "Grid": true, "GridProjection": false, @@ -135191,7 +136020,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60115\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60115\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "273584", "Grid": true, "GridProjection": false, @@ -135252,7 +136081,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04192\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04192\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "99d061", "Grid": true, "GridProjection": false, @@ -135313,7 +136142,7 @@ }, "Description": "He Was Never There", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02310\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 5,\r\n \"traits\": \"Ally. Conspirator.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02310\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 5,\n \"traits\": \"Ally. Conspirator.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ad18a6", "Grid": true, "GridProjection": false, @@ -135375,7 +136204,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05038\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05038\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "051742", "Grid": true, "GridProjection": false, @@ -135436,7 +136265,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04273\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04273\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "44a37f", "Grid": true, "GridProjection": false, @@ -135498,7 +136327,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07009\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"wildIcons\": 1,\r\n \"negativeIcons\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07009\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"wildIcons\": 1,\n \"negativeIcons\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "dd4a25", "Grid": true, "GridProjection": false, @@ -135559,7 +136388,7 @@ }, "Description": "Untranslated", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"03025\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Item. Occult. Tome.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", + "GMNotes": "{\n \"id\": \"03025\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Item. Occult. Tome.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "cbfc12", "Grid": true, "GridProjection": false, @@ -135621,7 +136450,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06157\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06157\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "5e808d", "Grid": true, "GridProjection": false, @@ -135682,7 +136511,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05278\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05278\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "006d44", "Grid": true, "GridProjection": false, @@ -135744,7 +136573,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60216\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 12,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60216\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 12,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "013446", "Grid": true, "GridProjection": false, @@ -135805,7 +136634,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03008\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03008\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bcf406", "Grid": true, "GridProjection": false, @@ -135866,7 +136695,7 @@ }, "Description": "Lost Son of Eztli", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04035\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Ally. Wayfarer.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "284bbe", "Grid": true, "GridProjection": false, @@ -135928,7 +136757,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01045\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01045\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent. Illicit.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "bc3451", "Grid": true, "GridProjection": false, @@ -135990,7 +136819,7 @@ }, "Description": "Circumstances Beyond Your Control", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05042\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Omen. Tarot.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05042\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Omen. Tarot.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d5c93d", "Grid": true, "GridProjection": false, @@ -136052,7 +136881,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60327\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60327\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "7f27d6", "Grid": true, "GridProjection": false, @@ -136114,7 +136943,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic. Occult.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06022\"\r\n }\r\n ],\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06021\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Item. Relic. Occult.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06022\"\n }\n ],\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ff9f23", "Grid": true, "GridProjection": false, @@ -136176,7 +137005,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03118\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Desperate.\",\r\n \"combatIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03118\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Desperate.\",\n \"combatIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "3ff641", "Grid": true, "GridProjection": false, @@ -136237,7 +137066,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05018\",\r\n \"alternate_ids\": [\r\n \"99002\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Spell. Song.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05018\",\n \"alternate_ids\": [\n \"99002\"\n ],\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Spell. Song.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "3b8cb7", "Grid": true, "GridProjection": false, @@ -136298,7 +137127,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05019\",\r\n \"alternate_ids\": [\r\n \"99003\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Avatar.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05019\",\n \"alternate_ids\": [\n \"99003\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"traits\": \"Avatar.\",\n \"weakness\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "16ad5d", "Grid": true, "GridProjection": false, @@ -136360,7 +137189,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60118\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60118\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "7ec473", "Grid": true, "GridProjection": false, @@ -136421,7 +137250,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02039\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02039\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "eeb330", "Grid": true, "GridProjection": false, @@ -136482,7 +137311,7 @@ }, "Description": "The Journey is Complete", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54003\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54003\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "372b5b", "Grid": true, "GridProjection": false, @@ -136544,7 +137373,7 @@ }, "Description": "Unlimited Potential", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54011\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "b74c69", "Grid": true, "GridProjection": false, @@ -136606,7 +137435,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07193\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Spirit. Cursed.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07193\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Spell. Spirit. Cursed.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "f1f24e", "Grid": true, "GridProjection": false, @@ -136667,7 +137496,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04269\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Fated.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04269\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic. Fated.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "2240f9", "Grid": true, "GridProjection": false, @@ -136728,7 +137557,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05315\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05315\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "76147b", "Grid": true, "GridProjection": false, @@ -136789,7 +137618,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60531\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 5,\r\n \"traits\": \"Talent. Cursed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60531\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"level\": 5,\n \"traits\": \"Talent. Cursed.\",\n \"permanent\": true,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "719a45", "Grid": true, "GridProjection": false, @@ -136851,7 +137680,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60529\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Item. Tool. Weapon. Melee.\",\r\n \"combatIcons\": 3,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60529\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 3,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "d40f4e", "Grid": true, "GridProjection": false, @@ -136913,7 +137742,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60231\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60231\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "b4121c", "Grid": true, "GridProjection": false, @@ -136975,7 +137804,7 @@ }, "Description": "You Have Been Chosen", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54001\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54001\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "a77ce0", "Grid": true, "GridProjection": false, @@ -137037,7 +137866,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05026\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05026\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "9e5cd2", "Grid": true, "GridProjection": false, @@ -137098,7 +137927,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03232\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03232\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Insight. Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "29169e", "Grid": true, "GridProjection": false, @@ -137159,7 +137988,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02191\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 3,\r\n \"traits\": \"Spell. Pact.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02191\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Spell. Pact.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "64e131", "Grid": true, "GridProjection": false, @@ -137221,7 +138050,7 @@ }, "Description": "Lost in a Dream", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06244\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Artist. Dreamer.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06244\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Artist. Dreamer.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "9f76ec", "Grid": true, "GridProjection": false, @@ -137283,7 +138112,7 @@ }, "Description": "Your True Master Awaits", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54007\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Tarot.\",\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "20c8a9", "Grid": true, "GridProjection": false, @@ -137345,7 +138174,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60429\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60429\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "591789", "Grid": true, "GridProjection": false, @@ -137406,7 +138235,7 @@ }, "Description": "Free from the Past", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05027\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "2e5b03", "Grid": true, "GridProjection": false, @@ -137468,7 +138297,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60316\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60316\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "d099f4", "Grid": true, "GridProjection": false, @@ -137529,7 +138358,7 @@ }, "Description": "Message from Your Inner Self", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05031\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05031\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "e80bd8", "Grid": true, "GridProjection": false, @@ -137591,7 +138420,7 @@ }, "Description": "Your Shadow Hungers", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"54015\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Omen. Tarot.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"Return to the Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"54015\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Omen. Tarot.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"Return to the Circle Undone\"\n}", "GUID": "7bcaf3", "Grid": true, "GridProjection": false, @@ -137653,7 +138482,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03115\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Talent. Composure.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03115\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Talent. Composure.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "86b9c5", "Grid": true, "GridProjection": false, @@ -137715,7 +138544,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60132\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 5,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"combatIcons\": 4,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60132\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 5,\n \"traits\": \"Spirit. Tactic.\",\n \"combatIcons\": 4,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "8ffa44", "Grid": true, "GridProjection": false, @@ -137776,7 +138605,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02301\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 6,\r\n \"level\": 5,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02301\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 6,\n \"level\": 5,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2d362c", "Grid": true, "GridProjection": false, @@ -137838,7 +138667,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04202\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04202\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "c077bf", "Grid": true, "GridProjection": false, @@ -137899,7 +138728,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07110\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"level\": 2,\r\n \"traits\": \"Covenant. Blessed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07110\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Blessed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "87226d", "Grid": true, "GridProjection": false, @@ -137961,7 +138790,7 @@ }, "Description": "Tough Old Bird", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60527\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Ally.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60527\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Ally.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "52a66f", "Grid": true, "GridProjection": false, @@ -138023,7 +138852,7 @@ }, "Description": "Unidentified", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Science.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02021\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Science.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "565b6b", "Grid": true, "GridProjection": false, @@ -138085,7 +138914,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04268\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04268\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "5a305e", "Grid": true, "GridProjection": false, @@ -138147,7 +138976,7 @@ }, "Description": "The Head Librarian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02040\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02040\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Miskatonic.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9229a8", "Grid": true, "GridProjection": false, @@ -138209,7 +139038,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52001\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52001\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "c026c9", "Grid": true, "GridProjection": false, @@ -138271,7 +139100,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60310\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Armor.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60310\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Armor.\",\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "dfbc13", "Grid": true, "GridProjection": false, @@ -138333,7 +139162,7 @@ }, "Description": "Restorative Concoction", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02262\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Science.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02262\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Science.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "4874bc", "Grid": true, "GridProjection": false, @@ -138395,7 +139224,7 @@ }, "Description": "Mystic", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05193\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05193\",\n \"type\": \"Asset\",\n \"slot\": \"Hand|Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d0de54", "Grid": true, "GridProjection": false, @@ -138457,7 +139286,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03116\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Desperate.\",\r\n \"willpowerIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03116\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Desperate.\",\n \"willpowerIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "5c3dd0", "Grid": true, "GridProjection": false, @@ -138518,7 +139347,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02110\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02110\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "731d2a", "Grid": true, "GridProjection": false, @@ -138580,7 +139409,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04017\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04017\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "4d971e", "Grid": true, "GridProjection": false, @@ -138642,7 +139471,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60409\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60409\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "c6caf6", "Grid": true, "GridProjection": false, @@ -138704,7 +139533,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03190\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03190\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "fe0cc0", "Grid": true, "GridProjection": false, @@ -138766,7 +139595,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02231\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02231\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "63f145", "Grid": true, "GridProjection": false, @@ -138827,7 +139656,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02267\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02267\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spell. Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "1cd2bd", "Grid": true, "GridProjection": false, @@ -138888,7 +139717,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04034\",\r\n \"alternate_ids\": [\r\n \"60514\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04034\",\n \"alternate_ids\": [\n \"60514\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "f0e425", "Grid": true, "GridProjection": false, @@ -138949,7 +139778,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60228\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"intellectIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60228\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 2,\n \"traits\": \"Practiced. Expert.\",\n \"intellectIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "96b5ed", "Grid": true, "GridProjection": false, @@ -139010,7 +139839,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03033\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03033\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "45d2d2", "Grid": true, "GridProjection": false, @@ -139071,7 +139900,7 @@ }, "Description": "Enemy", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03042\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Curse.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03042\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Curse.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "da227d", "Grid": true, "GridProjection": false, @@ -139132,7 +139961,7 @@ }, "Description": "Mysterious Device", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05228\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Relic.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05228\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Relic.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "44334c", "Grid": true, "GridProjection": false, @@ -139194,7 +140023,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04008\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Wayfarer.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "7c958e", "Grid": true, "GridProjection": false, @@ -139256,7 +140085,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06028\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Augury.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06028\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"traits\": \"Augury.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "600a3c", "Grid": true, "GridProjection": false, @@ -139317,7 +140146,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60120\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60120\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "3df5fb", "Grid": true, "GridProjection": false, @@ -139378,7 +140207,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05022\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05022\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "4e1d91", "Grid": true, "GridProjection": false, @@ -139439,7 +140268,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60407\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60407\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "17319c", "Grid": true, "GridProjection": false, @@ -139501,7 +140330,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60318\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60318\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Fortune. Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e4688b", "Grid": true, "GridProjection": false, @@ -139562,7 +140391,7 @@ }, "Description": "Shellblade Tribute", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"86054\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"86054\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "e89f48", "Grid": true, "GridProjection": false, @@ -139624,7 +140453,7 @@ }, "Description": "Untranslated", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60210\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60210\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Relic. Tome.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0a4d22", "Grid": true, "GridProjection": false, @@ -139686,7 +140515,7 @@ }, "Description": "Deals with \"Devils\"", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05279\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Witch.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05279\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "4f2489", "Grid": true, "GridProjection": false, @@ -139748,7 +140577,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07180\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Relic. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07180\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Relic. Clothing.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e81861", "Grid": true, "GridProjection": false, @@ -139810,7 +140639,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05017\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Cultist.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05017\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Cultist.\",\n \"weakness\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "785f68", "Grid": true, "GridProjection": false, @@ -139871,7 +140700,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98011\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Ally. Creature. Dreamlands.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98011\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Ally. Creature. Dreamlands.\",\n \"wildIcons\": 2,\n \"cycle\": \"Promo\"\n}", "GUID": "fa777f", "Grid": true, "GridProjection": false, @@ -139933,7 +140762,7 @@ }, "Description": "Of Nothing at All", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06022\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Item. Relic.\",\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06022\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"traits\": \"Item. Relic.\",\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "9b0dcf", "Grid": true, "GridProjection": false, @@ -139995,7 +140824,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07157\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tactic. Trap.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07157\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tactic. Trap.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "cc8321", "Grid": true, "GridProjection": false, @@ -140056,7 +140885,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60205\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60205\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "e69708", "Grid": true, "GridProjection": false, @@ -140118,7 +140947,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05007\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "7f1b48", "Grid": true, "GridProjection": false, @@ -140180,7 +141009,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06197\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Gambit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06197\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Gambit. Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "1ac667", "Grid": true, "GridProjection": false, @@ -140241,7 +141070,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60124\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Insight. Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60124\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Insight. Spirit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "037b2e", "Grid": true, "GridProjection": false, @@ -140302,7 +141131,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06278\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 1,\r\n \"traits\": \"Fortune. Research.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06278\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 1,\n \"traits\": \"Fortune. Research.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ff59dd", "Grid": true, "GridProjection": false, @@ -140363,7 +141192,7 @@ }, "Description": "Fixer for Hire", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07194\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 5,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Criminal. Cursed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07194\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 5,\n \"level\": 2,\n \"traits\": \"Ally. Criminal. Cursed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "1fd630", "Grid": true, "GridProjection": false, @@ -140425,7 +141254,7 @@ }, "Description": "Humanoid. Monster. Serpent.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04014\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Monster. Serpent.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04014\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Monster. Serpent.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "678391", "Grid": true, "GridProjection": false, @@ -140434,7 +141263,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/SerpentsofYig\")\nend)\n__bundle_register(\"playercards/cards/SerpentsofYig\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/SerpentsofYig\")\nend)\n__bundle_register(\"playercards/cards/SerpentsofYig\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -140486,7 +141315,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90030\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "dbdaff", "Grid": true, "GridProjection": false, @@ -140548,7 +141377,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02304\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02304\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Rogue\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ecfa42", "Grid": true, "GridProjection": false, @@ -140610,7 +141439,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06163\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06163\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "bba97a", "Grid": true, "GridProjection": false, @@ -140672,7 +141501,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07016\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07016\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "b9fbff", "Grid": true, "GridProjection": false, @@ -140733,7 +141562,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05110\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05110\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "8dce44", "Grid": true, "GridProjection": false, @@ -140794,7 +141623,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03013\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03013\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "1890d0", "Grid": true, "GridProjection": false, @@ -140855,7 +141684,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07222\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07222\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 1,\n \"traits\": \"Innate. Cursed.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "f10690", "Grid": true, "GridProjection": false, @@ -140916,7 +141745,7 @@ }, "Description": "Over the Threshold and Beyond", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04311\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Spell. Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 7,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04311\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Spell. Ritual.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 7,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "9cbac1", "Grid": true, "GridProjection": false, @@ -140925,7 +141754,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/SealoftheSeventhSign5\")\nend)\n__bundle_register(\"playercards/cards/SealoftheSeventhSign5\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/SealoftheSeventhSign5\")\nend)\n__bundle_register(\"playercards/cards/SealoftheSeventhSign5\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Auto-fail\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -140978,7 +141807,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02028\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02028\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "29b842", "Grid": true, "GridProjection": false, @@ -141040,7 +141869,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04018\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04018\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Wayfarer.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "0e2987", "Grid": true, "GridProjection": false, @@ -141102,7 +141931,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07115\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07115\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "d2cd42", "Grid": true, "GridProjection": false, @@ -141163,7 +141992,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03157\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Fortune.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03157\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Fortune.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "812685", "Grid": true, "GridProjection": false, @@ -141224,7 +142053,7 @@ }, "Description": "Cleansing Fire", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03269\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03269\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "423d46", "Grid": true, "GridProjection": false, @@ -141286,7 +142115,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "06322f", "Grid": true, "GridProjection": false, @@ -141347,7 +142176,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06034\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Insight.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06034\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Fortune. Insight.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "dacbf0", "Grid": true, "GridProjection": false, @@ -141408,7 +142237,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60325\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60325\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"agilityIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "982716", "Grid": true, "GridProjection": false, @@ -141469,7 +142298,7 @@ }, "Description": "Treachery", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06019\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06019\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "aafc17", "Grid": true, "GridProjection": false, @@ -141530,7 +142359,7 @@ }, "Description": "Item. Relic.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"83056\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"83056\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "0ce113", "Grid": true, "GridProjection": false, @@ -141592,7 +142421,7 @@ }, "Description": "Concerned Brother", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60102\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Medic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60102\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"traits\": \"Ally. Medic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "1f50e9", "Grid": true, "GridProjection": false, @@ -141654,7 +142483,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05152\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Upgrade.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05152\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Upgrade.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "e454c3", "Grid": true, "GridProjection": false, @@ -141715,7 +142544,7 @@ }, "Description": "Lookin' Out For #1", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06326\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06326\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Ally. Criminal.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "48c9ff", "Grid": true, "GridProjection": false, @@ -141777,7 +142606,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02156\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02156\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d88407", "Grid": true, "GridProjection": false, @@ -141838,7 +142667,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07153\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Spell. Spirit. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07153\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Spell. Spirit. Blessed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "92c295", "Grid": true, "GridProjection": false, @@ -141847,7 +142676,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/RadiantSmite1\")\nend)\n__bundle_register(\"playercards/cards/RadiantSmite1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/RadiantSmite1\")\nend)\n__bundle_register(\"playercards/cards/RadiantSmite1\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Bless\"] = true\n}\n\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -141899,7 +142728,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04236\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04236\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "b0c61c", "Grid": true, "GridProjection": false, @@ -141961,7 +142790,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07109\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Tactic. Blessed.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07109\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Tactic. Blessed.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "491c09", "Grid": true, "GridProjection": false, @@ -142022,7 +142851,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02271\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Fortune.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02271\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Innate. Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "06228f", "Grid": true, "GridProjection": false, @@ -142083,7 +142912,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05317\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05317\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "eafd12", "Grid": true, "GridProjection": false, @@ -142144,7 +142973,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05016\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05016\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "d8a324", "Grid": true, "GridProjection": false, @@ -142205,7 +143034,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03158\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Favor.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03158\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Favor.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "9b9e8b", "Grid": true, "GridProjection": false, @@ -142266,7 +143095,7 @@ }, "Description": "Mortal Reminder", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04023\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "c1a687", "Grid": true, "GridProjection": false, @@ -142328,7 +143157,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06195\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06195\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "c32e40", "Grid": true, "GridProjection": false, @@ -142390,7 +143219,7 @@ }, "Description": "Monster. Nightgaunt. Power.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"83058\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"traits\": \"Monster. Nightgaunt. Power.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"83058\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"traits\": \"Monster. Nightgaunt. Power.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "cf96b9", "Grid": true, "GridProjection": false, @@ -142452,7 +143281,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06035\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06035\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "eff3c8", "Grid": true, "GridProjection": false, @@ -142513,7 +143342,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03309\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03309\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "a6af13", "Grid": true, "GridProjection": false, @@ -142575,7 +143404,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06156\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06156\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight. Tactic.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "b6506d", "Grid": true, "GridProjection": false, @@ -142636,7 +143465,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60106\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60106\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "52c686", "Grid": true, "GridProjection": false, @@ -142698,7 +143527,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04275\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04275\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "d2663c", "Grid": true, "GridProjection": false, @@ -142760,7 +143589,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06205\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06205\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "122e98", "Grid": true, "GridProjection": false, @@ -142821,7 +143650,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03109\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Talent. Composure.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03109\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Talent. Composure.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "3a0df6", "Grid": true, "GridProjection": false, @@ -142883,7 +143712,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03119\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Desperate.\",\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03119\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Desperate.\",\n \"agilityIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "0f32e8", "Grid": true, "GridProjection": false, @@ -142944,7 +143773,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07122\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Covenant. Blessed.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07122\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Blessed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "436401", "Grid": true, "GridProjection": false, @@ -143006,7 +143835,7 @@ }, "Description": "Dreams of a Madman", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06237\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome. Charm.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06113\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06237\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tome. Charm.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06113\"\n }\n ],\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "e5f9cb", "Grid": true, "GridProjection": false, @@ -143068,7 +143897,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52011\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness. Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"hidden\": true,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52011\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness. Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"hidden\": true,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "a5be8b", "Grid": true, "GridProjection": false, @@ -143129,7 +143958,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03230\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Science.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03230\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent. Science.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bc80ab", "Grid": true, "GridProjection": false, @@ -143191,7 +144020,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50005\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "15643b", "Grid": true, "GridProjection": false, @@ -143253,7 +144082,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04232\",\r\n \"alternate_ids\": [\r\n \"60314\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04232\",\n \"alternate_ids\": [\n \"60314\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "cf1d4e", "Grid": true, "GridProjection": false, @@ -143314,7 +144143,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02113\",\r\n \"alternate_ids\": [\r\n \"60518\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02113\",\n \"alternate_ids\": [\n \"60518\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "59d89b", "Grid": true, "GridProjection": false, @@ -143375,7 +144204,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07040\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Endtimes.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07040\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Endtimes.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e701af", "Grid": true, "GridProjection": false, @@ -143384,7 +144213,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/DayofReckoning\")\nend)\n__bundle_register(\"playercards/cards/DayofReckoning\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/DayofReckoning\")\nend)\n__bundle_register(\"playercards/cards/DayofReckoning\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Elder Sign\"] = true\n}\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -143436,7 +144265,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02185\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02185\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "2f9de4", "Grid": true, "GridProjection": false, @@ -143498,7 +144327,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60121\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60121\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "9e7f6a", "Grid": true, "GridProjection": false, @@ -143559,7 +144388,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 1,\r\n \"id\": \"06025\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06024\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Relic.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"06025\"\n }\n ],\n \"willpowerIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "6692de", "Grid": true, "GridProjection": false, @@ -143621,7 +144450,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52007\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "283e54", "Grid": true, "GridProjection": false, @@ -143683,7 +144512,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51001\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51001\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "e8b7ad", "Grid": true, "GridProjection": false, @@ -143745,7 +144574,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07151\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item. Tome.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07151\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Item. Tome.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "90fdb0", "Grid": true, "GridProjection": false, @@ -143807,7 +144636,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03231\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03231\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "ffa4f9", "Grid": true, "GridProjection": false, @@ -143868,7 +144697,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60430\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60430\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "0ee874", "Grid": true, "GridProjection": false, @@ -143930,7 +144759,7 @@ }, "Description": "Guardian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05186\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 6,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05186\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 6,\n \"level\": 3,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b492cb", "Grid": true, "GridProjection": false, @@ -143992,7 +144821,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03273\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03273\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "8837ff", "Grid": true, "GridProjection": false, @@ -144053,7 +144882,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05160\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Gambit. Trick.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05160\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Gambit. Trick.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "dffa9d", "Grid": true, "GridProjection": false, @@ -144114,7 +144943,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05282\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05282\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "f9a232", "Grid": true, "GridProjection": false, @@ -144175,7 +145004,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07266\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07266\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Talent.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "9565f0", "Grid": true, "GridProjection": false, @@ -144237,7 +145066,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01073\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01073\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "1b76c9", "Grid": true, "GridProjection": false, @@ -144299,7 +145128,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06020\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06020\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ef7c11", "Grid": true, "GridProjection": false, @@ -144361,7 +145190,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02187\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02187\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "d48b25", "Grid": true, "GridProjection": false, @@ -144423,7 +145252,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02306\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02306\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "7a33b2", "Grid": true, "GridProjection": false, @@ -144485,7 +145314,7 @@ }, "Description": "Gift of the Void", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"86053\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"86053\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "1a94ad", "Grid": true, "GridProjection": false, @@ -144547,7 +145376,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06330\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm. Cursed.\",\r\n \"bonded\": [\r\n {\r\n \"count\": 3,\r\n \"id\": \"06331\"\r\n }\r\n ],\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06330\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Charm. Cursed.\",\n \"bonded\": [\n {\n \"count\": 3,\n \"id\": \"06331\"\n }\n ],\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d6f6f1", "Grid": true, "GridProjection": false, @@ -144609,7 +145438,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03150\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03150\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "c17f2c", "Grid": true, "GridProjection": false, @@ -144670,7 +145499,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05113\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05113\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "a00fca", "Grid": true, "GridProjection": false, @@ -144731,7 +145560,7 @@ }, "Description": "Chalice of the Heart", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Tarot.\",\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05035\",\n \"type\": \"Asset\",\n \"slot\": \"Tarot\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Tarot.\",\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "dd4e2a", "Grid": true, "GridProjection": false, @@ -144793,7 +145622,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "d8705c", "Grid": true, "GridProjection": false, @@ -144854,7 +145683,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"85030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Monster. Ooze.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"85030\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Monster. Ooze.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "26398a", "Grid": true, "GridProjection": false, @@ -144916,7 +145745,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Cursed.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07117\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Spell. Cursed.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3feff1", "Grid": true, "GridProjection": false, @@ -144978,7 +145807,7 @@ }, "Description": "Empowering Elixir", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51004\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 4,\r\n \"traits\": \"Item. Science.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51004\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 4,\n \"traits\": \"Item. Science.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "d96e4b", "Grid": true, "GridProjection": false, @@ -145040,7 +145869,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52006\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52006\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "0ec9bf", "Grid": true, "GridProjection": false, @@ -145102,7 +145931,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01093\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01093\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "acb83a", "Grid": true, "GridProjection": false, @@ -145163,7 +145992,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04111\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04111\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "0a390e", "Grid": true, "GridProjection": false, @@ -145224,7 +146053,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03311\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Paradox.\",\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03311\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell. Paradox.\",\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "ba0fe7", "Grid": true, "GridProjection": false, @@ -145285,7 +146114,7 @@ }, "Description": "Seek the Truth", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90028\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90028\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "0994c9", "Grid": true, "GridProjection": false, @@ -145347,7 +146176,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06284\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06284\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "f0389b", "Grid": true, "GridProjection": false, @@ -145408,7 +146237,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"52002\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to the Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"52002\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to the Path to Carcosa\"\n}", "GUID": "a2c7ef", "Grid": true, "GridProjection": false, @@ -145469,7 +146298,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"traits\": \"Ally. Creature. Dreamlands.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06032\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"traits\": \"Ally. Creature. Dreamlands.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "695bb7", "Grid": true, "GridProjection": false, @@ -145531,7 +146360,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03197\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03197\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e27b3c", "Grid": true, "GridProjection": false, @@ -145592,7 +146421,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03107\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Talent. Composure.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03107\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Talent. Composure.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bd3ecc", "Grid": true, "GridProjection": false, @@ -145654,7 +146483,7 @@ }, "Description": "Leave No Doubt", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90029\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90029\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "07e7bd", "Grid": true, "GridProjection": false, @@ -145716,7 +146545,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04040\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04040\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "ba2ae1", "Grid": true, "GridProjection": false, @@ -145777,7 +146606,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60211\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60211\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "8595fb", "Grid": true, "GridProjection": false, @@ -145839,7 +146668,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07223\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07223\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "477e79", "Grid": true, "GridProjection": false, @@ -145901,7 +146730,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60114\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60114\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "5b0f86", "Grid": true, "GridProjection": false, @@ -145962,7 +146791,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06328\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06328\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane x2\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "ad58aa", "Grid": true, "GridProjection": false, @@ -146024,7 +146853,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03304\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03304\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "fc2629", "Grid": true, "GridProjection": false, @@ -146085,7 +146914,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60424\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"willpowerIcons\": 3,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60424\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"willpowerIcons\": 3,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "219c78", "Grid": true, "GridProjection": false, @@ -146146,7 +146975,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"04308\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Click\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", + "GMNotes": "{\n \"id\": \"04308\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Click\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "0db666", "Grid": true, "GridProjection": false, @@ -146208,7 +147037,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04039\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04039\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "dc5b38", "Grid": true, "GridProjection": false, @@ -146269,7 +147098,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60317\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60317\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "b8843c", "Grid": true, "GridProjection": false, @@ -146330,7 +147159,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60427\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60427\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "943332", "Grid": true, "GridProjection": false, @@ -146392,7 +147221,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03114\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03114\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "215cec", "Grid": true, "GridProjection": false, @@ -146454,7 +147283,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04151\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04151\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "eea4ef", "Grid": true, "GridProjection": false, @@ -146516,7 +147345,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07026\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ritual. Cursed.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07026\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ritual. Cursed.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "272e6c", "Grid": true, "GridProjection": false, @@ -146525,7 +147354,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/DarkRitual\")\nend)\n__bundle_register(\"playercards/cards/DarkRitual\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/DarkRitual\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/DarkRitual\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -146578,7 +147407,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01513\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Spell.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01513\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Spell.\",\n \"cycle\": \"Core\"\n}", "GUID": "98c8d8", "Grid": true, "GridProjection": false, @@ -146639,7 +147468,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03237\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03237\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "da207b", "Grid": true, "GridProjection": false, @@ -146700,7 +147529,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07034\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07034\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Fortune. Blessed.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "8b46b2", "Grid": true, "GridProjection": false, @@ -146761,7 +147590,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"05011\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Boon.\",\n \"permanent\": true,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", + "GMNotes": "{\n \"id\": \"05011\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Boon.\",\n \"permanent\": true,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "394603", "Grid": true, "GridProjection": false, @@ -146770,7 +147599,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FamilyInheritance\")\nend)\n__bundle_register(\"playercards/cards/FamilyInheritance\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\nlocal clickableResourceCounter = nil\nlocal foundTokens = 0\n\nfunction onLoad()\n self.addContextMenuItem(\"Add 4 resources\", function(playerColor) add4(playerColor) end)\n self.addContextMenuItem(\"Take all resources\", function(playerColor) takeAll(playerColor) end)\n self.addContextMenuItem(\"Discard all resources\", function(playerColor) loseAll(playerColor) end)\nend\n\nfunction searchSelf()\n clickableResourceCounter = nil\n foundTokens = 0\n\n for _, obj in ipairs(searchArea(self.getPosition(), { 2.5, 0.5, 3.5 })) do\n local obj = obj.hit_object\n local image = obj.getCustomObject().image\n if image == \"http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/\" then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif obj.getMemo() == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n return\n end\n end\nend\n\nfunction add4(playerColor)\n searchSelf()\n\n local newCount = foundTokens + 4\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n if newCount \u003e 12 then\n printToColor(\"Count increased to \" .. newCount .. \" resources. Spawning clickable counter instead.\", playerColor)\n tokenManager.spawnResourceCounterToken(self, newCount)\n else\n tokenManager.spawnTokenGroup(self, \"resource\", newCount)\n end\n end\nend\n\nfunction takeAll(playerColor)\n searchSelf()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n playmatApi.updateCounter(matColor, \"ResourceCounter\", _, foundTokens)\n\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", 0)\n end\n printToColor(\"Moved \" .. foundTokens .. \" resource(s) to \" .. matColor .. \"'s resource pool.\", playerColor)\nend\n\nfunction loseAll(playerColor)\n searchSelf()\n\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", 0)\n end\n printToColor(\"Discarded \" .. foundTokens .. \" resource(s).\", playerColor)\nend\n\nfunction searchArea(origin, size)\n return Physics.cast({\n origin = origin,\n direction = { 0, 1, 0 },\n orientation = PLAY_ZONE_ROTATION,\n type = 3,\n size = size,\n max_distance = 1\n })\nend\nend)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local search = internal.searchOnCard(cardPos, card.getRotation())\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(search) do\n local obj = obj.hit_object\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n -- searches on a card (standard size) and returns the result\n ---@param position Table Position of the card\n ---@param rotation Table Rotation of the card\n internal.searchOnCard = function(position, rotation)\n return Physics.cast({\n origin = position,\n direction = {0, 1, 0},\n orientation = rotation,\n type = 3,\n size = { 2.5, 0.5, 3.5 },\n max_distance = 1,\n debug = false\n })\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/token/TokenManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local optionPanelApi = require(\"core/OptionPanelApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n local searchLib = require(\"util/SearchLib\")\n local tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n local PLAYER_CARD_TOKEN_OFFSETS = {\n [1] = {\n Vector(0, 3, -0.2)\n },\n [2] = {\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [3] = {\n Vector(0, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [4] = {\n Vector(0.4, 3, -0.9),\n Vector(-0.4, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [5] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.4, 3, -0.2),\n Vector(-0.4, 3, -0.2)\n },\n [6] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2)\n },\n [7] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0, 3, 0.5)\n },\n [8] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(-0.35, 3, 0.5),\n Vector(0.35, 3, 0.5)\n },\n [9] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5)\n },\n [10] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0, 3, 1.2)\n },\n [11] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(-0.35, 3, 1.2),\n Vector(0.35, 3, 1.2)\n },\n [12] = {\n Vector(0.7, 3, -0.9),\n Vector(0, 3, -0.9),\n Vector(-0.7, 3, -0.9),\n Vector(0.7, 3, -0.2),\n Vector(0, 3, -0.2),\n Vector(-0.7, 3, -0.2),\n Vector(0.7, 3, 0.5),\n Vector(0, 3, 0.5),\n Vector(-0.7, 3, 0.5),\n Vector(0.7, 3, 1.2),\n Vector(0, 3, 1.2),\n Vector(-0.7, 3, 1.2)\n }\n }\n\n -- stateIDs for the multi-stated resource tokens\n local stateTable = {\n [\"resource\"] = 1,\n [\"ammo\"] = 2,\n [\"bounty\"] = 3,\n [\"charge\"] = 4,\n [\"evidence\"] = 5,\n [\"secret\"] = 6,\n [\"supply\"] = 7\n }\n\n -- Table of data extracted from the token source bag, keyed by the Memo on each token which\n -- should match the token type keys (\"resource\", \"clue\", etc)\n local tokenTemplates\n\n local playerCardData\n local locationData\n\n local TokenManager = { }\n local internal = { }\n\n -- Spawns tokens for the card. This function is built to just throw a card at it and let it do\n -- the work once a card has hit an area where it might spawn tokens. It will check to see if\n -- the card has already spawned, find appropriate data from either the uses metadata or the Data\n -- Helper, and spawn the tokens.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n TokenManager.spawnForCard = function(card, extraUses)\n if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then\n return\n end\n local metadata = JSON.decode(card.getGMNotes())\n if metadata ~= nil then\n internal.spawnTokensFromUses(card, extraUses)\n else\n internal.spawnTokensFromDataHelper(card)\n end\n end\n\n -- Spawns a set of tokens on the given card.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String Type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param tokenCount Number How many tokens to spawn. For damage or horror this value will be set to the\n -- spawned state object rather than spawning multiple tokens\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType)\n local optionPanel = optionPanelApi.getOptions()\n\n if tokenType == \"damage\" or tokenType == \"horror\" then\n TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"enabled\" then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n elseif tokenType == \"resource\" and optionPanel[\"useResourceCounters\"] == \"custom\" and tokenCount == 0 then\n TokenManager.spawnResourceCounterToken(card, tokenCount)\n else\n TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown, subType)\n end\n end\n\n -- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror\n -- tokens.\n ---@param card Object Card to spawn tokens on\n ---@param tokenType String type of token to spawn, valid values are \"damage\" and \"horror\". Other\n -- types should use spawnMultipleTokens()\n ---@param tokenValue Number Value to set the damage/horror to\n TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown)\n if tokenValue \u003c 1 or tokenValue \u003e 50 then return end\n\n local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)\n end\n\n TokenManager.spawnResourceCounterToken = function(card, tokenCount)\n local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, -0.5))\n local rot = card.getRotation()\n TokenManager.spawnToken(pos, \"resourceCounter\", rot, function(spawned)\n spawned.call(\"updateVal\", tokenCount)\n end)\n end\n\n -- Spawns a number of tokens.\n ---@param tokenType String type of token to spawn, valid values are resource\", \"doom\", or \"clue\".\n -- Other types should use spawnCounterToken()\n ---@param tokenCount Number How many tokens to spawn\n ---@param shiftDown Number An offset for the z-value of this group of tokens\n ---@param subType String Subtype of token to spawn. This will only differ from the tokenName for resource tokens\n TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType)\n -- not checking the max at this point since clue offsets are calculated dynamically\n if tokenCount \u003c 1 then return end\n\n local offsets = {}\n if tokenType == \"clue\" then\n offsets = internal.buildClueOffsets(card, tokenCount)\n else\n -- only up to 12 offset tables defined\n if tokenCount \u003e 12 then return end\n for i = 1, tokenCount do\n offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i])\n -- Fix the y-position for the spawn, since positionToWorld considers rotation which can\n -- have bad results for face up/down differences\n offsets[i].y = card.getPosition().y + 0.15\n end\n end\n\n if shiftDown ~= nil then\n -- Copy the offsets to make sure we don't change the static values\n local baseOffsets = offsets\n offsets = { }\n\n -- get a vector for the shifting (downwards local to the card)\n local shiftDownVector = Vector(0, 0, shiftDown):rotateOver(\"y\", card.getRotation().y)\n for i, baseOffset in ipairs(baseOffsets) do\n offsets[i] = baseOffset + shiftDownVector\n end\n end\n\n if offsets == nil then\n error(\"couldn't find offsets for \" .. tokenCount .. ' tokens')\n return\n end\n\n -- handling for not provided subtype (for example when spawning from custom data helpers)\n if subType == nil then\n subType = \"\"\n end\n \n -- this is used to load the correct state for additional resource tokens (e.g. \"Ammo\")\n local callback = nil\n local stateID = stateTable[string.lower(subType)]\n if tokenType == \"resource\" and stateID ~= nil and stateID ~= 1 then\n callback = function(spawned) spawned.setState(stateID) end\n end\n\n for i = 1, tokenCount do\n TokenManager.spawnToken(offsets[i], tokenType, card.getRotation(), callback)\n end\n end\n\n -- Spawns a single token at the given global position by copying it from the template bag.\n ---@param position Global position to spawn the token\n ---@param tokenType String type of token to spawn, valid values are \"damage\", \"horror\",\n -- \"resource\", \"doom\", or \"clue\"\n ---@param rotation Vector Rotation to be used for the new token. Only the y-value will be used,\n -- x and z will use the default rotation from the source bag\n ---@param callback function A callback function triggered after the new token is spawned\n TokenManager.spawnToken = function(position, tokenType, rotation, callback)\n internal.initTokenTemplates()\n local loadTokenType = tokenType\n if tokenType == \"clue\" or tokenType == \"doom\" then\n loadTokenType = \"clueDoom\"\n end\n if tokenTemplates[loadTokenType] == nil then\n error(\"Unknown token type '\" .. tokenType .. \"'\")\n return\n end\n local tokenTemplate = tokenTemplates[loadTokenType]\n\n -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag\n local rot = Vector(tokenTemplate.Transform.rotX,\n 270,\n tokenTemplate.Transform.rotZ)\n if rotation ~= nil then\n rot.y = rotation.y\n end\n if tokenType == \"doom\" then\n rot.z = 180\n end\n\n tokenTemplate.Nickname = \"\"\n return spawnObjectData({\n data = tokenTemplate,\n position = position,\n rotation = rot,\n callback_function = callback\n })\n end\n\n -- Checks a card for metadata to maybe replenish it\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n TokenManager.maybeReplenishCard = function(card, uses, mat)\n -- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)\n if uses[1].count and uses[1].replenish then\n internal.replenishTokens(card, uses, mat)\n end\n end\n\n -- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some\n -- callers.\n ---@param card Object Card object to reset the tokens for\n TokenManager.resetTokensSpawned = function(card)\n tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())\n end\n\n -- Pushes new player card data into the local copy of the Data Helper player data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addPlayerCardData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n playerCardData[k] = v\n end\n end\n\n -- Pushes new location data into the local copy of the Data Helper location data.\n ---@param dataTable Table Key/Value pairs following the DataHelper style\n TokenManager.addLocationData = function(dataTable)\n internal.initDataHelperData()\n for k, v in pairs(dataTable) do\n locationData[k] = v\n end\n end\n\n -- Checks to see if the given card has location data in the DataHelper\n ---@param card Object Card to check for data\n ---@return Boolean True if this card has data in the helper, false otherwise\n TokenManager.hasLocationData = function(card)\n internal.initDataHelperData()\n return internal.getLocationData(card) ~= nil\n end\n\n internal.initTokenTemplates = function()\n if tokenTemplates ~= nil then\n return\n end\n tokenTemplates = {}\n local tokenSource = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSource\")\n for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do\n local tokenName = tokenTemplate.Memo\n tokenTemplates[tokenName] = tokenTemplate\n end\n end\n\n -- Copies the data from the DataHelper. Will only happen once.\n internal.initDataHelperData = function()\n if playerCardData ~= nil then\n return\n end\n local dataHelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')\n locationData = dataHelper.getTable('LOCATIONS_DATA')\n end\n\n -- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n ---@param extraUses Table A table of \u003cuse type\u003e=\u003ccount\u003e which will modify the number of tokens\n --- spawned for that type. e.g. Akachi's playmat should pass \"Charge\"=1\n internal.spawnTokensFromUses = function(card, extraUses)\n local uses = internal.getUses(card)\n if uses == nil then return end\n\n -- go through tokens to spawn\n local tokenCount\n for i, useInfo in ipairs(uses) do\n tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()\n if extraUses ~= nil and extraUses[useInfo.type] ~= nil then\n tokenCount = tokenCount + extraUses[useInfo.type]\n end\n -- Shift each spawned group after the first down so they don't pile on each other\n TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)\n end\n \n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state\n -- of the card for both locations and standard cards.\n ---@param card Object Card to maybe spawn tokens for\n internal.spawnTokensFromDataHelper = function(card)\n internal.initDataHelperData()\n local playerData = internal.getPlayerCardData(card)\n if playerData ~= nil then\n internal.spawnPlayerCardTokensFromDataHelper(card, playerData)\n end\n local locationData = internal.getLocationData(card)\n if locationData ~= nil then\n internal.spawnLocationTokensFromDataHelper(card, locationData)\n end\n end\n\n -- Spawn tokens for a player card using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param playerData Table Player card data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)\n local token = playerData.tokenType\n local tokenCount = playerData.tokenCount\n TokenManager.spawnTokenGroup(card, token, tokenCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n\n -- Spawn tokens for a location using data retrieved from the Data Helper.\n ---@param card Object Card to maybe spawn tokens for\n ---@param locationData Table Location data structure retrieved from the DataHelper. Should be\n -- the right data for this card.\n internal.spawnLocationTokensFromDataHelper = function(card, locationData)\n local clueCount = internal.getClueCountFromData(card, locationData)\n if clueCount \u003e 0 then\n TokenManager.spawnTokenGroup(card, \"clue\", clueCount)\n tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())\n end\n end\n\n internal.getPlayerCardData = function(card)\n return playerCardData[card.getName() .. ':' .. card.getDescription()]\n or playerCardData[card.getName()]\n end\n\n internal.getLocationData = function(card)\n return locationData[card.getName() .. '_' .. card.getGUID()] or locationData[card.getName()]\n end\n\n internal.getClueCountFromData = function(card, locationData)\n -- Return the number of clues to spawn on this location\n if locationData == nil then\n error('attempted to get clue for unexpected object: ' .. card.getName())\n return 0\n end\n\n if ((card.is_face_down and locationData.clueSide == 'back')\n or (not card.is_face_down and locationData.clueSide == 'front')) then\n if locationData.type == 'fixed' then\n return locationData.value\n elseif locationData.type == 'perPlayer' then\n return locationData.value * playAreaApi.getInvestigatorCount()\n end\n error('unexpected location type: ' .. locationData.type)\n end\n return 0\n end\n\n -- Gets the right uses structure for this card, based on metadata and face up/down state\n ---@param card Object Card to pull the uses from\n internal.getUses = function(card)\n local metadata = JSON.decode(card.getGMNotes()) or { }\n if metadata.type == \"Location\" then\n if card.is_face_down and metadata.locationBack ~= nil then\n return metadata.locationBack.uses\n elseif not card.is_face_down and metadata.locationFront ~= nil then\n return metadata.locationFront.uses\n end\n elseif not card.is_face_down then\n return metadata.uses\n end\n\n return nil\n end\n\n -- Dynamically create positions for clues on a card.\n ---@param card Object Card the clues will be placed on\n ---@param count Integer How many clues?\n ---@return Table Array of global positions to spawn the clues at\n internal.buildClueOffsets = function(card, count)\n local pos = card.getPosition()\n local cluePositions = { }\n for i = 1, count do\n local row = math.floor(1 + (i - 1) / 4)\n local column = (i - 1) % 4\n table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))\n end\n return cluePositions\n end\n\n ---@param card Object Card object to be replenished\n ---@param uses Table The already decoded metadata.uses (to avoid decoding again)\n ---@param mat Object The playmat the card is placed on (for rotation and casting)\n internal.replenishTokens = function(card, uses, mat)\n local cardPos = card.getPosition()\n\n -- don't continue for cards on the deck (Norman) or in the discard pile\n if mat.positionToLocal(cardPos).x \u003c -1 then return end\n\n -- get current amount of resource tokens on the card\n local clickableResourceCounter = nil\n local foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(card, \"isTileOrToken\")) do\n local memo = obj.getMemo()\n\n if (stateTable[memo] or 0) \u003e 0 then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif memo == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n break\n end\n end\n\n -- this is the theoretical new amount of uses (to be checked below)\n local newCount = foundTokens + uses[1].replenish\n\n -- if there are already more uses than the replenish amount, keep them\n if foundTokens \u003e uses[1].count then\n newCount = foundTokens\n -- only replenish up until the replenish amount\n elseif newCount \u003e uses[1].count then\n newCount = uses[1].count\n end\n\n -- update the clickable counter or spawn a group of tokens\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n TokenManager.spawnTokenGroup(card, uses[1].token, newCount, _, uses[1].type)\n end\n end\n\n return TokenManager\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FamilyInheritance\")\nend)\n__bundle_register(\"playercards/cards/FamilyInheritance\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal tokenManager = require(\"core/token/TokenManager\")\n\nlocal clickableResourceCounter = nil\nlocal foundTokens = 0\n\nfunction onLoad()\n self.addContextMenuItem(\"Add 4 resources\", function(playerColor) add4(playerColor) end)\n self.addContextMenuItem(\"Take all resources\", function(playerColor) takeAll(playerColor) end)\n self.addContextMenuItem(\"Discard all resources\", function(playerColor) loseAll(playerColor) end)\nend\n\nfunction searchSelf()\n clickableResourceCounter = nil\n foundTokens = 0\n\n for _, obj in ipairs(searchLib.onObject(self, \"isTileOrToken\")) do\n local image = obj.getCustomObject().image\n if image == \"http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/\" then\n foundTokens = foundTokens + math.abs(obj.getQuantity())\n obj.destruct()\n elseif obj.getMemo() == \"resourceCounter\" then\n foundTokens = obj.getVar(\"val\")\n clickableResourceCounter = obj\n return\n end\n end\nend\n\nfunction add4(playerColor)\n searchSelf()\n\n local newCount = foundTokens + 4\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", newCount)\n else\n if newCount \u003e 12 then\n printToColor(\"Count increased to \" .. newCount .. \" resources. Spawning clickable counter instead.\", playerColor)\n tokenManager.spawnResourceCounterToken(self, newCount)\n else\n tokenManager.spawnTokenGroup(self, \"resource\", newCount)\n end\n end\nend\n\nfunction takeAll(playerColor)\n searchSelf()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n playmatApi.updateCounter(matColor, \"ResourceCounter\", _, foundTokens)\n\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", 0)\n end\n printToColor(\"Moved \" .. foundTokens .. \" resource(s) to \" .. matColor .. \"'s resource pool.\", playerColor)\nend\n\nfunction loseAll(playerColor)\n searchSelf()\n\n if clickableResourceCounter then\n clickableResourceCounter.call(\"updateVal\", 0)\n end\n printToColor(\"Discarded \" .. foundTokens .. \" resource(s).\", playerColor)\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -146823,7 +147652,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04020\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Upgrade.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04020\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Upgrade.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "102fad", "Grid": true, "GridProjection": false, @@ -146884,7 +147713,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02109\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Supply. Illicit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02109\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Supply. Illicit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "b4ad29", "Grid": true, "GridProjection": false, @@ -146945,7 +147774,7 @@ }, "Description": "Survivor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05195\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm. Blessed.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05195\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Charm. Blessed.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "5fae20", "Grid": true, "GridProjection": false, @@ -147007,7 +147836,7 @@ }, "Description": "Signed in Blood", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05150\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Tome. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05150\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Tome. Relic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "ae3775", "Grid": true, "GridProjection": false, @@ -147069,7 +147898,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08126\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Armor.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08126\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Armor.\",\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "275450", "Grid": true, "GridProjection": false, @@ -147131,7 +147960,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08128\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08128\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0fc42c", "Grid": true, "GridProjection": false, @@ -147193,7 +148022,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03264\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03264\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "82d62c", "Grid": true, "GridProjection": false, @@ -147255,7 +148084,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50008\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50008\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "e72762", "Grid": true, "GridProjection": false, @@ -147316,7 +148145,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08078\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Developed.\",\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08078\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate. Developed.\",\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "adc8b6", "Grid": true, "GridProjection": false, @@ -147377,7 +148206,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02192\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02192\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "358387", "Grid": true, "GridProjection": false, @@ -147438,7 +148267,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08125\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Curse.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08125\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Curse.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "bdd102", "Grid": true, "GridProjection": false, @@ -147500,7 +148329,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08081\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Composure.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08081\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Talent. Composure.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "7a2fe9", "Grid": true, "GridProjection": false, @@ -147562,7 +148391,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08127\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08127\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Creature.\",\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "852697", "Grid": true, "GridProjection": false, @@ -147624,7 +148453,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08079\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Pact. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08079\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Pact. Cursed.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e81f1e", "Grid": true, "GridProjection": false, @@ -147685,7 +148514,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08123\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"agilityIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08123\",\n \"type\": \"Asset\",\n \"class\": \"Seeker|Rogue|Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"agilityIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "fa994a", "Grid": true, "GridProjection": false, @@ -147747,7 +148576,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08075\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Charm. Cursed.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08075\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Charm. Cursed.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "a65852", "Grid": true, "GridProjection": false, @@ -147809,7 +148638,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08080\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08080\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tool. Melee.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "fb019d", "Grid": true, "GridProjection": false, @@ -147871,7 +148700,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08124\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue|Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08124\",\n \"type\": \"Asset\",\n \"class\": \"Seeker|Rogue|Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "452db2", "Grid": true, "GridProjection": false, @@ -147933,7 +148762,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08074\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Upgrade.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Durability\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08074\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Upgrade.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Durability\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "29d06d", "Grid": true, "GridProjection": false, @@ -147994,7 +148823,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08076\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08076\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "eedd0b", "Grid": true, "GridProjection": false, @@ -148055,7 +148884,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08072\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08072\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "699a99", "Grid": true, "GridProjection": false, @@ -148117,7 +148946,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08120\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08120\",\n \"type\": \"Asset\",\n \"class\": \"Guardian|Mystic|Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0e64cb", "Grid": true, "GridProjection": false, @@ -148179,7 +149008,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08073\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08073\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b460e1", "Grid": true, "GridProjection": false, @@ -148241,7 +149070,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08118\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Blessed. Weapon. Ranged.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08118\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2|Arcane\",\n \"class\": \"Mystic|Survivor\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Spell. Blessed. Weapon. Ranged.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "f85d4e", "Grid": true, "GridProjection": false, @@ -148303,7 +149132,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08121\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Seeker|Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08121\",\n \"type\": \"Asset\",\n \"class\": \"Guardian|Seeker|Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1bdb15", "Grid": true, "GridProjection": false, @@ -148365,7 +149194,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08122\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Rogue|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"replenish\": 2,\r\n \"type\": \"Resource\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08122\",\n \"type\": \"Asset\",\n \"class\": \"Guardian|Rogue|Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"replenish\": 2,\n \"type\": \"Resource\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8ec9cb", "Grid": true, "GridProjection": false, @@ -148427,7 +149256,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic|Survivor\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08117\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic|Survivor\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1d6d47", "Grid": true, "GridProjection": false, @@ -148489,7 +149318,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08071\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08071\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e5f541", "Grid": true, "GridProjection": false, @@ -148498,7 +149327,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShortSupply\")\nend)\n__bundle_register(\"playercards/cards/ShortSupply\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nfunction onLoad()\n self.addContextMenuItem(\"Discard 10 cards\", shortSupply)\nend\n\n-- called by context menu entry\nfunction shortSupply(color)\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n\n -- get draw deck and discard position\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n local drawDeck = deckAreaObjects.draw\n local discardPos = playmatApi.getDiscardPosition(matColor)\n\n -- error handling\n if discardPos == nil then\n broadcastToColor(\"Couldn't retrieve discard position from playermat!\", color, \"Red\")\n return\n end\n\n if drawDeck == nil then\n broadcastToColor(\"Deck not found!\", color, \"Yellow\")\n return\n elseif drawDeck.type ~= \"Deck\" then\n broadcastToColor(\"Deck only contains a single card!\", color, \"Yellow\")\n return\n end\n\n -- discard cards\n broadcastToColor(\"Discarding top 10 cards for player color '\" .. matColor .. \"'.\", color, \"White\")\n for i = 1, 10 do\n drawDeck.takeObject({ flip = true, position = { discardPos.x, 2 + 0.075 * i, discardPos.z } })\n end\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ShortSupply\")\nend)\n__bundle_register(\"playercards/cards/ShortSupply\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nfunction onLoad()\n self.addContextMenuItem(\"Discard 10 cards\", shortSupply)\nend\n\n-- called by context menu entry\nfunction shortSupply(color)\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n\n -- get draw deck and discard position\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n local drawDeck = deckAreaObjects.draw\n local discardPos = playmatApi.getDiscardPosition(matColor)\n\n -- error handling\n if discardPos == nil then\n broadcastToColor(\"Couldn't retrieve discard position from playermat!\", color, \"Red\")\n return\n end\n\n if drawDeck == nil then\n broadcastToColor(\"Deck not found!\", color, \"Yellow\")\n return\n elseif drawDeck.type ~= \"Deck\" then\n broadcastToColor(\"Deck only contains a single card!\", color, \"Yellow\")\n return\n end\n\n -- discard cards, waiting 0.7 seconds between each discard to give players visiblity of the cards\n broadcastToColor(\"Discarding top 10 cards for player color '\" .. matColor .. \"'.\", color, \"White\")\n for i = 1, 10 do\n Wait.time(function() drawDeck.takeObject({ flip = true, position = { discardPos.x, 2 + 0.075 * i, discardPos.z } }) end, .7 * (i - 1))\n end\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -148551,7 +149380,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08119\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic|Survivor\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08119\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic|Survivor\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "57f037", "Grid": true, "GridProjection": false, @@ -148613,7 +149442,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08107\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08107\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker|Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tool. Melee.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "70f9f7", "Grid": true, "GridProjection": false, @@ -148675,7 +149504,7 @@ }, "Description": "From a Future Life", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08115\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Charm. Cursed.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08115\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue|Survivor\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Charm. Cursed.\",\n \"wildIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "358be4", "Grid": true, "GridProjection": false, @@ -148737,7 +149566,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08116\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic|Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08116\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic|Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "7b4b0c", "Grid": true, "GridProjection": false, @@ -148799,7 +149628,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08113\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Survivor\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Pact.\",\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08113\",\n \"type\": \"Asset\",\n \"class\": \"Rogue|Survivor\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Pact.\",\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "57b95d", "Grid": true, "GridProjection": false, @@ -148861,7 +149690,7 @@ }, "Description": "Finder of Hidden Connections", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08106\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08106\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker|Survivor\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1905cf", "Grid": true, "GridProjection": false, @@ -148923,7 +149752,7 @@ }, "Description": "Enigmatic Warlock", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08091\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08091\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian|Mystic\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Ally. Sorcerer.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "6c5628", "Grid": true, "GridProjection": false, @@ -148985,7 +149814,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08096\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Tool. Weapon. Melee.\",\r\n \"combatIcons\": 3,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08096\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian|Survivor\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 3,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "ae3ff5", "Grid": true, "GridProjection": false, @@ -149047,7 +149876,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08098\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08098\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker|Rogue\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "be4332", "Grid": true, "GridProjection": false, @@ -149109,7 +149938,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08110\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue|Mystic\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Trick.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08110\",\n \"type\": \"Event\",\n \"class\": \"Rogue|Mystic\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell. Trick.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "39cb5b", "Grid": true, "GridProjection": false, @@ -149170,7 +149999,7 @@ }, "Description": "From a Former Life", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08114\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Charm. Blessed.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08114\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue|Survivor\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Charm. Blessed.\",\n \"wildIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "f69d3f", "Grid": true, "GridProjection": false, @@ -149232,7 +150061,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08103\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Mystic\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell. Augury.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08103\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker|Mystic\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell. Augury.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "58f2af", "Grid": true, "GridProjection": false, @@ -149294,7 +150123,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08105\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08105\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker|Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Item. Tool. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8b065c", "Grid": true, "GridProjection": false, @@ -149356,7 +150185,7 @@ }, "Description": "Finder of Hidden Connections", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08104\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08104\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker|Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "cc8571", "Grid": true, "GridProjection": false, @@ -149418,7 +150247,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08108\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue|Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Trick.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08108\",\n \"type\": \"Event\",\n \"class\": \"Rogue|Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell. Trick.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "31539a", "Grid": true, "GridProjection": false, @@ -149479,7 +150308,7 @@ }, "Description": "Intrepid Explorer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08099\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue\",\r\n \"cost\": 5,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08099\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker|Rogue\",\n \"cost\": 5,\n \"level\": 3,\n \"traits\": \"Ally. Wayfarer.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "255aa3", "Grid": true, "GridProjection": false, @@ -149541,7 +150370,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08102\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker|Mystic\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08102\",\n \"type\": \"Event\",\n \"class\": \"Seeker|Mystic\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "91204c", "Grid": true, "GridProjection": false, @@ -149602,7 +150431,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08100\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08100\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker|Rogue\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "d3ad2d", "Grid": true, "GridProjection": false, @@ -149664,7 +150493,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08097\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker|Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08097\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker|Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "98eb87", "Grid": true, "GridProjection": false, @@ -149726,7 +150555,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08087\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian|Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08087\",\n \"type\": \"Event\",\n \"class\": \"Guardian|Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "79cbc6", "Grid": true, "GridProjection": false, @@ -149787,7 +150616,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08085\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian|Seeker\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08085\",\n \"type\": \"Event\",\n \"class\": \"Guardian|Seeker\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Insight. Tactic.\",\n \"intellectIcons\": 2,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b94090", "Grid": true, "GridProjection": false, @@ -149848,7 +150677,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08090\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08090\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian|Mystic\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0fff60", "Grid": true, "GridProjection": false, @@ -149910,7 +150739,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08093\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic\",\r\n \"cost\": 5,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\",\r\n \"willpowerIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08093\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian|Mystic\",\n \"cost\": 5,\n \"level\": 5,\n \"traits\": \"Item. Relic. Weapon. Melee.\",\n \"willpowerIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "4df3b9", "Grid": true, "GridProjection": false, @@ -149972,7 +150801,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08092\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 9,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08092\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian|Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 9,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "200b64", "Grid": true, "GridProjection": false, @@ -150034,7 +150863,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08089\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Rogue\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Item. Tool. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08089\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian|Rogue\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Tool. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "859736", "Grid": true, "GridProjection": false, @@ -150096,7 +150925,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08094\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08094\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian|Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "78fdc7", "Grid": true, "GridProjection": false, @@ -150158,7 +150987,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08088\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian|Rogue\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08088\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian|Rogue\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "7eb1ec", "Grid": true, "GridProjection": false, @@ -150220,7 +151049,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08084\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian|Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08084\",\n \"type\": \"Event\",\n \"class\": \"Guardian|Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight. Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "4e4179", "Grid": true, "GridProjection": false, @@ -150281,7 +151110,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08132\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08132\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "93e52d", "Grid": true, "GridProjection": false, @@ -150342,7 +151171,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08133\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08133\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "a42bcf", "Grid": true, "GridProjection": false, @@ -150403,7 +151232,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08069\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Composure.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08069\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Talent. Composure.\",\n \"wildIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "edb064", "Grid": true, "GridProjection": false, @@ -150465,7 +151294,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08131\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Injury.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08131\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Injury.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "46b4a0", "Grid": true, "GridProjection": false, @@ -150526,7 +151355,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08068\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08068\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "f2726b", "Grid": true, "GridProjection": false, @@ -150588,7 +151417,7 @@ }, "Description": "Reworking Reality", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08070\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"replenish\": 1,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08070\",\n \"type\": \"Asset\",\n \"slot\": \"Hand|Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Item. Relic. Tome.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"replenish\": 1,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "79870f", "Grid": true, "GridProjection": false, @@ -150650,7 +151479,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08130\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Injury.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08130\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Injury.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8f1420", "Grid": true, "GridProjection": false, @@ -150711,7 +151540,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08065\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08065\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 1,\n \"traits\": \"Practiced. Expert.\",\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "49a338", "Grid": true, "GridProjection": false, @@ -150772,7 +151601,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08062\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Ritual. Synergy.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08062\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Ritual. Synergy.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "d02825", "Grid": true, "GridProjection": false, @@ -150834,7 +151663,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08047\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08047\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight. Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "927d34", "Grid": true, "GridProjection": false, @@ -150895,7 +151724,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08050\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Trick. Synergy.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08050\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Trick. Synergy.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "f6d572", "Grid": true, "GridProjection": false, @@ -150956,7 +151785,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08064\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Augury.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08064\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Augury.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "c09a15", "Grid": true, "GridProjection": false, @@ -151017,7 +151846,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08066\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Augury.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08066\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Augury.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "583026", "Grid": true, "GridProjection": false, @@ -151078,7 +151907,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08056\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Composure.\",\r\n \"willpowerIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08056\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Talent. Composure.\",\n \"willpowerIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "6b3a27", "Grid": true, "GridProjection": false, @@ -151140,7 +151969,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08054\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Favor. Gambit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08054\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Favor. Gambit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "67eb69", "Grid": true, "GridProjection": false, @@ -151201,7 +152030,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08055\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Favor.\",\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08055\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Favor.\",\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "20da53", "Grid": true, "GridProjection": false, @@ -151262,7 +152091,7 @@ }, "Description": "Broken but Reliable", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08053\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08053\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "814c79", "Grid": true, "GridProjection": false, @@ -151385,7 +152214,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08052\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 1,\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08052\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 1,\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 1,\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5e3aac", "Grid": true, "GridProjection": false, @@ -151446,7 +152275,7 @@ }, "Description": "Broken but Reliable", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08058\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 0,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08058\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 5,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 2,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "696894", "Grid": true, "GridProjection": false, @@ -151508,7 +152337,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Clothing. Footwear.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08035\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Clothing. Footwear.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b03e83", "Grid": true, "GridProjection": false, @@ -151570,7 +152399,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08059\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08059\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b925fc", "Grid": true, "GridProjection": false, @@ -151632,7 +152461,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08037\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08037\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 1,\n \"traits\": \"Practiced. Expert.\",\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "6aa5dc", "Grid": true, "GridProjection": false, @@ -151693,7 +152522,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08031\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Talent. Ritual.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08031\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Talent. Ritual.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "fa06f9", "Grid": true, "GridProjection": false, @@ -151755,7 +152584,7 @@ }, "Description": "Symbol of Power", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08057\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08057\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Relic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "3eafd5", "Grid": true, "GridProjection": false, @@ -151817,7 +152646,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08051\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Favor.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08051\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Favor.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "69289f", "Grid": true, "GridProjection": false, @@ -151878,7 +152707,7 @@ }, "Description": "Gateway to Tindalos", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08041\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Leyline\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08041\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1fdf4c", "Grid": true, "GridProjection": false, @@ -151940,7 +152769,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08049\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Favor. Service.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08049\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Favor. Service.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "fad52a", "Grid": true, "GridProjection": false, @@ -152001,7 +152830,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08028\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08028\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "a336de", "Grid": true, "GridProjection": false, @@ -152062,7 +152891,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08046\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Favor. Illicit.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08046\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Favor. Illicit.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8190ac", "Grid": true, "GridProjection": false, @@ -152124,7 +152953,7 @@ }, "Description": "Unidentified", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"08033\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome. Occult.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", + "GMNotes": "{\n \"id\": \"08033\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome. Occult.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8023f5", "Grid": true, "GridProjection": false, @@ -152186,7 +153015,7 @@ }, "Description": "Gateway to Aldebaran", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08043\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"agilityIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Leyline\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08043\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"agilityIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "4b1b99", "Grid": true, "GridProjection": false, @@ -152248,7 +153077,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08048\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Gambit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08048\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Fortune. Gambit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5210c2", "Grid": true, "GridProjection": false, @@ -152309,7 +153138,7 @@ }, "Description": "Gateway to Acheron", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08042\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Leyline\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08042\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "88ff66", "Grid": true, "GridProjection": false, @@ -152371,7 +153200,7 @@ }, "Description": "Atlas of the Unknowable", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08045\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 5,\r\n \"traits\": \"Item. Relic. Tome.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08045\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 5,\n \"traits\": \"Item. Relic. Tome.\",\n \"wildIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "55999d", "Grid": true, "GridProjection": false, @@ -152433,7 +153262,7 @@ }, "Description": "Gateway to Paradise", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08044\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Leyline\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08044\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Leyline\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "098132", "Grid": true, "GridProjection": false, @@ -152495,7 +153324,7 @@ }, "Description": "Arctic Archaeologist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic. Wayfarer.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08032\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic. Wayfarer.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "98e5f5", "Grid": true, "GridProjection": false, @@ -152557,7 +153386,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08038\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08038\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0d3bfa", "Grid": true, "GridProjection": false, @@ -152619,7 +153448,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08026\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08026\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "9ab750", "Grid": true, "GridProjection": false, @@ -152680,7 +153509,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08027\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Composure.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08027\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Talent. Composure.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "36efa2", "Grid": true, "GridProjection": false, @@ -152742,7 +153571,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08039\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08039\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "3a4edd", "Grid": true, "GridProjection": false, @@ -152803,7 +153632,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08030\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08030\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0a312f", "Grid": true, "GridProjection": false, @@ -152865,7 +153694,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08024\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 1,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08024\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 1,\n \"traits\": \"Practiced. Expert.\",\n \"dynamicIcons\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "62e4f4", "Grid": true, "GridProjection": false, @@ -152926,7 +153755,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08022\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Spirit. Synergy.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08022\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Spirit. Synergy.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "09cc35", "Grid": true, "GridProjection": false, @@ -152987,7 +153816,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08021\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08021\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "76270e", "Grid": true, "GridProjection": false, @@ -153048,7 +153877,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08020\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit. Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08020\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit. Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "58288b", "Grid": true, "GridProjection": false, @@ -153109,7 +153938,7 @@ }, "Description": "Quiescence of Thought", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08012a\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Unbroken.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08012a\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Unbroken.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "081db4", "Grid": true, "GridProjection": false, @@ -153171,7 +154000,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08018\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08018\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0ca36f", "Grid": true, "GridProjection": false, @@ -153232,7 +154061,7 @@ }, "Description": "Alignment of Spirit", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08011a\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Unbroken.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08011a\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Unbroken.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "5ff3bd", "Grid": true, "GridProjection": false, @@ -153294,7 +154123,7 @@ }, "Description": "Prescience of Fate", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08013a\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Unbroken.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08013a\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Unbroken.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e8d38d", "Grid": true, "GridProjection": false, @@ -153356,7 +154185,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08015\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08015\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "45c19e", "Grid": true, "GridProjection": false, @@ -153417,7 +154246,7 @@ }, "Description": "Balance of Body", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08014a\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Unbroken.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08014a\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Unbroken.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "3247da", "Grid": true, "GridProjection": false, @@ -153479,7 +154308,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08017\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08017\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "c70129", "Grid": true, "GridProjection": false, @@ -153539,9 +154368,9 @@ "UniqueBack": false } }, - "Description": "Weakness", + "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08009\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Mystery.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08009\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Mystery.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "28080d", "Grid": true, "GridProjection": false, @@ -153576,6 +154405,67 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "133": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520416/34030F3F4E7DB48038BAC2BB6010D4781C102301/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Advanced", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"90064\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Mystery.\",\n \"weakness\": true,\n \"cycle\": \"Relics of the Past\"\n}", + "GUID": "28080e", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Buried Secrets", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.202, + "posY": 2.672, + "posZ": -16.735, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -153602,7 +154492,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08002\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08002\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tool. Melee.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "598ba0", "Grid": true, "GridProjection": false, @@ -153664,7 +154554,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08082\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Gambit. Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08082\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Gambit. Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0c2449", "Grid": true, "GridProjection": false, @@ -153725,7 +154615,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08036\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 5,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Synergy.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08036\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 5,\n \"level\": 1,\n \"traits\": \"Insight. Synergy.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "6367dd", "Grid": true, "GridProjection": false, @@ -153786,7 +154676,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08029\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08029\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e2dc13", "Grid": true, "GridProjection": false, @@ -153847,7 +154737,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04313\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Spell. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04313\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Spell. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "83c86b", "Grid": true, "GridProjection": false, @@ -153908,7 +154798,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"82025\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Mask.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"82025\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Mask.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "adf028", "Grid": true, "GridProjection": false, @@ -153970,7 +154860,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02268\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 2,\r\n \"traits\": \"Innate. Developed.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02268\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 2,\n \"traits\": \"Innate. Developed.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "b2e27e", "Grid": true, "GridProjection": false, @@ -154031,7 +154921,7 @@ }, "Description": "Skilled Botanist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"53037\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Ally. Wayfarer.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Return to the Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"53037\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Ally. Wayfarer.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Return to the Forgotten Age\"\n}", "GUID": "a0c2da", "Grid": true, "GridProjection": false, @@ -154093,7 +154983,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03023\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "bb640d", "Grid": true, "GridProjection": false, @@ -154154,7 +155044,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Spirit. Tactic. Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08023\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Spirit. Tactic. Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b4d67b", "Grid": true, "GridProjection": false, @@ -154215,7 +155105,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60127\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Weapon.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60127\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Weapon.\",\n \"combatIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "54293e", "Grid": true, "GridProjection": false, @@ -154277,7 +155167,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04195\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04195\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "77f92c", "Grid": true, "GridProjection": false, @@ -154338,7 +155228,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08019\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08019\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "028cf7", "Grid": true, "GridProjection": false, @@ -154400,7 +155290,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08112\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue|Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Gambit.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08112\",\n \"type\": \"Event\",\n \"class\": \"Rogue|Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Fortune. Gambit.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "431c15", "Grid": true, "GridProjection": false, @@ -154461,7 +155351,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08040\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Composure.\",\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08040\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Talent. Composure.\",\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "158450", "Grid": true, "GridProjection": false, @@ -154523,7 +155413,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03012\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03012\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "dfd48b", "Grid": true, "GridProjection": false, @@ -154584,7 +155474,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06275\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06275\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "3bf831", "Grid": true, "GridProjection": false, @@ -154645,7 +155535,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03018\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Insight.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03018\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Insight.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "9aee7f", "Grid": true, "GridProjection": false, @@ -154706,7 +155596,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06014\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06014\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "d12359", "Grid": true, "GridProjection": false, @@ -154767,7 +155657,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06015a\",\r\n \"alternate_ids\": [\r\n \"06015b\"\r\n ],\r\n \"type\": \"Location\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Dreamlands.\",\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06015a\",\n \"alternate_ids\": [\n \"06015b\"\n ],\n \"type\": \"Location\",\n \"class\": \"Neutral\",\n \"traits\": \"Dreamlands.\",\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "fa4c1e", "Grid": true, "GridProjection": false, @@ -154829,7 +155719,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06196\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06196\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "7dc42a", "Grid": true, "GridProjection": false, @@ -154891,7 +155781,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60524\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"intellectIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60524\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"intellectIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "fd393b", "Grid": true, "GridProjection": false, @@ -154952,7 +155842,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02150\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 2,\r\n \"traits\": \"Practiced. Expert.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02150\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 2,\n \"traits\": \"Practiced. Expert.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "95272b", "Grid": true, "GridProjection": false, @@ -155013,7 +155903,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02233\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02233\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "194adb", "Grid": true, "GridProjection": false, @@ -155075,7 +155965,7 @@ }, "Description": "The Entertainer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05006\",\r\n \"alternate_ids\": [\r\n \"99001\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Performer. Sorcerer.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05006\",\n \"alternate_ids\": [\n \"99001\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Performer. Sorcerer.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 4,\n \"combatIcons\": 1,\n \"agilityIcons\": 3,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "11122f", "Grid": true, "GridProjection": false, @@ -155137,7 +156027,7 @@ }, "Description": "The Fed", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01001-p\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Agency. Detective.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01001-p\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Agency. Detective.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "502768", "Grid": true, "GridProjection": false, @@ -155199,7 +156089,7 @@ }, "Description": "The Ex-Con", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01003-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01003-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "a03077", "Grid": true, "GridProjection": false, @@ -155261,7 +156151,7 @@ }, "Description": "The Athlete", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05005\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 5,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05005\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 5,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "bb8296", "Grid": true, "GridProjection": false, @@ -155323,7 +156213,7 @@ }, "Description": "The Writer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"98019\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Clairvoyant.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Promo\"\r\n}\r", + "GMNotes": "{\n \"id\": \"98019\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Clairvoyant.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Promo\"\n}", "GUID": "571596", "Grid": true, "GridProjection": false, @@ -155385,7 +156275,7 @@ }, "Description": "The Bounty Hunter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06003\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal. Hunter.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 5,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06003\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal. Hunter.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 3,\n \"combatIcons\": 5,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "53a412", "Grid": true, "GridProjection": false, @@ -155447,7 +156337,7 @@ }, "Description": "The Spy", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07003\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Agency. Detective.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07003\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Agency. Detective.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 4,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "333fe7", "Grid": true, "GridProjection": false, @@ -155509,7 +156399,7 @@ }, "Description": "The Dreamer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Dreamer. Drifter. Wayfarer.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06004\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Dreamer. Drifter. Wayfarer.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "c59b75", "Grid": true, "GridProjection": false, @@ -155571,7 +156461,7 @@ }, "Description": "The Priest", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Believer. Warden.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04004\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Believer. Warden.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "eb96e6", "Grid": true, "GridProjection": false, @@ -155633,7 +156523,7 @@ }, "Description": "The Salesman", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08016\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Entrepreneur.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08016\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Entrepreneur.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 4,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "419b0c", "Grid": true, "GridProjection": false, @@ -155695,7 +156585,7 @@ }, "Description": "The Gravedigger", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03005\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Warden.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03005\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Warden.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 4,\n \"agilityIcons\": 3,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "7e4c56", "Grid": true, "GridProjection": false, @@ -155757,7 +156647,7 @@ }, "Description": "The Haunted", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04005\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Cursed. Drifter.\",\r\n \"willpowerIcons\": 0,\r\n \"intellectIcons\": 0,\r\n \"combatIcons\": 0,\r\n \"agilityIcons\": 0,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04005\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Cursed. Drifter.\",\n \"willpowerIcons\": 0,\n \"intellectIcons\": 0,\n \"combatIcons\": 0,\n \"agilityIcons\": 0,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "b02a1e", "Grid": true, "GridProjection": false, @@ -155819,7 +156709,7 @@ }, "Description": "The Violinist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06005\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Performer. Cursed.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06005\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Performer. Cursed.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "a7b79f", "Grid": true, "GridProjection": false, @@ -155881,7 +156771,7 @@ }, "Description": "The Martial Artist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08010\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Chosen. Warden.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08010\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Chosen. Warden.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 4,\n \"agilityIcons\": 3,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "cc21e0", "Grid": true, "GridProjection": false, @@ -155943,7 +156833,7 @@ }, "Description": "The Shaman", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03004\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "452ed8", "Grid": true, "GridProjection": false, @@ -156005,7 +156895,7 @@ }, "Description": "The Student", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic. Scholar.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic. Scholar.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "05b950", "Grid": true, "GridProjection": false, @@ -156067,7 +156957,7 @@ }, "Description": "The Secretary", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Assistant.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Assistant.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "6c4c58", "Grid": true, "GridProjection": false, @@ -156129,7 +157019,7 @@ }, "Description": "The Researcher", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Assistant. Scholar.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Assistant. Scholar.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 5,\n \"combatIcons\": 1,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "57d586", "Grid": true, "GridProjection": false, @@ -156191,7 +157081,7 @@ }, "Description": "The Explorer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Wayfarer.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Wayfarer.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 4,\n \"combatIcons\": 1,\n \"agilityIcons\": 4,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "07c37d", "Grid": true, "GridProjection": false, @@ -156253,7 +157143,7 @@ }, "Description": "The Letter Carrier", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60501\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Chosen. Civic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60501\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Chosen. Civic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "00e18e", "Grid": true, "GridProjection": false, @@ -156315,7 +157205,7 @@ }, "Description": "The Nun", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Believer. Blessed.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Believer. Blessed.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "617aeb", "Grid": true, "GridProjection": false, @@ -156377,7 +157267,7 @@ }, "Description": "The Drifter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02005\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02005\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "5294c3", "Grid": true, "GridProjection": false, @@ -156439,7 +157329,7 @@ }, "Description": "The Soldier", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Veteran.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 5,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Veteran.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 5,\n \"agilityIcons\": 3,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "01ac1b", "Grid": true, "GridProjection": false, @@ -156501,7 +157391,7 @@ }, "Description": "The Rookie Cop", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Police. Warden.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Police. Warden.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "e637cd", "Grid": true, "GridProjection": false, @@ -156563,7 +157453,7 @@ }, "Description": "The Mechanic", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Entrepreneur.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 5,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Entrepreneur.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 1,\n \"combatIcons\": 5,\n \"agilityIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "444830", "Grid": true, "GridProjection": false, @@ -156625,7 +157515,7 @@ }, "Description": "The Expedition Leader", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"04001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Veteran. Wayfarer.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Forgotten Age\"\r\n}\r", + "GMNotes": "{\n \"id\": \"04001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Veteran. Wayfarer.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 1,\n \"cycle\": \"The Forgotten Age\"\n}", "GUID": "126932", "Grid": true, "GridProjection": false, @@ -156687,7 +157577,7 @@ }, "Description": "The Psychic", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60401\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Clairvoyant.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60401\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Clairvoyant.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 3,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "a2cd75", "Grid": true, "GridProjection": false, @@ -156749,7 +157639,7 @@ }, "Description": "The Ex-Con", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01003-pf\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01003-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "8116a6", "Grid": true, "GridProjection": false, @@ -156811,7 +157701,7 @@ }, "Description": "The Ex-Con", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01003-p\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01003-p\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "22ebb2", "Grid": true, "GridProjection": false, @@ -156873,7 +157763,7 @@ }, "Description": "The Librarian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01002-p\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01002-p\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "282857", "Grid": true, "GridProjection": false, @@ -156935,7 +157825,7 @@ }, "Description": "The Librarian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01002-pf\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01002-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "e8cafc", "Grid": true, "GridProjection": false, @@ -156997,7 +157887,7 @@ }, "Description": "The Librarian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01002-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01002-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "2f2e0d", "Grid": true, "GridProjection": false, @@ -157059,7 +157949,7 @@ }, "Description": "The Fed", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01001-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Agency. Detective.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01001-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Agency. Detective.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "560cef", "Grid": true, "GridProjection": false, @@ -157121,7 +158011,7 @@ }, "Description": "The Fed", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01001-pf\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Agency. Detective.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01001-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Agency. Detective.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "f7361e", "Grid": true, "GridProjection": false, @@ -157183,7 +158073,7 @@ }, "Description": "The Aviatrix", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60301\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 5,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60301\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 5,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "cd4028", "Grid": true, "GridProjection": false, @@ -157245,7 +158135,7 @@ }, "Description": "The Professor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60201\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60201\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 5,\n \"combatIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "1fa944", "Grid": true, "GridProjection": false, @@ -157307,7 +158197,7 @@ }, "Description": "The Boxer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60101\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Criminal. Warden.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 5,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60101\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Criminal. Warden.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 5,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "65588a", "Grid": true, "GridProjection": false, @@ -157369,7 +158259,7 @@ }, "Description": "The Millionaire", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05003\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Silver Twilight. Socialite.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05003\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Silver Twilight. Socialite.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "5e6298", "Grid": true, "GridProjection": false, @@ -157431,7 +158321,7 @@ }, "Description": "The Redeemed Cultist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Cultist. Silver Twilight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05004\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Cultist. Silver Twilight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "32b091", "Grid": true, "GridProjection": false, @@ -157493,7 +158383,7 @@ }, "Description": "The Chef", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Believer. Hunter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Believer. Hunter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "98a0e1", "Grid": true, "GridProjection": false, @@ -157741,7 +158631,7 @@ }, "Description": "The Musician", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Performer.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02004\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Performer.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "ca079b", "Grid": true, "GridProjection": false, @@ -157803,7 +158693,7 @@ }, "Description": "The Private Investigator", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Detective.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Detective.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 4,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "6dc626", "Grid": true, "GridProjection": false, @@ -157865,7 +158755,7 @@ }, "Description": "The Waitress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01004-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01004-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"Core\"\n}", "GUID": "909f30", "Grid": true, "GridProjection": false, @@ -157927,7 +158817,7 @@ }, "Description": "The Actress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03006\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Performer.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03006\",\n \"type\": \"Investigator\",\n \"class\": \"Neutral\",\n \"traits\": \"Performer.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "d37332", "Grid": true, "GridProjection": false, @@ -157989,7 +158879,7 @@ }, "Description": "The Waitress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01004-pf\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01004-pf\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"Core\"\n}", "GUID": "02db0a", "Grid": true, "GridProjection": false, @@ -158051,7 +158941,7 @@ }, "Description": "The Waitress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01004-p\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01004-p\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"Core\"\n}", "GUID": "01b6ef", "Grid": true, "GridProjection": false, @@ -159821,7 +160711,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05006-m\",\r\n \"alternate_ids\": [\r\n \"99001-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05006-m\",\n \"alternate_ids\": [\n \"99001-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "b05c03", "Grid": true, "GridProjection": false, @@ -160370,7 +161260,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08620\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Expedition.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08620\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Expedition.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "9e136f", "Grid": true, "GridProjection": false, @@ -160432,7 +161322,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08619\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Expedition.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08619\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Expedition.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "c9feda", "Grid": true, "GridProjection": false, @@ -160494,7 +161384,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08618\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Relic. Expedition.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08618\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Relic. Expedition.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "08dd86", "Grid": true, "GridProjection": false, @@ -160556,7 +161446,7 @@ }, "Description": "Strange Evidence", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08617\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Relic. Expedition.\",\r\n \"willpowerIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08617\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Relic. Expedition.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "bad631", "Grid": true, "GridProjection": false, @@ -160618,7 +161508,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08616\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Expedition.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08616\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Expedition.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "793df5", "Grid": true, "GridProjection": false, @@ -160680,7 +161570,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08615\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Expedition.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08615\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Expedition.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "991640", "Grid": true, "GridProjection": false, @@ -160742,7 +161632,7 @@ }, "Description": "Jinxed Idol", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08614\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Item. Expedition.\",\r\n \"combatIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08614\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Item. Expedition.\",\n \"combatIcons\": 2,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "d36d80", "Grid": true, "GridProjection": false, @@ -160804,7 +161694,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08729\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08729\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0ef2ba", "Grid": true, "GridProjection": false, @@ -160865,7 +161755,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08728\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08728\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "05e697", "Grid": true, "GridProjection": false, @@ -160926,7 +161816,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08727\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08727\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "361f15", "Grid": true, "GridProjection": false, @@ -160987,7 +161877,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08726\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08726\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "f5bd65", "Grid": true, "GridProjection": false, @@ -161048,7 +161938,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08725\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08725\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "0ba293", "Grid": true, "GridProjection": false, @@ -161109,7 +161999,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08724\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08724\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "76409f", "Grid": true, "GridProjection": false, @@ -161170,7 +162060,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08723\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08723\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "519e41", "Grid": true, "GridProjection": false, @@ -161231,7 +162121,7 @@ }, "Description": "Weakness.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08646\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Injury.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08646\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Injury.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8abd77", "Grid": true, "GridProjection": false, @@ -161292,7 +162182,7 @@ }, "Description": "Weakness.", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08647\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08647\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "04b3a9", "Grid": true, "GridProjection": false, @@ -161353,7 +162243,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08736\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08736\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Science.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8d6475", "Grid": true, "GridProjection": false, @@ -161415,7 +162305,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08735\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08735\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "8d5c12", "Grid": true, "GridProjection": false, @@ -161477,7 +162367,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08737\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Supply.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08737\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Supply.\",\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e627e8", "Grid": true, "GridProjection": false, @@ -161538,7 +162428,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08733\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08733\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "b12d89", "Grid": true, "GridProjection": false, @@ -161599,7 +162489,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08734\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Clothing. Footwear.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08734\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Clothing. Footwear.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1c751d", "Grid": true, "GridProjection": false, @@ -161661,7 +162551,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08731\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08731\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "d6f719", "Grid": true, "GridProjection": false, @@ -161723,7 +162613,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08730\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Clothing.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08730\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Clothing.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "c1f999", "Grid": true, "GridProjection": false, @@ -161785,7 +162675,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08732\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08732\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "34e723", "Grid": true, "GridProjection": false, @@ -161847,7 +162737,7 @@ }, "Description": "Faithful Companion", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08738\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Creature.\",\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08738\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Creature.\",\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "1bf025", "Grid": true, "GridProjection": false, @@ -161909,7 +162799,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"87032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Item. Science. Tool. Future.\",\r\n \"wildIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"87032\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Science. Tool. Future.\",\n \"wildIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Standalone\"\n}", "GUID": "fb4fff", "Grid": true, "GridProjection": false, @@ -161971,7 +162861,7 @@ }, "Description": "Professor of the Arcane", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"87023\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Scientist. Ally. Present.\",\r\n \"intellectIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"87023\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Scientist. Ally. Present.\",\n \"intellectIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "efe0dd", "Grid": true, "GridProjection": false, @@ -162033,7 +162923,7 @@ }, "Description": "Renowned Inventor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"87014\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Scientist. Ally. Past.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"87014\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Scientist. Ally. Past.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "03695f", "Grid": true, "GridProjection": false, @@ -162095,7 +162985,7 @@ }, "Description": "The Urchin", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01005-pb\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01005-pb\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 1,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "4232d9", "Grid": true, "GridProjection": false, @@ -162281,7 +163171,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90039\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90039\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Standalone\"\n}", "GUID": "664b70", "Grid": true, "GridProjection": false, @@ -162343,7 +163233,7 @@ }, "Description": "Advanced", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90040\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90040\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "89fe92", "Grid": true, "GridProjection": false, @@ -162404,7 +163294,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01515\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01515\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"cycle\": \"Core\"\n}", "GUID": "35a7e9", "Grid": true, "GridProjection": false, @@ -162465,7 +163355,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"90038\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"90038\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"permanent\": true,\n \"cycle\": \"Standalone\"\n}", "GUID": "b4f9ee", "Grid": true, "GridProjection": false, @@ -162527,7 +163417,7 @@ }, "Description": "Coast Guard Captain", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07309\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Blessed.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07309\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Ally. Blessed.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "aa38d0", "Grid": true, "GridProjection": false, @@ -162589,7 +163479,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08008\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"agilityIcons\": 2,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08008\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Weapon. Melee.\",\n \"agilityIcons\": 2,\n \"wildIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "ca9a60", "Grid": true, "GridProjection": false, @@ -162625,6 +163515,68 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "134": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324186517520604/13B2733436FDBFFCAAF9BD76DFE053F96F559A7E/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Advanced", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"90063\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Item. Weapon. Melee.\",\n \"agilityIcons\": 2,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Relics of the Past\"\n}", + "GUID": "ca9a61", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Trusty Bullwhip", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 78.563, + "posY": 3.327, + "posZ": 7.389, + "rotX": 0, + "rotY": 270, + "rotZ": 1, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -162651,7 +163603,7 @@ }, "Description": "Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08003\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Criminal.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08003\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Criminal.\",\n \"weakness\": true,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "fc1506", "Grid": true, "GridProjection": false, @@ -162712,7 +163664,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01521\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01521\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Creature.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "001ae8", "Grid": true, "GridProjection": false, @@ -162774,7 +163726,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01683\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Talent. Science.\",\r\n \"willpowerIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01683\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Talent. Science.\",\n \"willpowerIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "3c7eb1", "Grid": true, "GridProjection": false, @@ -162836,7 +163788,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01573\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01573\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "b9e532", "Grid": true, "GridProjection": false, @@ -162898,7 +163850,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01585\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01585\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "3959fa", "Grid": true, "GridProjection": false, @@ -162959,7 +163911,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01574\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01574\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "14d8ff", "Grid": true, "GridProjection": false, @@ -163021,7 +163973,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01535\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01535\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "85822c", "Grid": true, "GridProjection": false, @@ -163083,7 +164035,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01537\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01537\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "07b7a1", "Grid": true, "GridProjection": false, @@ -163144,7 +164096,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01539\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01539\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "bc4a4c", "Grid": true, "GridProjection": false, @@ -163205,7 +164157,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01519\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01519\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent. Science.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "56b8ad", "Grid": true, "GridProjection": false, @@ -163267,7 +164219,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01591\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01591\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"combatIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "e0881e", "Grid": true, "GridProjection": false, @@ -163328,7 +164280,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01593\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01593\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "853b6c", "Grid": true, "GridProjection": false, @@ -163389,7 +164341,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01545\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01545\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent. Illicit.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "5d04a1", "Grid": true, "GridProjection": false, @@ -163451,7 +164403,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01508\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01508\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "d72b97", "Grid": true, "GridProjection": false, @@ -163513,7 +164465,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01549\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01549\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "132069", "Grid": true, "GridProjection": false, @@ -163575,7 +164527,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01514\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01514\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "05d7d5", "Grid": true, "GridProjection": false, @@ -163637,7 +164589,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01026\",\r\n \"alternate_ids\": [\r\n \"01526\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Supply.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01026\",\n \"alternate_ids\": [\n \"01526\"\n ],\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Supply.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "f60263", "Grid": true, "GridProjection": false, @@ -163698,7 +164650,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01025\",\r\n \"alternate_ids\": [\r\n \"60119\",\r\n \"01525\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01025\",\n \"alternate_ids\": [\n \"60119\",\n \"01525\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "889121", "Grid": true, "GridProjection": false, @@ -163759,7 +164711,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01027\",\r\n \"alternate_ids\": [\r\n \"01527\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01027\",\n \"alternate_ids\": [\n \"01527\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "da46e0", "Grid": true, "GridProjection": false, @@ -163821,7 +164773,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02261\",\r\n \"alternate_ids\": [\r\n \"01684\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 4,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02261\",\n \"alternate_ids\": [\n \"01684\"\n ],\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 4,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "3b6834", "Grid": true, "GridProjection": false, @@ -163882,7 +164834,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01020\",\r\n \"alternate_ids\": [\r\n \"01520\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01020\",\n \"alternate_ids\": [\n \"01520\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "86ee68", "Grid": true, "GridProjection": false, @@ -163944,7 +164896,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01022\",\r\n \"alternate_ids\": [\r\n \"01522\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01022\",\n \"alternate_ids\": [\n \"01522\"\n ],\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "2db518", "Grid": true, "GridProjection": false, @@ -164005,7 +164957,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01024\",\r\n \"alternate_ids\": [\r\n \"01524\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01024\",\n \"alternate_ids\": [\n \"01524\"\n ],\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "97986a", "Grid": true, "GridProjection": false, @@ -164066,7 +165018,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01017\",\r\n \"alternate_ids\": [\r\n \"60108\",\r\n \"01517\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01017\",\n \"alternate_ids\": [\n \"60108\",\n \"01517\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "1165db", "Grid": true, "GridProjection": false, @@ -164128,7 +165080,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01029\",\r\n \"alternate_ids\": [\r\n \"01529\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"combatIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01029\",\n \"alternate_ids\": [\n \"01529\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"combatIcons\": 2,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "c92ea3", "Grid": true, "GridProjection": false, @@ -164190,7 +165142,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01016\",\r\n \"alternate_ids\": [\r\n \"01516\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01016\",\n \"alternate_ids\": [\n \"01516\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "12660b", "Grid": true, "GridProjection": false, @@ -164252,7 +165204,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"06279\",\r\n \"alternate_ids\": [\r\n \"01686\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Dream-Eaters\"\r\n}\r", + "GMNotes": "{\n \"id\": \"06279\",\n \"alternate_ids\": [\n \"01686\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Dream-Eaters\"\n}", "GUID": "8a0060", "Grid": true, "GridProjection": false, @@ -164314,7 +165266,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60227\",\r\n \"alternate_ids\": [\r\n \"01685\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60227\",\n \"alternate_ids\": [\n \"01685\"\n ],\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 2,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "719f7e", "Grid": true, "GridProjection": false, @@ -164375,7 +165327,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01043\",\r\n \"alternate_ids\": [\r\n \"01543\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 4,\r\n \"traits\": \"Insight.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01043\",\n \"alternate_ids\": [\n \"01543\"\n ],\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 4,\n \"traits\": \"Insight.\",\n \"cycle\": \"Core\"\n}", "GUID": "5d25b1", "Grid": true, "GridProjection": false, @@ -164436,7 +165388,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01042\",\r\n \"alternate_ids\": [\r\n \"01542\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Tome.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01042\",\n \"alternate_ids\": [\n \"01542\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Tome.\",\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "f5bcec", "Grid": true, "GridProjection": false, @@ -164498,7 +165450,7 @@ }, "Description": "Protective Amulet", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01041\",\r\n \"alternate_ids\": [\r\n \"01541\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01041\",\n \"alternate_ids\": [\n \"01541\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "b00b76", "Grid": true, "GridProjection": false, @@ -164560,7 +165512,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01040\",\r\n \"alternate_ids\": [\r\n \"01540\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01040\",\n \"alternate_ids\": [\n \"01540\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "378e84", "Grid": true, "GridProjection": false, @@ -164622,7 +165574,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"50004\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Return to the Night of the Zealot\"\r\n}\r", + "GMNotes": "{\n \"id\": \"50004\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Insight. Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Return to the Night of the Zealot\"\n}", "GUID": "3689dd", "Grid": true, "GridProjection": false, @@ -164683,7 +165635,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01038\",\r\n \"alternate_ids\": [\r\n \"01538\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01038\",\n \"alternate_ids\": [\n \"01538\"\n ],\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "edb554", "Grid": true, "GridProjection": false, @@ -164744,7 +165696,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01036\",\r\n \"alternate_ids\": [\r\n \"01536\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01036\",\n \"alternate_ids\": [\n \"01536\"\n ],\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "8cf335", "Grid": true, "GridProjection": false, @@ -164805,7 +165757,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01034\",\r\n \"alternate_ids\": [\r\n \"01534\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01034\",\n \"alternate_ids\": [\n \"01534\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "e5dd39", "Grid": true, "GridProjection": false, @@ -164867,7 +165819,7 @@ }, "Description": "Professor of Entomology", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01033\",\r\n \"alternate_ids\": [\r\n \"01533\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01033\",\n \"alternate_ids\": [\n \"01533\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "9934d2", "Grid": true, "GridProjection": false, @@ -164929,7 +165881,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01032\",\r\n \"alternate_ids\": [\r\n \"01532\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01032\",\n \"alternate_ids\": [\n \"01532\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "8f91ce", "Grid": true, "GridProjection": false, @@ -164991,7 +165943,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01031\",\r\n \"alternate_ids\": [\r\n \"01531\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01031\",\n \"alternate_ids\": [\n \"01531\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "063fd8", "Grid": true, "GridProjection": false, @@ -165053,7 +166005,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01030\",\r\n \"alternate_ids\": [\r\n \"01530\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01030\",\n \"alternate_ids\": [\n \"01530\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "8cc0a6", "Grid": true, "GridProjection": false, @@ -165115,7 +166067,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01044\",\r\n \"alternate_ids\": [\r\n \"60307\",\r\n \"01544\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01044\",\n \"alternate_ids\": [\n \"60307\",\n \"01544\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee. Illicit.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "213853", "Grid": true, "GridProjection": false, @@ -165177,7 +166129,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01046\",\r\n \"alternate_ids\": [\r\n \"01546\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01046\",\n \"alternate_ids\": [\n \"01546\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent. Illicit.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "da7c01", "Grid": true, "GridProjection": false, @@ -165239,7 +166191,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01047\",\r\n \"alternate_ids\": [\r\n \"01547\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01047\",\n \"alternate_ids\": [\n \"01547\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "fe2db3", "Grid": true, "GridProjection": false, @@ -165301,7 +166253,7 @@ }, "Description": "The Louisiana Lion", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01048\",\r\n \"alternate_ids\": [\r\n \"01548\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 6,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01048\",\n \"alternate_ids\": [\n \"01548\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 6,\n \"level\": 0,\n \"traits\": \"Ally. Criminal.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "eaa415", "Grid": true, "GridProjection": false, @@ -165363,7 +166315,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01050\",\r\n \"alternate_ids\": [\r\n \"01550\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01050\",\n \"alternate_ids\": [\n \"01550\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "833305", "Grid": true, "GridProjection": false, @@ -165424,7 +166376,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01051\",\r\n \"alternate_ids\": [\r\n \"01551\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01051\",\n \"alternate_ids\": [\n \"01551\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "cdfd9f", "Grid": true, "GridProjection": false, @@ -165485,7 +166437,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01052\",\r\n \"alternate_ids\": [\r\n \"01552\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01052\",\n \"alternate_ids\": [\n \"01552\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "b18b33", "Grid": true, "GridProjection": false, @@ -165546,7 +166498,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01053\",\r\n \"alternate_ids\": [\r\n \"60319\",\r\n \"01553\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01053\",\n \"alternate_ids\": [\n \"60319\",\n \"01553\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "a88392", "Grid": true, "GridProjection": false, @@ -165607,7 +166559,7 @@ }, "Description": "The Louisiana Lion", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01054\",\r\n \"alternate_ids\": [\r\n \"01554\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 5,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01054\",\n \"alternate_ids\": [\n \"01554\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 5,\n \"level\": 1,\n \"traits\": \"Ally. Criminal.\",\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "27446e", "Grid": true, "GridProjection": false, @@ -165669,7 +166621,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01055\",\r\n \"alternate_ids\": [\r\n \"01555\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 1,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01055\",\n \"alternate_ids\": [\n \"01555\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 1,\n \"traits\": \"Ally. Criminal.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "2fe723", "Grid": true, "GridProjection": false, @@ -165731,7 +166683,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01056\",\r\n \"alternate_ids\": [\r\n \"01556\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Fortune. Insight.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01056\",\n \"alternate_ids\": [\n \"01556\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Fortune. Insight.\",\n \"cycle\": \"Core\"\n}", "GUID": "308be1", "Grid": true, "GridProjection": false, @@ -165792,7 +166744,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01057\",\r\n \"alternate_ids\": [\r\n \"01557\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Fortune.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01057\",\n \"alternate_ids\": [\n \"01557\"\n ],\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "4eb231", "Grid": true, "GridProjection": false, @@ -165853,7 +166805,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03031\",\r\n \"alternate_ids\": [\r\n \"01687\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 1,\r\n \"traits\": \"Item. Tool. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03031\",\n \"alternate_ids\": [\n \"01687\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 1,\n \"traits\": \"Item. Tool. Illicit.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "edd6c4", "Grid": true, "GridProjection": false, @@ -165915,7 +166867,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03234\",\r\n \"alternate_ids\": [\r\n \"01688\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03234\",\n \"alternate_ids\": [\n \"01688\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Firearm. Illicit.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "f57af7", "Grid": true, "GridProjection": false, @@ -165977,7 +166929,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01058\",\r\n \"alternate_ids\": [\r\n \"01558\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01058\",\n \"alternate_ids\": [\n \"01558\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "80acd2", "Grid": true, "GridProjection": false, @@ -166039,7 +166991,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01059\",\r\n \"alternate_ids\": [\r\n \"01559\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01059\",\n \"alternate_ids\": [\n \"01559\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "fa1d67", "Grid": true, "GridProjection": false, @@ -166101,7 +167053,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01060\",\r\n \"alternate_ids\": [\r\n \"01560\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01060\",\n \"alternate_ids\": [\n \"01560\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "914053", "Grid": true, "GridProjection": false, @@ -166163,7 +167115,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01061\",\r\n \"alternate_ids\": [\r\n \"01561\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01061\",\n \"alternate_ids\": [\n \"01561\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "8a927c", "Grid": true, "GridProjection": false, @@ -166225,7 +167177,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01062\",\r\n \"alternate_ids\": [\r\n \"01562\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01062\",\n \"alternate_ids\": [\n \"01562\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "9e4505", "Grid": true, "GridProjection": false, @@ -166287,7 +167239,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01063\",\r\n \"alternate_ids\": [\r\n \"01563\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Sorcerer.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Doom\",\r\n \"token\": \"doom\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01063\",\n \"alternate_ids\": [\n \"01563\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ally. Sorcerer.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Doom\",\n \"token\": \"doom\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "7307c4", "Grid": true, "GridProjection": false, @@ -166349,7 +167301,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01064\",\r\n \"alternate_ids\": [\r\n \"01564\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01064\",\n \"alternate_ids\": [\n \"01564\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "a8298f", "Grid": true, "GridProjection": false, @@ -166410,7 +167362,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01065\",\r\n \"alternate_ids\": [\r\n \"01565\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell. Spirit.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01065\",\n \"alternate_ids\": [\n \"01565\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell. Spirit.\",\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "6656ad", "Grid": true, "GridProjection": false, @@ -166471,7 +167423,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01066\",\r\n \"alternate_ids\": [\r\n \"01566\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01066\",\n \"alternate_ids\": [\n \"01566\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "30f860", "Grid": true, "GridProjection": false, @@ -166532,7 +167484,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01067\",\r\n \"alternate_ids\": [\r\n \"01567\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01067\",\n \"alternate_ids\": [\n \"01567\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "cd0ac1", "Grid": true, "GridProjection": false, @@ -166593,7 +167545,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01068\",\r\n \"alternate_ids\": [\r\n \"01568\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01068\",\n \"alternate_ids\": [\n \"01568\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "5d6e57", "Grid": true, "GridProjection": false, @@ -166654,7 +167606,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01069\",\r\n \"alternate_ids\": [\r\n \"01569\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01069\",\n \"alternate_ids\": [\n \"01569\"\n ],\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "8254d4", "Grid": true, "GridProjection": false, @@ -166715,7 +167667,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01070\",\r\n \"alternate_ids\": [\r\n \"01570\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01070\",\n \"alternate_ids\": [\n \"01570\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "296dc8", "Grid": true, "GridProjection": false, @@ -166777,7 +167729,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01071\",\r\n \"alternate_ids\": [\r\n \"01571\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 4,\r\n \"traits\": \"Item. Relic.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01071\",\n \"alternate_ids\": [\n \"01571\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 4,\n \"traits\": \"Item. Relic.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "07bc04", "Grid": true, "GridProjection": false, @@ -166839,7 +167791,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"51007\",\r\n \"alternate_ids\": [\r\n \"01689\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Return to The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"51007\",\n \"alternate_ids\": [\n \"01689\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Return to The Dunwich Legacy\"\n}", "GUID": "4f2668", "Grid": true, "GridProjection": false, @@ -166901,7 +167853,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03236\",\r\n \"alternate_ids\": [\r\n \"01690\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03236\",\n \"alternate_ids\": [\n \"01690\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "e58d2a", "Grid": true, "GridProjection": false, @@ -166963,7 +167915,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01072\",\r\n \"alternate_ids\": [\r\n \"01572\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Item. Armor.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01072\",\n \"alternate_ids\": [\n \"01572\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Item. Armor.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "593deb", "Grid": true, "GridProjection": false, @@ -167025,7 +167977,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01075\",\r\n \"alternate_ids\": [\r\n \"60510\",\r\n \"01575\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01075\",\n \"alternate_ids\": [\n \"60510\",\n \"01575\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "f34090", "Grid": true, "GridProjection": false, @@ -167087,7 +168039,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01076\",\r\n \"alternate_ids\": [\r\n \"01576\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Creature.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01076\",\n \"alternate_ids\": [\n \"01576\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ally. Creature.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "f474b1", "Grid": true, "GridProjection": false, @@ -167149,7 +168101,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01077\",\r\n \"alternate_ids\": [\r\n \"01577\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Talent.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01077\",\n \"alternate_ids\": [\n \"01577\"\n ],\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Talent.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "fc9e1b", "Grid": true, "GridProjection": false, @@ -167211,7 +168163,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01078\",\r\n \"alternate_ids\": [\r\n \"01578\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 5,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01078\",\n \"alternate_ids\": [\n \"01578\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 5,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "e8ea95", "Grid": true, "GridProjection": false, @@ -167272,7 +168224,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01079\",\r\n \"alternate_ids\": [\r\n \"60517\",\r\n \"01579\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01079\",\n \"alternate_ids\": [\n \"60517\",\n \"01579\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "88d3c0", "Grid": true, "GridProjection": false, @@ -167333,7 +168285,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01080\",\r\n \"alternate_ids\": [\r\n \"01580\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Fortune.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01080\",\n \"alternate_ids\": [\n \"01580\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Fortune.\",\n \"cycle\": \"Core\"\n}", "GUID": "ce0dd5", "Grid": true, "GridProjection": false, @@ -167394,7 +168346,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01081\",\r\n \"alternate_ids\": [\r\n \"01581\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01081\",\n \"alternate_ids\": [\n \"01581\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "078efb", "Grid": true, "GridProjection": false, @@ -167455,7 +168407,7 @@ }, "Description": "The Forgotten Daughter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01082\",\r\n \"alternate_ids\": [\r\n \"01582\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 5,\r\n \"level\": 1,\r\n \"traits\": \"Ally.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01082\",\n \"alternate_ids\": [\n \"01582\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 5,\n \"level\": 1,\n \"traits\": \"Ally.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "9393ec", "Grid": true, "GridProjection": false, @@ -167517,7 +168469,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01083\",\r\n \"alternate_ids\": [\r\n \"01583\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01083\",\n \"alternate_ids\": [\n \"01583\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "6aae86", "Grid": true, "GridProjection": false, @@ -167578,7 +168530,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01084\",\r\n \"alternate_ids\": [\r\n \"01584\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Fortune.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01084\",\n \"alternate_ids\": [\n \"01584\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Fortune.\",\n \"cycle\": \"Core\"\n}", "GUID": "439af2", "Grid": true, "GridProjection": false, @@ -167639,7 +168591,7 @@ }, "Description": "The Forgotten Daughter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02308\",\r\n \"alternate_ids\": [\r\n \"01691\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Ally.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02308\",\n \"alternate_ids\": [\n \"01691\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Ally.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "fb9dbb", "Grid": true, "GridProjection": false, @@ -167701,7 +168653,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05324\",\r\n \"alternate_ids\": [\r\n \"01692\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Fortune. Blessed.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05324\",\n \"alternate_ids\": [\n \"01692\"\n ],\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Fortune. Blessed.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "eaaee9", "Grid": true, "GridProjection": false, @@ -167762,7 +168714,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01086\",\r\n \"alternate_ids\": [\r\n \"01586\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01086\",\n \"alternate_ids\": [\n \"01586\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "0ab3f1", "Grid": true, "GridProjection": false, @@ -167824,7 +168776,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01087\",\r\n \"alternate_ids\": [\r\n \"01587\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01087\",\n \"alternate_ids\": [\n \"01587\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "bb1cce", "Grid": true, "GridProjection": false, @@ -167886,7 +168838,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01088\",\r\n \"alternate_ids\": [\r\n \"01588\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Supply.\",\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01088\",\n \"alternate_ids\": [\n \"01588\"\n ],\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Supply.\",\n \"cycle\": \"Core\"\n}", "GUID": "510c0d", "Grid": true, "GridProjection": false, @@ -167947,7 +168899,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01089\",\r\n \"alternate_ids\": [\r\n \"01589\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"willpowerIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01089\",\n \"alternate_ids\": [\n \"01589\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"willpowerIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "8f7289", "Grid": true, "GridProjection": false, @@ -168008,7 +168960,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01090\",\r\n \"alternate_ids\": [\r\n \"01590\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01090\",\n \"alternate_ids\": [\n \"01590\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"intellectIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "c6ac19", "Grid": true, "GridProjection": false, @@ -168069,7 +169021,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01092\",\r\n \"alternate_ids\": [\r\n \"01592\"\r\n ],\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01092\",\n \"alternate_ids\": [\n \"01592\"\n ],\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "679b13", "Grid": true, "GridProjection": false, @@ -168130,7 +169082,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01094\",\r\n \"alternate_ids\": [\r\n \"01594\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Armor.\",\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01094\",\n \"alternate_ids\": [\n \"01594\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Armor.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "c4cf62", "Grid": true, "GridProjection": false, @@ -168192,7 +169144,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01095\",\r\n \"alternate_ids\": [\r\n \"01595\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01095\",\n \"alternate_ids\": [\n \"01595\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "324e49", "Grid": true, "GridProjection": false, @@ -168254,7 +169206,7 @@ }, "Description": "Artifact from Another Life", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01012\",\r\n \"alternate_ids\": [\r\n \"01512\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01012\",\n \"alternate_ids\": [\n \"01512\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "e929f9", "Grid": true, "GridProjection": false, @@ -168377,7 +169329,7 @@ }, "Description": "Signature", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01010\",\r\n \"alternate_ids\": [\r\n \"01510\"\r\n ],\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01010\",\n \"alternate_ids\": [\n \"01510\"\n ],\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "ea6d44", "Grid": true, "GridProjection": false, @@ -168438,7 +169390,7 @@ }, "Description": "John Dee Translation", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01009\",\r\n \"alternate_ids\": [\r\n \"01509\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item. Tome.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01009\",\n \"alternate_ids\": [\n \"01509\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"traits\": \"Item. Tome.\",\n \"weakness\": true,\n \"cycle\": \"Core\"\n}", "GUID": "6b2550", "Grid": true, "GridProjection": false, @@ -168500,7 +169452,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01007\",\r\n \"alternate_ids\": [\r\n \"01507\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Task.\",\r\n \"weakness\": true,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Clue\",\r\n \"token\": \"clue\"\r\n }\r\n ],\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01007\",\n \"alternate_ids\": [\n \"01507\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\": true,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Clue\",\n \"token\": \"clue\"\n }\n ],\n \"cycle\": \"Core\"\n}", "GUID": "ca25bc", "Grid": true, "GridProjection": false, @@ -168561,7 +169513,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01018\",\r\n \"alternate_ids\": [\r\n \"01518\"\r\n ],\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Ally. Police.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01018\",\n \"alternate_ids\": [\n \"01518\"\n ],\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Police.\",\n \"combatIcons\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "7d4749", "Grid": true, "GridProjection": false, @@ -168623,7 +169575,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01098\",\r\n \"alternate_ids\": [\r\n \"01598\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Curse.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01098\",\n \"alternate_ids\": [\n \"01598\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Curse.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "249d83", "Grid": true, "GridProjection": false, @@ -168684,7 +169636,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01096\",\r\n \"alternate_ids\": [\r\n \"01596\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01096\",\n \"alternate_ids\": [\n \"01596\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "2210c1", "Grid": true, "GridProjection": false, @@ -168745,7 +169697,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01099\",\r\n \"alternate_ids\": [\r\n \"01599\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01099\",\n \"alternate_ids\": [\n \"01599\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "d83baf", "Grid": true, "GridProjection": false, @@ -168806,7 +169758,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01100\",\r\n \"alternate_ids\": [\r\n \"01600\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01100\",\n \"alternate_ids\": [\n \"01600\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "88ee43", "Grid": true, "GridProjection": false, @@ -168867,7 +169819,7 @@ }, "Description": "Enemy", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01101\",\r\n \"alternate_ids\": [\r\n \"01601\"\r\n ],\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Criminal.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01101\",\n \"alternate_ids\": [\n \"01601\"\n ],\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Criminal.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "b239d7", "Grid": true, "GridProjection": false, @@ -168928,7 +169880,7 @@ }, "Description": "Enemy", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01102\",\r\n \"alternate_ids\": [\r\n \"01602\"\r\n ],\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Cultist. Silver Twilight.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01102\",\n \"alternate_ids\": [\n \"01602\"\n ],\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Cultist. Silver Twilight.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"Core\"\n}", "GUID": "16a89d", "Grid": true, "GridProjection": false, @@ -168989,7 +169941,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01097\",\r\n \"alternate_ids\": [\r\n \"01597\"\r\n ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Madness.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01097\",\n \"alternate_ids\": [\n \"01597\"\n ],\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Madness.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "c17498", "Grid": true, "GridProjection": false, @@ -169050,7 +170002,7 @@ }, "Description": "The Politician", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09018\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Civic. Socialite.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09018\",\n \"type\": \"Investigator\",\n \"class\": \"Neutral\",\n \"traits\": \"Civic. Socialite.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "95fb5e", "Grid": true, "GridProjection": false, @@ -169356,7 +170308,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09006\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Innate.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09006\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Innate.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "ac3502", "Grid": true, "GridProjection": false, @@ -169417,7 +170369,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09005\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Tool. Melee.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09005\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Tool. Melee.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4b371d", "Grid": true, "GridProjection": false, @@ -169479,7 +170431,7 @@ }, "Description": "The Doctor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09004\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Medic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09004\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Medic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 4,\n \"combatIcons\": 3,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c431f3", "Grid": true, "GridProjection": false, @@ -169602,7 +170554,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09012\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Pact.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09012\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Pact.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "bb7174", "Grid": true, "GridProjection": false, @@ -169663,7 +170615,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09013\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Pact.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09013\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Pact.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "5edfc2", "Grid": true, "GridProjection": false, @@ -169724,7 +170676,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09014\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Omen.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09014\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Omen.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "0821d4", "Grid": true, "GridProjection": false, @@ -169847,7 +170799,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09017\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Blunder.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09017\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Blunder.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "6d2eae", "Grid": true, "GridProjection": false, @@ -169908,7 +170860,7 @@ }, "Description": "Loyal Assistant", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09019\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Civic. Assistant.\",\r\n \"wildIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09019\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Civic. Assistant.\",\n \"wildIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "634e9e", "Grid": true, "GridProjection": false, @@ -169970,7 +170922,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09020\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09020\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "22e624", "Grid": true, "GridProjection": false, @@ -170031,7 +170983,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09025\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09025\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d4b254", "Grid": true, "GridProjection": false, @@ -170092,7 +171044,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09026\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Tactic. Police.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09026\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Tactic. Police.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "74969c", "Grid": true, "GridProjection": false, @@ -170153,7 +171105,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09027\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09027\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d7c63c", "Grid": true, "GridProjection": false, @@ -170214,7 +171166,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09021\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Armor.\",\r\n \"willpowerIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Enchanted\",\r\n \"xp\": 1,\r\n \"text\": \"Hunter’s Armor gains the Relic trait and takes up an arcane slot instead of a body slot.\",\r\n \"replaces\": {\r\n \"traits\": \"Item. Armor. Relic.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Protective Runes\",\r\n \"xp\": 2,\r\n \"text\": \"Hunter’s Armor may be assigned damage and/or horror dealt to other investigators at your location.\"\r\n },\r\n {\r\n \"name\": \"Durable\",\r\n \"xp\": 2,\r\n \"text\": \"Hunter’s Armor gets +2 health.\"\r\n },\r\n {\r\n \"name\": \"Hallowed\",\r\n \"xp\": 2,\r\n \"text\": \"Hunter’s Armor gets +2 sanity.\"\r\n },\r\n {\r\n \"name\": \"Lightweight\",\r\n \"xp\": 2,\r\n \"text\": \"Hunter’s Armor gets –1 cost and playing it does not provoke attacks of opportunity.\",\r\n \"replaces\": {\r\n \"cost\": 3\r\n }\r\n },\r\n {\r\n \"name\": \"Hexdrinker\",\r\n \"xp\": 3,\r\n \"text\": \"After 1 or more damage or horror is assigned to Hunter’s Armor from a treachery effect, you may exhaust it to draw 1 card.\"\r\n },\r\n {\r\n \"name\": \"Armor of Thorns\",\r\n \"xp\": 3,\r\n \"text\": \"After 1 or more damage or horror is assigned to Hunter’s Armor from an enemy attack, you may exhaust it to deal 1 damage to that enemy.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09021\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Armor.\",\n \"willpowerIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Enchanted\",\n \"xp\": 1,\n \"text\": \"Hunter’s Armor gains the Relic trait and takes up an arcane slot instead of a body slot.\",\n \"replaces\": {\n \"traits\": \"Item. Armor. Relic.\"\n }\n },\n {\n \"name\": \"Protective Runes\",\n \"xp\": 2,\n \"text\": \"Hunter’s Armor may be assigned damage and/or horror dealt to other investigators at your location.\"\n },\n {\n \"name\": \"Durable\",\n \"xp\": 2,\n \"text\": \"Hunter’s Armor gets +2 health.\"\n },\n {\n \"name\": \"Hallowed\",\n \"xp\": 2,\n \"text\": \"Hunter’s Armor gets +2 sanity.\"\n },\n {\n \"name\": \"Lightweight\",\n \"xp\": 2,\n \"text\": \"Hunter’s Armor gets –1 cost and playing it does not provoke attacks of opportunity.\",\n \"replaces\": {\n \"cost\": 3\n }\n },\n {\n \"name\": \"Hexdrinker\",\n \"xp\": 3,\n \"text\": \"After 1 or more damage or horror is assigned to Hunter’s Armor from a treachery effect, you may exhaust it to draw 1 card.\"\n },\n {\n \"name\": \"Armor of Thorns\",\n \"xp\": 3,\n \"text\": \"After 1 or more damage or horror is assigned to Hunter’s Armor from an enemy attack, you may exhaust it to deal 1 damage to that enemy.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a85f1d", "Grid": true, "GridProjection": false, @@ -170276,7 +171228,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09010\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Humanoid. Coterie. Detective.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09010\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Humanoid. Coterie. Detective.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "95b0cf", "Grid": true, "GridProjection": false, @@ -170337,7 +171289,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09024\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09024\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "972250", "Grid": true, "GridProjection": false, @@ -170399,7 +171351,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09022\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"replenish\": 1,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n \"name\": \"Heirloom\",\r\n \"xp\": 1,\r\n \"text\": \"This asset gets -1 cost and gains the Relic trait.\",\r\n \"replaces\": {\r\n \"cost\": 3,\r\n \"traits\": \"Item. Relic. Weapon. Melee.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Inscription of Glory\",\r\n \"xp\": 1,\r\n \"text\": \"Add this inscription: “⟐ Glory - If this attack defeats an enemy, choose one: draw 1 card, heal 1 damage, or heal 1 horror.”\"\r\n },\r\n {\r\n \"name\": \"Inscription of the Elders\",\r\n \"xp\": 1,\r\n \"text\": \"Add this inscription: “⟐ Elders - If this attack succeeds by an amount equal to or grather than your location\\u0027s shroud, discover 1 clue at your location.”\"\r\n },\r\n {\r\n \"name\": \"Inscription of the Hunt\",\r\n \"xp\": 1,\r\n \"text\": \"Add this inscription: “⟐ Hunt - Immediately move to a connecting location or engage an enemy at your location.”\"\r\n },\r\n {\r\n \"name\": \"Inscription of Fury\",\r\n \"xp\": 1,\r\n \"text\": \"Add this inscription: “⟐ Fury - If this attack is successful, in addition to its standard damage, deal 1 damage to each other enemy engaged with you.”\"\r\n },\r\n {\r\n \"name\": \"Ancient Power\",\r\n \"xp\": 3,\r\n \"text\": \"You may imbue the same inscription up to three times.\"\r\n },\r\n {\r\n \"name\": \"Saga\",\r\n \"xp\": 3,\r\n \"text\": \"Replenish 2 of Runic Axe\\u0027s charges at the start of each round, instead of only one\",\r\n \"replaces\": {\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"replenish\": 2,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"name\": \"Scriptweaver\",\r\n \"xp\": 4,\r\n \"text\": \"For every charge spent, you may imbue the axe with up to two different inscriptions.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09022\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"replenish\": 1,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n \"name\": \"Heirloom\",\n \"xp\": 1,\n \"text\": \"This asset gets -1 cost and gains the Relic trait.\",\n \"replaces\": {\n \"cost\": 3,\n \"traits\": \"Item. Relic. Weapon. Melee.\"\n }\n },\n {\n \"name\": \"Inscription of Glory\",\n \"xp\": 1,\n \"text\": \"Add this inscription: “⟐ Glory - If this attack defeats an enemy, choose one: draw 1 card, heal 1 damage, or heal 1 horror.”\"\n },\n {\n \"name\": \"Inscription of the Elders\",\n \"xp\": 1,\n \"text\": \"Add this inscription: “⟐ Elders - If this attack succeeds by an amount equal to or grather than your location\\u0027s shroud, discover 1 clue at your location.”\"\n },\n {\n \"name\": \"Inscription of the Hunt\",\n \"xp\": 1,\n \"text\": \"Add this inscription: “⟐ Hunt - Immediately move to a connecting location or engage an enemy at your location.”\"\n },\n {\n \"name\": \"Inscription of Fury\",\n \"xp\": 1,\n \"text\": \"Add this inscription: “⟐ Fury - If this attack is successful, in addition to its standard damage, deal 1 damage to each other enemy engaged with you.”\"\n },\n {\n \"name\": \"Ancient Power\",\n \"xp\": 3,\n \"text\": \"You may imbue the same inscription up to three times.\"\n },\n {\n \"name\": \"Saga\",\n \"xp\": 3,\n \"text\": \"Replenish 2 of Runic Axe\\u0027s charges at the start of each round, instead of only one\",\n \"replaces\": {\n \"uses\": [\n {\n \"count\": 4,\n \"replenish\": 2,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ]\n }\n },\n {\n \"name\": \"Scriptweaver\",\n \"xp\": 4,\n \"text\": \"For every charge spent, you may imbue the axe with up to two different inscriptions.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "7cdb0a", "Grid": true, "GridProjection": false, @@ -170461,7 +171413,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09023\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Upgrade. Supply.\",\r\n \"customizations\": [\r\n {\r\n \"name\": \"Notched Sight\",\r\n \"xp\": 1,\r\n \"text\": \"If you perform an attack with attached asset against an enemy engaged with another investigator and fail, you deal no damage.\"\r\n },\r\n {\r\n \"name\": \"Extended Stock\",\r\n \"xp\": 2,\r\n \"text\": \"You get +2 Fight while attacking with attached asset.\"\r\n },\r\n {\r\n \"name\": \"Counterbalance\",\r\n \"xp\": 2,\r\n \"text\": \"After you attach an Upgrade card other than Custom Modifications to attached asset, draw 1 card.\"\r\n },\r\n {\r\n \"name\": \"Leather Grip\",\r\n \"xp\": 3,\r\n \"text\": \"Custom Modifications gets –1 cost and gains “Fast. Play only during your turn.”\",\r\n \"replaces\": {\r\n \"cost\": 2\r\n }\r\n },\r\n {\r\n \"name\": \"Extended Magazine\",\r\n \"xp\": 3,\r\n \"text\": \"After ammo is spent from or placed on attached asset by another event, place 1 ammo on attached asset.\"\r\n },\r\n {\r\n \"name\": \"Quicksilver Bullets\",\r\n \"xp\": 4,\r\n \"text\": \"If you succeed by 3 or more while attacking with attached asset, this attack deals +1 damage.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09023\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Upgrade. Supply.\",\n \"customizations\": [\n {\n \"name\": \"Notched Sight\",\n \"xp\": 1,\n \"text\": \"If you perform an attack with attached asset against an enemy engaged with another investigator and fail, you deal no damage.\"\n },\n {\n \"name\": \"Extended Stock\",\n \"xp\": 2,\n \"text\": \"You get +2 Fight while attacking with attached asset.\"\n },\n {\n \"name\": \"Counterbalance\",\n \"xp\": 2,\n \"text\": \"After you attach an Upgrade card other than Custom Modifications to attached asset, draw 1 card.\"\n },\n {\n \"name\": \"Leather Grip\",\n \"xp\": 3,\n \"text\": \"Custom Modifications gets –1 cost and gains “Fast. Play only during your turn.”\",\n \"replaces\": {\n \"cost\": 2\n }\n },\n {\n \"name\": \"Extended Magazine\",\n \"xp\": 3,\n \"text\": \"After ammo is spent from or placed on attached asset by another event, place 1 ammo on attached asset.\"\n },\n {\n \"name\": \"Quicksilver Bullets\",\n \"xp\": 4,\n \"text\": \"If you succeed by 3 or more while attacking with attached asset, this attack deals +1 damage.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d2252d", "Grid": true, "GridProjection": false, @@ -170522,7 +171474,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09002\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Practiced. Expert.\",\r\n \"wildIcons\": 3,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09002\",\n \"type\": \"Skill\",\n \"class\": \"Neutral\",\n \"traits\": \"Practiced. Expert.\",\n \"wildIcons\": 3,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4b891d", "Grid": true, "GridProjection": false, @@ -170583,7 +171535,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09003\",\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Flaw.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09003\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "07dd55", "Grid": true, "GridProjection": false, @@ -170644,7 +171596,7 @@ }, "Description": "On Death's Doorstep", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09007\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Ally. Bystander.\",\r\n \"weakness\": true,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Damage\",\r\n \"token\": \"damage\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09007\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Ally. Bystander.\",\n \"weakness\": true,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Damage\",\n \"token\": \"damage\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "fb54d3", "Grid": true, "GridProjection": false, @@ -170706,7 +171658,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09009\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "09f1a2", "Grid": true, "GridProjection": false, @@ -170768,7 +171720,7 @@ }, "Description": "The Photographer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09015\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Reporter.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09015\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Reporter.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "5d3d67", "Grid": true, "GridProjection": false, @@ -170830,7 +171782,7 @@ }, "Description": "The Security Consultant", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09008\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 5,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09008\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 5,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "9a9830", "Grid": true, "GridProjection": false, @@ -170892,7 +171844,7 @@ }, "Description": "The Butler", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09001\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Assistant.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09001\",\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Assistant.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "dc96d1", "Grid": true, "GridProjection": false, @@ -170954,7 +171906,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09128\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 1,\r\n \"traits\": \"Blunder.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09128\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 1,\n \"traits\": \"Blunder.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "709a54", "Grid": true, "GridProjection": false, @@ -171015,7 +171967,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09127\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Geist.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09127\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Geist.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "379582", "Grid": true, "GridProjection": false, @@ -171076,7 +172028,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09126\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 10,\r\n \"traits\": \"Pact.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09126\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 10,\n \"traits\": \"Pact.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "5b6c9f", "Grid": true, "GridProjection": false, @@ -171137,7 +172089,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09125\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 0,\r\n \"traits\": \"Paradox.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09125\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 0,\n \"traits\": \"Paradox.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "0e4c07", "Grid": true, "GridProjection": false, @@ -171198,7 +172150,7 @@ }, "Description": "Basic Weakness", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09124\",\r\n \"type\": \"Enemy\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Monster. Shoggoth.\",\r\n \"weakness\": true,\r\n \"basicWeaknessCount\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09124\",\n \"type\": \"Enemy\",\n \"class\": \"Neutral\",\n \"traits\": \"Monster. Shoggoth.\",\n \"weakness\": true,\n \"basicWeaknessCount\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "79cc11", "Grid": true, "GridProjection": false, @@ -171321,7 +172273,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09122\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09122\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "2b3301", "Grid": true, "GridProjection": false, @@ -171383,7 +172335,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09121\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Supply. Double.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09121\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Supply. Double.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "482b10", "Grid": true, "GridProjection": false, @@ -171444,7 +172396,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09120\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Clothing.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09120\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Clothing.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "769a3e", "Grid": true, "GridProjection": false, @@ -171506,7 +172458,7 @@ }, "Description": "Theoretical Device", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09119\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Weapon. Firearm.\",\r\n \"wildIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Aether\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n \"name\": \"Railshooter\",\r\n \"xp\": 2,\r\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Fight. Fight with any skill. This attack deals +1 damage.”\"\r\n },\r\n {\r\n \"name\": \"Telescanner\",\r\n \"xp\": 2,\r\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Investigate. Investigate with any skill. If you succeed, discover a clue at any revealed location instead of your location.\"\r\n },\r\n {\r\n \"name\": \"Translocator\",\r\n \"xp\": 2,\r\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Evade. Attempt to evade with any skill. Before or after this attempt, you may move an investigator or a non-Elite enemy at your location to a connecting location, or vice versa.”\"\r\n },\r\n {\r\n \"name\": \"Realitycollapser\",\r\n \"xp\": 2,\r\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Test any skill (3). If you succeed, discard from play a non‑weakness treachery that is not attached to an Elite enemy.”\"\r\n },\r\n {\r\n \"name\": \"Matterweaver\",\r\n \"xp\": 2,\r\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Choose an asset in your hand and test any skill (X), where X is that asset’s cost. If you succeed, play that asset at no cost.”\"\r\n },\r\n {\r\n \"name\": \"Aetheric Link\",\r\n \"xp\": 4,\r\n \"text\": \"Hyperphysical Shotcaster enters play with 2 additional aether.\",\r\n \"replaces\": {\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Aether\",\r\n \"token\": \"resource\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"name\": \"Empowered Configuration\",\r\n \"xp\": 4,\r\n \"text\": \"While using a Manifest ability, you get +2 skill value.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09119\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Relic. Weapon. Firearm.\",\n \"wildIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Aether\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n \"name\": \"Railshooter\",\n \"xp\": 2,\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Fight. Fight with any skill. This attack deals +1 damage.”\"\n },\n {\n \"name\": \"Telescanner\",\n \"xp\": 2,\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Investigate. Investigate with any skill. If you succeed, discover a clue at any revealed location instead of your location.\"\n },\n {\n \"name\": \"Translocator\",\n \"xp\": 2,\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Evade. Attempt to evade with any skill. Before or after this attempt, you may move an investigator or a non-Elite enemy at your location to a connecting location, or vice versa.”\"\n },\n {\n \"name\": \"Realitycollapser\",\n \"xp\": 2,\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Test any skill (3). If you succeed, discard from play a non‑weakness treachery that is not attached to an Elite enemy.”\"\n },\n {\n \"name\": \"Matterweaver\",\n \"xp\": 2,\n \"text\": \"Hyperphysical Shotcaster has this form: “Manifest – Choose an asset in your hand and test any skill (X), where X is that asset’s cost. If you succeed, play that asset at no cost.”\"\n },\n {\n \"name\": \"Aetheric Link\",\n \"xp\": 4,\n \"text\": \"Hyperphysical Shotcaster enters play with 2 additional aether.\",\n \"replaces\": {\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Aether\",\n \"token\": \"resource\"\n }\n ]\n }\n },\n {\n \"name\": \"Empowered Configuration\",\n \"xp\": 4,\n \"text\": \"While using a Manifest ability, you get +2 skill value.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "2a6e0d", "Grid": true, "GridProjection": false, @@ -171568,7 +172520,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09118\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 3,\r\n \"traits\": \"Dilemma. Fortune.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09118\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 3,\n \"traits\": \"Dilemma. Fortune.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "1b4684", "Grid": true, "GridProjection": false, @@ -171629,7 +172581,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09117\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Key\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09117\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Key\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "e7d988", "Grid": true, "GridProjection": false, @@ -171691,7 +172643,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09116\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09116\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "f2e87d", "Grid": true, "GridProjection": false, @@ -171752,7 +172704,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09115\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 2,\r\n \"traits\": \"Augury. Dilemma.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09115\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Augury. Dilemma.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3b7419", "Grid": true, "GridProjection": false, @@ -171813,7 +172765,7 @@ }, "Description": "Keeper of Esoteric Lore", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09114\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Scholar.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09114\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ally. Scholar.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "2f100c", "Grid": true, "GridProjection": false, @@ -171875,7 +172827,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09113\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Item. Weapon. Melee.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09113\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Item. Weapon. Melee.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "567525", "Grid": true, "GridProjection": false, @@ -171937,7 +172889,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09112\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Innate.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09112\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4cb0c9", "Grid": true, "GridProjection": false, @@ -171998,7 +172950,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09111\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Dilemma. Insight.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09111\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Dilemma. Insight.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "9c4015", "Grid": true, "GridProjection": false, @@ -172059,7 +173011,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09110\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Fortune.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09110\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Fortune.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "895047", "Grid": true, "GridProjection": false, @@ -172120,7 +173072,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09109\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 1,\r\n \"traits\": \"Dilemma. Insight.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09109\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Dilemma. Insight.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "48e90b", "Grid": true, "GridProjection": false, @@ -172181,7 +173133,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09108\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09108\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Insight. Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "2c165a", "Grid": true, "GridProjection": false, @@ -172242,7 +173194,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09107\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Dilemma. Tactic.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09107\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Dilemma. Tactic.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "6c726b", "Grid": true, "GridProjection": false, @@ -172303,7 +173255,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09106\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Dilemma. Tactic.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09106\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Dilemma. Tactic.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "18247d", "Grid": true, "GridProjection": false, @@ -172364,7 +173316,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09105\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09105\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Tactic. Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "b6857b", "Grid": true, "GridProjection": false, @@ -172425,7 +173377,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09104\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Spirit.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09104\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Spirit.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a3d041", "Grid": true, "GridProjection": false, @@ -172486,7 +173438,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09103\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Item. Armor. Improvised.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09103\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Armor. Improvised.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "616c43", "Grid": true, "GridProjection": false, @@ -172548,7 +173500,7 @@ }, "Description": "Watcher Beyond Time", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09102\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09102\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "8f6f39", "Grid": true, "GridProjection": false, @@ -172610,7 +173562,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09101\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Survivor\",\r\n \"level\": 0,\r\n \"traits\": \"Innate. Developed.\",\r\n \"wildIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Specialist\",\r\n \"xp\": 1,\r\n \"text\": \"Choose another trait.\"\r\n },\r\n {\r\n \"name\": \"Specialist\",\r\n \"xp\": 2,\r\n \"text\": \"Choose another trait.\"\r\n },\r\n {\r\n \"name\": \"Nemesis\",\r\n \"xp\": 3,\r\n \"text\": \"If this is a skill test on or against an enemy with a chosen trait and the test is successful, you may attach Grizzled to that enemy. Reduce the difficulty of tests on or against the attached enemy by 1.\"\r\n },\r\n {\r\n \"name\": \"Mythos-Hardened\",\r\n \"xp\": 4,\r\n \"text\": \"If this skill test is on a treachery with a chosen trait and the test is successful, you may add both Grizzled and that treachery to the victory display.\"\r\n },\r\n {\r\n \"name\": \"Always Prepared\",\r\n \"xp\": 5,\r\n \"text\": \"After you draw an encounter card with a chosen trait, return one copy of Grizzled from your discard pile to your hand. (Max once per round.)\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09101\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Innate. Developed.\",\n \"wildIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Specialist\",\n \"xp\": 1,\n \"text\": \"Choose another trait.\"\n },\n {\n \"name\": \"Specialist\",\n \"xp\": 2,\n \"text\": \"Choose another trait.\"\n },\n {\n \"name\": \"Nemesis\",\n \"xp\": 3,\n \"text\": \"If this is a skill test on or against an enemy with a chosen trait and the test is successful, you may attach Grizzled to that enemy. Reduce the difficulty of tests on or against the attached enemy by 1.\"\n },\n {\n \"name\": \"Mythos-Hardened\",\n \"xp\": 4,\n \"text\": \"If this skill test is on a treachery with a chosen trait and the test is successful, you may add both Grizzled and that treachery to the victory display.\"\n },\n {\n \"name\": \"Always Prepared\",\n \"xp\": 5,\n \"text\": \"After you draw an encounter card with a chosen trait, return one copy of Grizzled from your discard pile to your hand. (Max once per round.)\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "9417a7", "Grid": true, "GridProjection": false, @@ -172671,7 +173623,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09100\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Improvised. Trap.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 2,\r\n \"type\": \"Time\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n \"name\": \"Improved Timer\",\r\n \"xp\": 1,\r\n \"text\": \"When you play Makeshift Trap, you may increase or decrease its uses by 1.\"\r\n },\r\n {\r\n \"name\": \"Tripwire\",\r\n \"xp\": 1,\r\n \"text\": \"Only trigger Makeshift Trap’s forced ability if there are 1 or more enemies at attached location.\"\r\n },\r\n {\r\n \"name\": \"Simple\",\r\n \"xp\": 2,\r\n \"text\": \"Makeshift Trap gains fast and “play during any 🗲 window.”\"\r\n },\r\n {\r\n \"name\": \"Poisonous\",\r\n \"xp\": 2,\r\n \"text\": \"When you remove 1 or more time from Makeshift Trap, deal 1 damage to an enemy at attached location.\"\r\n },\r\n {\r\n \"name\": \"Remote Configuration\",\r\n \"xp\": 2,\r\n \"text\": \"When you play Makeshift Trap, you may attach it to a revealed connecting location.\"\r\n },\r\n {\r\n \"name\": \"Net\",\r\n \"xp\": 3,\r\n \"text\": \"Non-Elite enemies at attached location cannot move or make attacks of opportunity.\"\r\n },\r\n {\r\n \"name\": \"Explosive Device\",\r\n \"xp\": 4,\r\n \"text\": \"When Makeshift Trap has no time and is discarded, deal 3 damage to each enemy and investigator at attached location.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09100\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Improvised. Trap.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Time\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n \"name\": \"Improved Timer\",\n \"xp\": 1,\n \"text\": \"When you play Makeshift Trap, you may increase or decrease its uses by 1.\"\n },\n {\n \"name\": \"Tripwire\",\n \"xp\": 1,\n \"text\": \"Only trigger Makeshift Trap’s forced ability if there are 1 or more enemies at attached location.\"\n },\n {\n \"name\": \"Simple\",\n \"xp\": 2,\n \"text\": \"Makeshift Trap gains fast and “play during any 🗲 window.”\"\n },\n {\n \"name\": \"Poisonous\",\n \"xp\": 2,\n \"text\": \"When you remove 1 or more time from Makeshift Trap, deal 1 damage to an enemy at attached location.\"\n },\n {\n \"name\": \"Remote Configuration\",\n \"xp\": 2,\n \"text\": \"When you play Makeshift Trap, you may attach it to a revealed connecting location.\"\n },\n {\n \"name\": \"Net\",\n \"xp\": 3,\n \"text\": \"Non-Elite enemies at attached location cannot move or make attacks of opportunity.\"\n },\n {\n \"name\": \"Explosive Device\",\n \"xp\": 4,\n \"text\": \"When Makeshift Trap has no time and is discarded, deal 3 damage to each enemy and investigator at attached location.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "aa897f", "Grid": true, "GridProjection": false, @@ -172732,7 +173684,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09099\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool.\",\r\n \"wildIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Detachable\",\r\n \"xp\": 1,\r\n \"text\": \"Other investigators at your location may use the ability on Pocket Multi-Tool.\"\r\n },\r\n {\r\n \"name\": \"Pry Bar\",\r\n \"xp\": 1,\r\n \"text\": \"You get an additional +1 skill value if this is during a skill test on a treachery.\"\r\n },\r\n {\r\n \"name\": \"Sharpened Knife\",\r\n \"xp\": 2,\r\n \"text\": \"You get an additional +1 skill value if this is during an attack.\"\r\n },\r\n {\r\n \"name\": \"Signal Mirror\",\r\n \"xp\": 2,\r\n \"text\": \"You get an additional +1 skill value if this is during an evasion attempt.\"\r\n },\r\n {\r\n \"name\": \"Magnifying Lens\",\r\n \"xp\": 2,\r\n \"text\": \"You get an additional +1 skill value if this is during an investigation.\"\r\n },\r\n {\r\n \"name\": \"Lucky Charm\",\r\n \"xp\": 3,\r\n \"text\": \"After you fail a skill test, ready Pocket Multi Tool.\"\r\n },\r\n {\r\n \"name\": \"Spring-Loaded\",\r\n \"xp\": 4,\r\n \"text\": \"Pocket Multi Tool’s ability is now a 🗲 ability with the trigger: “When you would fail a skill test you are performing, exhaust Pocket Multi Tool…”\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09099\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool.\",\n \"wildIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Detachable\",\n \"xp\": 1,\n \"text\": \"Other investigators at your location may use the ability on Pocket Multi-Tool.\"\n },\n {\n \"name\": \"Pry Bar\",\n \"xp\": 1,\n \"text\": \"You get an additional +1 skill value if this is during a skill test on a treachery.\"\n },\n {\n \"name\": \"Sharpened Knife\",\n \"xp\": 2,\n \"text\": \"You get an additional +1 skill value if this is during an attack.\"\n },\n {\n \"name\": \"Signal Mirror\",\n \"xp\": 2,\n \"text\": \"You get an additional +1 skill value if this is during an evasion attempt.\"\n },\n {\n \"name\": \"Magnifying Lens\",\n \"xp\": 2,\n \"text\": \"You get an additional +1 skill value if this is during an investigation.\"\n },\n {\n \"name\": \"Lucky Charm\",\n \"xp\": 3,\n \"text\": \"After you fail a skill test, ready Pocket Multi Tool.\"\n },\n {\n \"name\": \"Spring-Loaded\",\n \"xp\": 4,\n \"text\": \"Pocket Multi Tool’s ability is now a 🗲 ability with the trigger: “When you would fail a skill test you are performing, exhaust Pocket Multi Tool…”\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "7421ed", "Grid": true, "GridProjection": false, @@ -172794,7 +173746,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09098\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Charm.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09098\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Charm.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "647c62", "Grid": true, "GridProjection": false, @@ -172856,7 +173808,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09097\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Item. Charm.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09097\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Item. Charm.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "bcb13d", "Grid": true, "GridProjection": false, @@ -172918,7 +173870,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09096\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 4,\r\n \"traits\": \"Item. Charm. Weapon. Melee.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09096\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 4,\n \"traits\": \"Item. Charm. Weapon. Melee.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4a6a9f", "Grid": true, "GridProjection": false, @@ -172980,7 +173932,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09095\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09095\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "343f3a", "Grid": true, "GridProjection": false, @@ -173041,7 +173993,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09094\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"level\": 3,\r\n \"traits\": \"Ritual.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09094\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"startsInPlay\": true,\n \"level\": 3,\n \"traits\": \"Ritual.\",\n \"permanent\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "0c77d6", "Grid": true, "GridProjection": false, @@ -173103,7 +174055,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09093\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spell. Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09093\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spell. Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "ad3efc", "Grid": true, "GridProjection": false, @@ -173164,7 +174116,7 @@ }, "Description": "Purifying Purpose", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09092\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Witch.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09092\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "43c3e0", "Grid": true, "GridProjection": false, @@ -173226,7 +174178,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09091\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09091\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "b5d894", "Grid": true, "GridProjection": false, @@ -173288,7 +174240,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09090\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Mystic\",\r\n \"level\": 1,\r\n \"traits\": \"Innate. Spell.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09090\",\n \"type\": \"Skill\",\n \"class\": \"Mystic\",\n \"level\": 1,\n \"traits\": \"Innate. Spell.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "63282f", "Grid": true, "GridProjection": false, @@ -173349,7 +174301,7 @@ }, "Description": "Interdimensional Prison", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09089\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Relic.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09089\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Relic.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c72750", "Grid": true, "GridProjection": false, @@ -173411,7 +174363,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09088\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09088\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "046b16", "Grid": true, "GridProjection": false, @@ -173472,7 +174424,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09087\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"combatIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09087\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"combatIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "f86c67", "Grid": true, "GridProjection": false, @@ -173533,7 +174485,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09086\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09086\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "223eb2", "Grid": true, "GridProjection": false, @@ -173594,7 +174546,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09085\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09085\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "95f4b0", "Grid": true, "GridProjection": false, @@ -173656,7 +174608,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09084\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09084\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3fa5b8", "Grid": true, "GridProjection": false, @@ -173718,7 +174670,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09083\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm.\",\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09083\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Charm.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "851e3a", "Grid": true, "GridProjection": false, @@ -173780,7 +174732,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09082\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Charm. Weapon. Melee.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09082\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Charm. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "b5e78c", "Grid": true, "GridProjection": false, @@ -173842,7 +174794,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09081\",\r\n \"type\": \"Event\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Betray\",\r\n \"xp\": 1,\r\n \"text\": \"Add the command: “⟐ ‘Betray.’ Deal 1 damage to any enemy at this enemy’s location with an equal or lower fight value than this enemy.”\"\r\n },\r\n {\r\n \"name\": \"Mercy\",\r\n \"xp\": 1,\r\n \"text\": \"Add the command: “⟐ ‘Mercy.’ An investigator at this enemy’s location heals damage or horror equal to this enemy’s respective damage/horror value.”\"\r\n },\r\n {\r\n \"name\": \"Confess\",\r\n \"xp\": 1,\r\n \"text\": \"Add the command: “⟐ ‘Confess.’ Discover 1 clue at this enemy’s location if its health is equal to or higher than its location’s shroud.”\"\r\n },\r\n {\r\n \"name\": \"Distract\",\r\n \"xp\": 1,\r\n \"text\": \"Add the command: “⟐ ‘Distract.’ Automatically evade any enemy at this enemy’s location with an equal or lower evade value than this enemy.”\"\r\n },\r\n {\r\n \"name\": \"Greater Control\",\r\n \"xp\": 2,\r\n \"text\": \"Power Word gains “🗲: Return Power Word to your hand.”\"\r\n },\r\n {\r\n \"name\": \"Bonded\",\r\n \"xp\": 3,\r\n \"text\": \"You may activate the parley ability on Power Word from up to one location away from the attached enemy.\"\r\n },\r\n {\r\n \"name\": \"Tonguetwister\",\r\n \"xp\": 3,\r\n \"text\": \"When you parley with Power Word, you may give up to two different commands.\"\r\n },\r\n {\r\n \"name\": \"Thrice Spoken\",\r\n \"xp\": 3,\r\n \"text\": \"You may include three copies of Power Word in your deck. When you give a command using one copy, also give that command to each other enemy with one of your copies of Power Word attached.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09081\",\n \"type\": \"Event\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Betray\",\n \"xp\": 1,\n \"text\": \"Add the command: “⟐ ‘Betray.’ Deal 1 damage to any enemy at this enemy’s location with an equal or lower fight value than this enemy.”\"\n },\n {\n \"name\": \"Mercy\",\n \"xp\": 1,\n \"text\": \"Add the command: “⟐ ‘Mercy.’ An investigator at this enemy’s location heals damage or horror equal to this enemy’s respective damage/horror value.”\"\n },\n {\n \"name\": \"Confess\",\n \"xp\": 1,\n \"text\": \"Add the command: “⟐ ‘Confess.’ Discover 1 clue at this enemy’s location if its health is equal to or higher than its location’s shroud.”\"\n },\n {\n \"name\": \"Distract\",\n \"xp\": 1,\n \"text\": \"Add the command: “⟐ ‘Distract.’ Automatically evade any enemy at this enemy’s location with an equal or lower evade value than this enemy.”\"\n },\n {\n \"name\": \"Greater Control\",\n \"xp\": 2,\n \"text\": \"Power Word gains “🗲: Return Power Word to your hand.”\"\n },\n {\n \"name\": \"Bonded\",\n \"xp\": 3,\n \"text\": \"You may activate the parley ability on Power Word from up to one location away from the attached enemy.\"\n },\n {\n \"name\": \"Tonguetwister\",\n \"xp\": 3,\n \"text\": \"When you parley with Power Word, you may give up to two different commands.\"\n },\n {\n \"name\": \"Thrice Spoken\",\n \"xp\": 3,\n \"text\": \"You may include three copies of Power Word in your deck. When you give a command using one copy, also give that command to each other enemy with one of your copies of Power Word attached.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c91c1d", "Grid": true, "GridProjection": false, @@ -173903,7 +174855,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09080\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Summon.\",\r\n \"willpowerIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Armored Carapace\",\r\n \"xp\": 1,\r\n \"text\": \"Summoned Servitor gains a health value of 3. It can be assigned damage dealt to any investigator at its location.\"\r\n },\r\n {\r\n \"name\": \"Claws that Catch\",\r\n \"xp\": 1,\r\n \"text\": \"Add this action: “⟐ Fight. You fight any enemy at this location with a base Combat of 4. Ignore the aloof and retaliate keywords for this attack.”\"\r\n },\r\n {\r\n \"name\": \"Jaws that Snatch\",\r\n \"xp\": 1,\r\n \"text\": \"Add this action: “⟐ Evade. You attempt to evade any enemy at this location with a base Agility of 4. Ignore the alert keyword for this evasion attempt.”\"\r\n },\r\n {\r\n \"name\": \"Eyes of Flame\",\r\n \"xp\": 1,\r\n \"text\": \"Add this action: “⟐ Investigate. You investigate this location with a base Intellect of 4.”\"\r\n },\r\n {\r\n \"name\": \"Wings of Night\",\r\n \"xp\": 1,\r\n \"text\": \"After Summoned Servitor moves from your location to a connecting location, you may move to that location, as well.\"\r\n },\r\n {\r\n \"name\": \"Dominance\",\r\n \"xp\": 2,\r\n \"text\": \"Summoned Servitor no longer takes up an (select one): arcane / ally slot.\"\r\n },\r\n {\r\n \"name\": \"Dreaming Call\",\r\n \"xp\": 3,\r\n \"text\": \"Instead of discarding another asset you control in order to play Summoned Servitor, you may return that asset to its owner’s hand.\"\r\n },\r\n {\r\n \"name\": \"Dæmonic Influence\",\r\n \"xp\": 5,\r\n \"text\": \"Summoned Servitor can take 2 different actions instead of 1 during each of your turns.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09080\",\n \"type\": \"Asset\",\n \"slot\": \"Ally|Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Summon.\",\n \"willpowerIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Armored Carapace\",\n \"xp\": 1,\n \"text\": \"Summoned Servitor gains a health value of 3. It can be assigned damage dealt to any investigator at its location.\"\n },\n {\n \"name\": \"Claws that Catch\",\n \"xp\": 1,\n \"text\": \"Add this action: “⟐ Fight. You fight any enemy at this location with a base Combat of 4. Ignore the aloof and retaliate keywords for this attack.”\"\n },\n {\n \"name\": \"Jaws that Snatch\",\n \"xp\": 1,\n \"text\": \"Add this action: “⟐ Evade. You attempt to evade any enemy at this location with a base Agility of 4. Ignore the alert keyword for this evasion attempt.”\"\n },\n {\n \"name\": \"Eyes of Flame\",\n \"xp\": 1,\n \"text\": \"Add this action: “⟐ Investigate. You investigate this location with a base Intellect of 4.”\"\n },\n {\n \"name\": \"Wings of Night\",\n \"xp\": 1,\n \"text\": \"After Summoned Servitor moves from your location to a connecting location, you may move to that location, as well.\"\n },\n {\n \"name\": \"Dominance\",\n \"xp\": 2,\n \"text\": \"Summoned Servitor no longer takes up an (select one): arcane / ally slot.\"\n },\n {\n \"name\": \"Dreaming Call\",\n \"xp\": 3,\n \"text\": \"Instead of discarding another asset you control in order to play Summoned Servitor, you may return that asset to its owner’s hand.\"\n },\n {\n \"name\": \"Dæmonic Influence\",\n \"xp\": 5,\n \"text\": \"Summoned Servitor can take 2 different actions instead of 1 during each of your turns.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "73b311", "Grid": true, "GridProjection": false, @@ -173965,7 +174917,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09079\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Ritual.\",\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n },\r\n {\r\n \"name\": \"Shifting Ink\",\r\n \"xp\": 1,\r\n \"text\": \"You may play Living Ink under the control of another investigator at your location.\"\r\n },\r\n {\r\n \"name\": \"Subtle Depiction\",\r\n \"xp\": 1,\r\n \"text\": \"At the start of your turn, you may choose not to remove 1 charge from Living Ink and ignore its ability for the remainder of the round.\"\r\n },\r\n {\r\n \"name\": \"Imbued Ink\",\r\n \"xp\": 2,\r\n \"text\": \"Living Ink enters play with 2 additional charges and takes up an arcane slot instead of a body slot.\",\r\n \"replaces\": {\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"name\": \"Eldritch Ink\",\r\n \"xp\": 3,\r\n \"text\": \"Circle another skill.\"\r\n },\r\n {\r\n \"name\": \"Eldritch Ink\",\r\n \"xp\": 3,\r\n \"text\": \"Circle another skill.\"\r\n },\r\n {\r\n \"name\": \"Macabre Depiction\",\r\n \"xp\": 3,\r\n \"text\": \"Living Ink gains: “🗲 After you reveal a chaos token with a symbol, exhaust Living Ink: Place 1 charge on it.”\"\r\n },\r\n {\r\n \"name\": \"Vibrancy\",\r\n \"xp\": 3,\r\n \"text\": \"Living Ink grants an additional +1 to the circled skill(s) and –1 to each other skill.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09079\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Mystic\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Ritual.\",\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n },\n {\n \"name\": \"Shifting Ink\",\n \"xp\": 1,\n \"text\": \"You may play Living Ink under the control of another investigator at your location.\"\n },\n {\n \"name\": \"Subtle Depiction\",\n \"xp\": 1,\n \"text\": \"At the start of your turn, you may choose not to remove 1 charge from Living Ink and ignore its ability for the remainder of the round.\"\n },\n {\n \"name\": \"Imbued Ink\",\n \"xp\": 2,\n \"text\": \"Living Ink enters play with 2 additional charges and takes up an arcane slot instead of a body slot.\",\n \"replaces\": {\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ]\n }\n },\n {\n \"name\": \"Eldritch Ink\",\n \"xp\": 3,\n \"text\": \"Circle another skill.\"\n },\n {\n \"name\": \"Eldritch Ink\",\n \"xp\": 3,\n \"text\": \"Circle another skill.\"\n },\n {\n \"name\": \"Macabre Depiction\",\n \"xp\": 3,\n \"text\": \"Living Ink gains: “🗲 After you reveal a chaos token with a symbol, exhaust Living Ink: Place 1 charge on it.”\"\n },\n {\n \"name\": \"Vibrancy\",\n \"xp\": 3,\n \"text\": \"Living Ink grants an additional +1 to the circled skill(s) and –1 to each other skill.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "42b36d", "Grid": true, "GridProjection": false, @@ -174027,7 +174979,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09078\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 4,\r\n \"traits\": \"Gambit. Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09078\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 4,\n \"traits\": \"Gambit. Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "537171", "Grid": true, "GridProjection": false, @@ -174088,7 +175040,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09077\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"level\": 2,\r\n \"traits\": \"Connection. Illicit.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09077\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"level\": 2,\n \"traits\": \"Connection. Illicit.\",\n \"permanent\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "bba889", "Grid": true, "GridProjection": false, @@ -174150,7 +175102,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09076\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 3,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09076\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 3,\n \"traits\": \"Ally. Criminal.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "11d7ad", "Grid": true, "GridProjection": false, @@ -174212,7 +175164,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09075\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09075\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Tool. Illicit.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "be8d1f", "Grid": true, "GridProjection": false, @@ -174274,7 +175226,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09074\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Trick.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09074\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Trick.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3411dd", "Grid": true, "GridProjection": false, @@ -174335,7 +175287,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09073\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Talent. Trick. Illicit.\",\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09073\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Talent. Trick. Illicit.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "fa1be0", "Grid": true, "GridProjection": false, @@ -174397,7 +175349,7 @@ }, "Description": "O'Bannion Driver", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09072\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Criminal.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09072\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Ally. Criminal.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "ea31c2", "Grid": true, "GridProjection": false, @@ -174459,7 +175411,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09071\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Clothing.\",\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09071\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Clothing.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "0a1b3a", "Grid": true, "GridProjection": false, @@ -174521,7 +175473,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09070\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Rogue\",\r\n \"level\": 0,\r\n \"traits\": \"Gambit. Fated.\",\r\n \"dynamicIcons\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09070\",\n \"type\": \"Skill\",\n \"class\": \"Rogue\",\n \"level\": 0,\n \"traits\": \"Gambit. Fated.\",\n \"dynamicIcons\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "dfbed9", "Grid": true, "GridProjection": false, @@ -174582,7 +175534,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09069\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Trick.\",\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09069\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"agilityIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "5cc3d2", "Grid": true, "GridProjection": false, @@ -174643,7 +175595,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09068\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Gambit. Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09068\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Gambit. Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4d6da5", "Grid": true, "GridProjection": false, @@ -174704,7 +175656,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09067\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Trick. Upgrade. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09067\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Trick. Upgrade. Illicit.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "691652", "Grid": true, "GridProjection": false, @@ -174765,7 +175717,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09066\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Tactic. Trick.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09066\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Trick.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "408bce", "Grid": true, "GridProjection": false, @@ -174826,7 +175778,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09065\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Upgrade. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09065\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Upgrade. Illicit.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "9bef61", "Grid": true, "GridProjection": false, @@ -174887,7 +175839,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09064\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tool. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 6,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09064\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool. Illicit.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "857b53", "Grid": true, "GridProjection": false, @@ -175011,7 +175963,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09062\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Talent. Trick. Illicit.\",\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09062\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Talent. Trick. Illicit.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "f170fc", "Grid": true, "GridProjection": false, @@ -175073,7 +176025,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09061\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Gambit.\",\r\n \"agilityIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Reflex Response\",\r\n \"xp\": 1,\r\n \"text\": \"Add the following play condition: “\\u003d You take damage or horror.”\"\r\n },\r\n {\r\n \"name\": \"Situational Awareness\",\r\n \"xp\": 1,\r\n \"text\": \"Add the following play condition: “\\u003d A location enters play or is revealed.”\"\r\n },\r\n {\r\n \"name\": \"Killer Instinct\",\r\n \"xp\": 1,\r\n \"text\": \"Add the following play condition: “\\u003d An enemy engages you.”\"\r\n },\r\n {\r\n \"name\": \"Gut Reaction\",\r\n \"xp\": 1,\r\n \"text\": \"Add the following play condition: “\\u003d A treachery enters your threat area .”\"\r\n },\r\n {\r\n \"name\": \"Muscle Memory\",\r\n \"xp\": 1,\r\n \"text\": \"Add the following play condition: “\\u003d You play an asset.”\"\r\n },\r\n {\r\n \"name\": \"Sharpened Talent\",\r\n \"xp\": 2,\r\n \"text\": \"During the action granted by Honed Instinct, you get +2 to each of your skills.\"\r\n },\r\n {\r\n \"name\": \"Impulse Control\",\r\n \"xp\": 3,\r\n \"text\": \"You may include up to three copies of Honed Instinct in your deck. Honed Instinct gets –1 cost.\",\r\n \"replaces\": {\r\n \"cost\": 0\r\n }\r\n },\r\n {\r\n \"name\": \"Force of Habit\",\r\n \"xp\": 5,\r\n \"text\": \"When you play Honed Instinct, you may take 2 actions instead of 1 (one at a time). Then, remove it from the game.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09061\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Gambit.\",\n \"agilityIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Reflex Response\",\n \"xp\": 1,\n \"text\": \"Add the following play condition: “\\u003d You take damage or horror.”\"\n },\n {\n \"name\": \"Situational Awareness\",\n \"xp\": 1,\n \"text\": \"Add the following play condition: “\\u003d A location enters play or is revealed.”\"\n },\n {\n \"name\": \"Killer Instinct\",\n \"xp\": 1,\n \"text\": \"Add the following play condition: “\\u003d An enemy engages you.”\"\n },\n {\n \"name\": \"Gut Reaction\",\n \"xp\": 1,\n \"text\": \"Add the following play condition: “\\u003d A treachery enters your threat area .”\"\n },\n {\n \"name\": \"Muscle Memory\",\n \"xp\": 1,\n \"text\": \"Add the following play condition: “\\u003d You play an asset.”\"\n },\n {\n \"name\": \"Sharpened Talent\",\n \"xp\": 2,\n \"text\": \"During the action granted by Honed Instinct, you get +2 to each of your skills.\"\n },\n {\n \"name\": \"Impulse Control\",\n \"xp\": 3,\n \"text\": \"You may include up to three copies of Honed Instinct in your deck. Honed Instinct gets –1 cost.\",\n \"replaces\": {\n \"cost\": 0\n }\n },\n {\n \"name\": \"Force of Habit\",\n \"xp\": 5,\n \"text\": \"When you play Honed Instinct, you may take 2 actions instead of 1 (one at a time). Then, remove it from the game.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "1cde62", "Grid": true, "GridProjection": false, @@ -175134,7 +176086,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09060\",\r\n \"type\": \"Event\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Favor.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Helpful\",\r\n \"xp\": 1,\r\n \"text\": \"When you play Friends in Low Places, you may choose another investigator at your location to resolve its effects.\"\r\n },\r\n {\r\n \"name\": \"Versatile\",\r\n \"xp\": 2,\r\n \"text\": \"Choose another Trait. When you play Friends in Low Places, you may choose one of the looked-at cards with both chosen Traits to add to your hand without spending 1 resource.\"\r\n },\r\n {\r\n \"name\": \"Bolstering\",\r\n \"xp\": 2,\r\n \"text\": \"Each card added to your hand by Friends in Low Places gains a ? icon until the end of the phase.\"\r\n },\r\n {\r\n \"name\": \"Clever\",\r\n \"xp\": 2,\r\n \"text\": \"Instead of shuffling the remaining cards into your deck, you may place each of them on the top of your deck, in any order.\"\r\n },\r\n {\r\n \"name\": \"Prompt\",\r\n \"xp\": 2,\r\n \"text\": \"Friends in Low Places gains fast and “play during any 🗲 window.”\"\r\n },\r\n {\r\n \"name\": \"Experienced\",\r\n \"xp\": 3,\r\n \"text\": \"Increase the number of cards looked at by 3.\"\r\n },\r\n {\r\n \"name\": \"Swift\",\r\n \"xp\": 3,\r\n \"text\": \"You may play one of the cards added to your hand (paying its cost).\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09060\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Favor.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"customizations\": [\n {\n \"name\": \"Helpful\",\n \"xp\": 1,\n \"text\": \"When you play Friends in Low Places, you may choose another investigator at your location to resolve its effects.\"\n },\n {\n \"name\": \"Versatile\",\n \"xp\": 2,\n \"text\": \"Choose another Trait. When you play Friends in Low Places, you may choose one of the looked-at cards with both chosen Traits to add to your hand without spending 1 resource.\"\n },\n {\n \"name\": \"Bolstering\",\n \"xp\": 2,\n \"text\": \"Each card added to your hand by Friends in Low Places gains a ? icon until the end of the phase.\"\n },\n {\n \"name\": \"Clever\",\n \"xp\": 2,\n \"text\": \"Instead of shuffling the remaining cards into your deck, you may place each of them on the top of your deck, in any order.\"\n },\n {\n \"name\": \"Prompt\",\n \"xp\": 2,\n \"text\": \"Friends in Low Places gains fast and “play during any 🗲 window.”\"\n },\n {\n \"name\": \"Experienced\",\n \"xp\": 3,\n \"text\": \"Increase the number of cards looked at by 3.\"\n },\n {\n \"name\": \"Swift\",\n \"xp\": 3,\n \"text\": \"You may play one of the cards added to your hand (paying its cost).\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c332af", "Grid": true, "GridProjection": false, @@ -175195,7 +176147,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09059\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Rogue\",\r\n \"cost\": 4,\r\n \"level\": 0,\r\n \"traits\": \"Item. Illicit.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Evidence\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n \"name\": \"Search Warrant\",\r\n \"xp\": 1,\r\n \"text\": \"While investigating using Damning Testimony, you may ignore any effect or keyword on the investigated location that would trigger.\"\r\n },\r\n {\r\n \"name\": \"Fabricated Evidence\",\r\n \"xp\": 2,\r\n \"text\": \"Damning Testimony enters play with 2 additional evidence on it.\",\r\n \"replaces\": {\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Evidence\",\r\n \"token\": \"resource\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"name\": \"Blackmail\",\r\n \"xp\": 2,\r\n \"text\": \"You get +2 Intellect while investigating using Damning Testimony.\"\r\n },\r\n {\r\n \"name\": \"Extort\",\r\n \"xp\": 3,\r\n \"text\": \"When you successfully investigate using Damning Testimony, you may spend 1 evidence to automatically evade the chosen enemy.\"\r\n },\r\n {\r\n \"name\": \"Surveil\",\r\n \"xp\": 3,\r\n \"text\": \"You may use Damning Testimony’s ability to investigate the chosen enemy’s location instead of your location.\"\r\n },\r\n {\r\n \"name\": \"Expose\",\r\n \"xp\": 4,\r\n \"text\": \"When you successfully investigate using Damning Testimony, you may spend X evidence to discard the chosen enemy if it is non-Elite. X is that enemy’s remaining health.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09059\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Rogue\",\n \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Item. Illicit.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n \"name\": \"Search Warrant\",\n \"xp\": 1,\n \"text\": \"While investigating using Damning Testimony, you may ignore any effect or keyword on the investigated location that would trigger.\"\n },\n {\n \"name\": \"Fabricated Evidence\",\n \"xp\": 2,\n \"text\": \"Damning Testimony enters play with 2 additional evidence on it.\",\n \"replaces\": {\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ]\n }\n },\n {\n \"name\": \"Blackmail\",\n \"xp\": 2,\n \"text\": \"You get +2 Intellect while investigating using Damning Testimony.\"\n },\n {\n \"name\": \"Extort\",\n \"xp\": 3,\n \"text\": \"When you successfully investigate using Damning Testimony, you may spend 1 evidence to automatically evade the chosen enemy.\"\n },\n {\n \"name\": \"Surveil\",\n \"xp\": 3,\n \"text\": \"You may use Damning Testimony’s ability to investigate the chosen enemy’s location instead of your location.\"\n },\n {\n \"name\": \"Expose\",\n \"xp\": 4,\n \"text\": \"When you successfully investigate using Damning Testimony, you may spend X evidence to discard the chosen enemy if it is non-Elite. X is that enemy’s remaining health.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3369a5", "Grid": true, "GridProjection": false, @@ -175257,7 +176209,7 @@ }, "Description": "The Doctors' Bible", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09058\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 5,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09058\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "f4e7f3", "Grid": true, "GridProjection": false, @@ -175319,7 +176271,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09057\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 5,\r\n \"level\": 4,\r\n \"traits\": \"Item. Tool.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09057\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 5,\n \"level\": 4,\n \"traits\": \"Item. Tool.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "33b09e", "Grid": true, "GridProjection": false, @@ -175381,7 +176333,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09056\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tool. Science.\",\r\n \"intellectIcons\": 2,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09056\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Tool. Science.\",\n \"intellectIcons\": 2,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c8ecf2", "Grid": true, "GridProjection": false, @@ -175443,7 +176395,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09055\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Item. Charm.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09055\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Item. Charm.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a6c839", "Grid": true, "GridProjection": false, @@ -175505,7 +176457,7 @@ }, "Description": "Working on Something Bigger", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09054\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Miskatonic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09054\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Ally. Miskatonic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3ee7a5", "Grid": true, "GridProjection": false, @@ -175567,7 +176519,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09053\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 1,\r\n \"traits\": \"Insight.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09053\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 1,\n \"traits\": \"Insight.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "425841", "Grid": true, "GridProjection": false, @@ -175628,7 +176580,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09052\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Insight. Paradox.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09052\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Insight. Paradox.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "38a30a", "Grid": true, "GridProjection": false, @@ -175689,7 +176641,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09051\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Spell.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09051\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Spell.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d084d7", "Grid": true, "GridProjection": false, @@ -175751,7 +176703,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09050\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 1,\r\n \"traits\": \"Item. Clothing. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09050\",\n \"type\": \"Asset\",\n \"slot\": \"Body\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 1,\n \"traits\": \"Item. Clothing. Science.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a825ad", "Grid": true, "GridProjection": false, @@ -175813,7 +176765,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09049\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Seeker\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09049\",\n \"type\": \"Skill\",\n \"class\": \"Seeker\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "80285f", "Grid": true, "GridProjection": false, @@ -175874,7 +176826,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09048\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09048\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight. Tactic.\",\n \"willpowerIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "1760be", "Grid": true, "GridProjection": false, @@ -175935,7 +176887,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09047\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Insight.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09047\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Insight.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "498bc8", "Grid": true, "GridProjection": false, @@ -175996,7 +176948,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09046\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Insight. Science.\",\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09046\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Insight. Science.\",\n \"intellectIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "2423d4", "Grid": true, "GridProjection": false, @@ -176057,7 +177009,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09045\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tome. Science.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", + "GMNotes": "{\n \"id\": \"09045\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Tome. Science.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a37bd4", "Grid": true, "GridProjection": false, @@ -176119,7 +177071,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09044\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Tome.\",\r\n \"intellectIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Secret\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09044\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d1f1d9", "Grid": true, "GridProjection": false, @@ -176181,7 +177133,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09043\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", + "GMNotes": "{\n \"id\": \"09043\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Evidence\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "95ca5d", "Grid": true, "GridProjection": false, @@ -176243,7 +177195,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09042\",\r\n \"type\": \"Event\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 3,\r\n \"level\": 0,\r\n \"traits\": \"Item. Relic. Upgrade.\",\r\n \"intellectIcons\": 2,\r\n \"customizations\": [\r\n {\r\n \"name\": \"Living Quill\",\r\n \"xp\": 1,\r\n \"text\": \"Using attached asset’s ➽ abilities does not provoke attacks of opportunity.\"\r\n },\r\n {\r\n \"name\": \"Spectral Binding\",\r\n \"xp\": 1,\r\n \"text\": \"Attached asset does not take up any slots.\"\r\n },\r\n {\r\n \"name\": \"Mystic Vane\",\r\n \"xp\": 2,\r\n \"text\": \"You get +2 skill value while performing skill tests on attached asset.\"\r\n },\r\n {\r\n \"name\": \"Endless Inkwell\",\r\n \"xp\": 2,\r\n \"text\": \"Name two more Tome or Spell assets.\"\r\n },\r\n {\r\n \"name\": \"Energy Sap\",\r\n \"xp\": 2,\r\n \"text\": \"The Raven Quill gains: “🗲 Exhaust The Raven Quill: Move 1 secret or charge from an asset you control to attached asset.”\"\r\n },\r\n {\r\n \"name\": \"Interwoven Ink\",\r\n \"xp\": 3,\r\n \"text\": \"After you resolve an ➽ ability on attached asset, you may exhaust The Raven Quill to ready another asset you control.\"\r\n },\r\n {\r\n \"name\": \"Supernatural Record\",\r\n \"xp\": 4,\r\n \"text\": \"When you play The Raven Quill, instead of attaching it to a named asset you control, you may search your deck, discard pile, and hand for a copy of a named asset and play it (paying its cost). Then, attach The Raven Quill to it.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09042\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Relic. Upgrade.\",\n \"intellectIcons\": 2,\n \"customizations\": [\n {\n \"name\": \"Living Quill\",\n \"xp\": 1,\n \"text\": \"Using attached asset’s ➽ abilities does not provoke attacks of opportunity.\"\n },\n {\n \"name\": \"Spectral Binding\",\n \"xp\": 1,\n \"text\": \"Attached asset does not take up any slots.\"\n },\n {\n \"name\": \"Mystic Vane\",\n \"xp\": 2,\n \"text\": \"You get +2 skill value while performing skill tests on attached asset.\"\n },\n {\n \"name\": \"Endless Inkwell\",\n \"xp\": 2,\n \"text\": \"Name two more Tome or Spell assets.\"\n },\n {\n \"name\": \"Energy Sap\",\n \"xp\": 2,\n \"text\": \"The Raven Quill gains: “🗲 Exhaust The Raven Quill: Move 1 secret or charge from an asset you control to attached asset.”\"\n },\n {\n \"name\": \"Interwoven Ink\",\n \"xp\": 3,\n \"text\": \"After you resolve an ➽ ability on attached asset, you may exhaust The Raven Quill to ready another asset you control.\"\n },\n {\n \"name\": \"Supernatural Record\",\n \"xp\": 4,\n \"text\": \"When you play The Raven Quill, instead of attaching it to a named asset you control, you may search your deck, discard pile, and hand for a copy of a named asset and play it (paying its cost). Then, attach The Raven Quill to it.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "b81037", "Grid": true, "GridProjection": false, @@ -176313,7 +177265,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/EmpiricalHypothesis\")\nend)\n__bundle_register(\"playercards/cards/EmpiricalHypothesis\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this helper creates buttons to help the user track which hypothesis has been chosen each round\n-- (if user forgot to choose one at round start, the old one stays active)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal upgradeSheetLibrary = require(\"playercards/customizable/UpgradeSheetLibrary\")\n\n-- common button parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 160\nbuttonParameters.width = 1000\nbuttonParameters.font_size = 84\nbuttonParameters.font_color = { 1.0, 1.0, 1.0 }\nbuttonParameters.color = Color.Black\nbuttonParameters.position = {}\nbuttonParameters.position.x = 0\nbuttonParameters.position.y = 0.6\nbuttonParameters.position.z = -1.05\ninitialButtonPosition = buttonParameters.position.z\n\n-- vertical offset between buttons\nlocal verticalOffset = 0.325\n\n-- list of customizable labels\nlocal customizableList = {\n 'Run out of cards in hand',\n 'Take damage/horror',\n 'Discard treachery/enemy',\n 'Enter 3 or more shroud'\n}\n\n-- index of the currently selected button (0-indexed from the top)\nlocal activeButtonIndex\n\nfunction onSave()\n return JSON.encode(activeButtonIndex)\nend\n\nfunction onLoad(savedData)\n self.addContextMenuItem(\"Enable Helper\", createButtons)\n self.addContextMenuItem(\"Clear Helper\", deleteButtons)\n\n activeButtonIndex = JSON.decode(savedData)\n if activeButtonIndex and activeButtonIndex ~= \"\" then\n local tempButtonIndex = activeButtonIndex\n createButtons()\n if tempButtonIndex \u003e= 0 then\n selectButton(tempButtonIndex)\n end\n end\nend\n\n-- marks a button as active\n---@param index Number Index of the button to mark (starts at 0 from the top)\nfunction selectButton(index)\n local lastindex = #hypothesisList - 1\n for i = 0, lastindex do\n local color = Color.Black\n if i == index then\n color = Color.Red\n activeButtonIndex = i\n end\n self.editButton({ index = i, color = color })\n end\nend\n\nfunction deleteButtons()\n self.clearButtons()\n self.clearContextMenu()\n self.addContextMenuItem(\"Enable Helper\", createButtons)\n buttonParameters.position.z = initialButtonPosition -- reset the z position\nend\n\n-- Create buttons based on the button parameters\nfunction createButtons()\n self.clearContextMenu()\n self.addContextMenuItem(\"Clear Helper\", deleteButtons)\n\n -- reset the list in case of addition of checkboxes or Refine\n hypothesisList = {\n 'Succeed by 3 or more',\n 'Fail by 2 or more'\n }\n\n -- set activeButtonIndex to restore state onLoad (\"-1\" -\u003e nothing selected)\n activeButtonIndex = -1\n\n -- get the upgradesheet and check for more conditions\n local upgradeSheet = findUpgradeSheet()\n if upgradeSheet then\n for i = 1, 4 do\n if upgradeSheet.call(\"isUpgradeActive\", i) then\n table.insert(hypothesisList, customizableList[i])\n end\n end\n end\n\n for i, label in ipairs(hypothesisList) do\n buttonParameters.click_function = \"selectButton\" .. i\n self.setVar(buttonParameters.click_function, function() selectButton(i - 1) end)\n buttonParameters.label = label\n self.createButton(buttonParameters)\n buttonParameters.position.z = buttonParameters.position.z + verticalOffset\n end\nend\n\nfunction findUpgradeSheet()\n local matColor = playmatApi.getMatColorByPosition(self.getPosition())\n local result = playmatApi.searchAroundPlaymat(matColor, \"isCard\")\n for j, card in ipairs(result) do\n local metadata = JSON.decode(card.getGMNotes()) or {}\n if metadata.id == \"09041-c\" then\n return card\n end\n end\nend\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -176366,7 +177318,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09040\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"cost\": 2,\r\n \"level\": 0,\r\n \"traits\": \"Item. Science.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 3,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"customizations\": [\r\n {\r\n \"name\": \"Mending Distillate\",\r\n \"xp\": 1,\r\n \"text\": \"Add this option: “⟐ Heal 2 damage.”\"\r\n },\r\n {\r\n \"name\": \"Calming Distillate\",\r\n \"xp\": 1,\r\n \"text\": \"Add this option: “⟐ Heal 2 horror.”\"\r\n },\r\n {\r\n \"name\": \"Enlightening Distillate\",\r\n \"xp\": 1,\r\n \"text\": \"Add this option: “⟐ Place 1 charge or secret on an asset you control.”\"\r\n },\r\n {\r\n \"name\": \"Quickening Distillate\",\r\n \"xp\": 1,\r\n \"text\": \"Add this option: “⟐ Move up to 2 times.”\"\r\n },\r\n {\r\n \"name\": \"Refined\",\r\n \"xp\": 2,\r\n \"text\": \"Alchemical Distillation enters play with 2 additional supplies on it.\",\r\n \"replaces\": {\r\n \"uses\": [\r\n {\r\n \"count\": 5,\r\n \"type\": \"Supply\",\r\n \"token\": \"resource\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"name\": \"Empowered\",\r\n \"xp\": 4,\r\n \"text\": \"When you initiate this skill test, you may increase its difficulty by 2. If you do, increase the value of the effect granted by each option by 1 for this test.\"\r\n },\r\n {\r\n \"name\": \"Perfected\",\r\n \"xp\": 5,\r\n \"text\": \"If you succeed by 2 or more, the chosen investigator may perform two different options instead of one.\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09040\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Science.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ],\n \"customizations\": [\n {\n \"name\": \"Mending Distillate\",\n \"xp\": 1,\n \"text\": \"Add this option: “⟐ Heal 2 damage.”\"\n },\n {\n \"name\": \"Calming Distillate\",\n \"xp\": 1,\n \"text\": \"Add this option: “⟐ Heal 2 horror.”\"\n },\n {\n \"name\": \"Enlightening Distillate\",\n \"xp\": 1,\n \"text\": \"Add this option: “⟐ Place 1 charge or secret on an asset you control.”\"\n },\n {\n \"name\": \"Quickening Distillate\",\n \"xp\": 1,\n \"text\": \"Add this option: “⟐ Move up to 2 times.”\"\n },\n {\n \"name\": \"Refined\",\n \"xp\": 2,\n \"text\": \"Alchemical Distillation enters play with 2 additional supplies on it.\",\n \"replaces\": {\n \"uses\": [\n {\n \"count\": 5,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n }\n ]\n }\n },\n {\n \"name\": \"Empowered\",\n \"xp\": 4,\n \"text\": \"When you initiate this skill test, you may increase its difficulty by 2. If you do, increase the value of the effect granted by each option by 1 for this test.\"\n },\n {\n \"name\": \"Perfected\",\n \"xp\": 5,\n \"text\": \"If you succeed by 2 or more, the chosen investigator may perform two different options instead of one.\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "502a4d", "Grid": true, "GridProjection": false, @@ -176428,7 +177380,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09039\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 4,\r\n \"traits\": \"Tactic.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09039\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 4,\n \"traits\": \"Tactic.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "ac910a", "Grid": true, "GridProjection": false, @@ -176489,7 +177441,7 @@ }, "Description": "ICPC Punjab Detective", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09038\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 4,\r\n \"traits\": \"Ally. Police.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09038\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 4,\n \"traits\": \"Ally. Police.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "bdd70d", "Grid": true, "GridProjection": false, @@ -176551,7 +177503,7 @@ }, "Description": "Remnant of the Unknown", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09037\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 3,\r\n \"traits\": \"Item. Charm. Armor.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09037\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 3,\n \"traits\": \"Item. Charm. Armor.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c795c8", "Grid": true, "GridProjection": false, @@ -176613,7 +177565,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09036\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Tactic.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09036\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Tactic.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a4f62a", "Grid": true, "GridProjection": false, @@ -176674,7 +177626,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09035\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 2,\r\n \"traits\": \"Item. Police.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09035\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Item. Police.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "07c480", "Grid": true, "GridProjection": false, @@ -176736,7 +177688,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09034\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 3,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Creature.\",\r\n \"willpowerIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09034\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 3,\n \"level\": 2,\n \"traits\": \"Ally. Creature.\",\n \"willpowerIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "9009db", "Grid": true, "GridProjection": false, @@ -176798,7 +177750,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09033\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 4,\r\n \"level\": 2,\r\n \"traits\": \"Ally. Agency.\",\r\n \"intellectIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09033\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Guardian\",\n \"cost\": 4,\n \"level\": 2,\n \"traits\": \"Ally. Agency.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "babfb6", "Grid": true, "GridProjection": false, @@ -176860,7 +177812,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09032\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 2,\r\n \"level\": 2,\r\n \"traits\": \"Ritual.\",\r\n \"willpowerIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 4,\r\n \"type\": \"Charge\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09032\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Ritual.\",\n \"willpowerIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\": \"Charge\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "39e14a", "Grid": true, "GridProjection": false, @@ -176922,7 +177874,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09031\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Innate.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09031\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Innate.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "7d93b4", "Grid": true, "GridProjection": false, @@ -176983,7 +177935,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09030\",\r\n \"type\": \"Skill\",\r\n \"class\": \"Guardian\",\r\n \"level\": 0,\r\n \"traits\": \"Practiced.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09030\",\n \"type\": \"Skill\",\n \"class\": \"Guardian\",\n \"level\": 0,\n \"traits\": \"Practiced.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "fc2432", "Grid": true, "GridProjection": false, @@ -177044,7 +177996,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09029\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Fortune. Tactic.\",\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"uses\": [\r\n {\r\n \"count\": 1,\r\n \"type\": \"Ammo\",\r\n \"token\": \"resource\"\r\n }\r\n ],\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09029\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Fortune. Tactic.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 1,\n \"type\": \"Ammo\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "919856", "Grid": true, "GridProjection": false, @@ -177105,7 +178057,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09028\",\r\n \"type\": \"Event\",\r\n \"class\": \"Guardian\",\r\n \"cost\": 0,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09028\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 0,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "1b2331", "Grid": true, "GridProjection": false, @@ -177166,7 +178118,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03156\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 1,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03156\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 1,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "4cfcc7", "Grid": true, "GridProjection": false, @@ -177227,7 +178179,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60523\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 0,\r\n \"level\": 2,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60523\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 0,\n \"level\": 2,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "71a760", "Grid": true, "GridProjection": false, @@ -177288,7 +178240,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"60513\",\r\n \"type\": \"Event\",\r\n \"class\": \"Survivor\",\r\n \"cost\": 1,\r\n \"level\": 0,\r\n \"traits\": \"Spirit.\",\r\n \"willpowerIcons\": 1,\r\n \"cycle\": \"Investigator Packs\"\r\n}\r", + "GMNotes": "{\n \"id\": \"60513\",\n \"type\": \"Event\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Spirit.\",\n \"willpowerIcons\": 1,\n \"cycle\": \"Investigator Packs\"\n}", "GUID": "48e516", "Grid": true, "GridProjection": false, @@ -177358,7 +178310,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/SummonedServitorUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/SummonedServitorUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Summoned Servitor\n\n-- Color information for buttons\nboxSize = 35\n\n-- static values\nxInitial = -0.935\nxOffset = 0.068\n\n-- Locations of the slot selectors\nSLOT_ICON_POSITIONS = {\n arcane = { x = 0.160, z = 0.65 },\n ally = { x = -0.073, z = 0.65 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nSLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n--selectedSlot = SLOT_INDICES.none\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.625,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.33,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.055,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.26,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.56,\n count = 2,\n }\n -- Row 6 includes the selection of Arcane/Ally slot, presented with buttons but stored\n -- as a text field\n },\n [7] = {\n checkboxes = {\n posZ = 0.765,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.06,\n count = 5,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/SummonedServitorUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/SummonedServitorUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Summoned Servitor\n\n-- Color information for buttons\nboxSize = 35\n\n-- static values\nxInitial = -0.935\nxOffset = 0.068\n\n-- Locations of the slot selectors\nSLOT_ICON_POSITIONS = {\n arcane = { x = 0.160, z = 0.65 },\n ally = { x = -0.073, z = 0.65 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nSLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n--selectedSlot = SLOT_INDICES.none\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.625,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.33,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.055,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.26,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.56,\n count = 2,\n }\n -- Row 6 includes the selection of Arcane/Ally slot, presented with buttons but stored\n -- as a text field\n },\n [7] = {\n checkboxes = {\n posZ = 0.765,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.06,\n count = 5,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177419,7 +178371,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/RunicAxeUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/RunicAxeUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Runic Axe\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.715,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.415,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.018,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.265,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.66,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.86,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.065,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/RunicAxeUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/RunicAxeUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Runic Axe\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.715,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.415,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.018,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.265,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.66,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.86,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.065,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177480,7 +178432,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PowerWordUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/PowerWordUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Power Word\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.933\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.6,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.32,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.02,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.28,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.48,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.775,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.975,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PowerWordUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/PowerWordUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Power Word\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.933\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.6,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.32,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.02,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.28,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.48,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.775,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.975,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177541,7 +178493,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PocketMultiToolUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/PocketMultiToolUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Pocket Multi Tool\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.560,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.326,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.142,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.610,\n count = 4,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PocketMultiToolUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/PocketMultiToolUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Pocket Multi Tool\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.560,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.326,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.142,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.610,\n count = 4,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177602,7 +178554,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/MakeshiftTrapUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/MakeshiftTrapUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Makeshift Trap\n\n-- Color information for buttons\nboxSize = 39\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0735\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.889,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.655,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.325,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.085,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.252,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.585,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.927,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/MakeshiftTrapUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/MakeshiftTrapUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Makeshift Trap\n\n-- Color information for buttons\nboxSize = 39\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0735\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.889,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.655,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.325,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.085,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.252,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.585,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.927,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177663,7 +178615,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/LivingInkUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/LivingInkUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Living Ink\n\n-- Size information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.935\nxOffset = 0.075\n\n-- Locations of the skill selectors\nSKILL_ICON_POSITIONS = {\n willpower = { x = 0.085, z = -0.88 },\n intellect = { x = -0.183, z = -0.88 },\n combat = { x = -0.473, z = -0.88 },\n agility = { x = -0.74, z = -0.88 },\n}\n\ncustomizations = {\n [1] = { }, -- Empty placeholder for skill selection row, handled by custom skill display\n [2] = {\n checkboxes = {\n posZ = -0.69,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.355,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.0855,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.425,\n count = 2,\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.555,\n count = 3,\n },\n },\n [7] = {\n checkboxes = {\n posZ = 0.685,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 1.02,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/LivingInkUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/LivingInkUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Living Ink\n\n-- Size information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.935\nxOffset = 0.075\n\n-- Locations of the skill selectors\nSKILL_ICON_POSITIONS = {\n willpower = { x = 0.085, z = -0.88 },\n intellect = { x = -0.183, z = -0.88 },\n combat = { x = -0.473, z = -0.88 },\n agility = { x = -0.74, z = -0.88 },\n}\n\ncustomizations = {\n [1] = { }, -- Empty placeholder for skill selection row, handled by custom skill display\n [2] = {\n checkboxes = {\n posZ = -0.69,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.355,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.0855,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.425,\n count = 2,\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.555,\n count = 3,\n },\n },\n [7] = {\n checkboxes = {\n posZ = 0.685,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 1.02,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177724,7 +178676,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HyperphysicalShotcasterUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/HyperphysicalShotcasterUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Hyperphysical Shotcaster\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.9,\n count = 2,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.615,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.237,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.232,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.61,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.988,\n count = 4,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 1.185,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HyperphysicalShotcasterUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/HyperphysicalShotcasterUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Hyperphysical Shotcaster\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.9,\n count = 2,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.615,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.237,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.232,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.61,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.988,\n count = 4,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 1.185,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177785,7 +178737,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HuntersArmorUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/HuntersArmorUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Hunter's Armor\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.560,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.220,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.047,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.820,\n count = 3,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HuntersArmorUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/HuntersArmorUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Hunter's Armor\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.560,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.220,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.047,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.820,\n count = 3,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177846,7 +178798,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HonedInstinctUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/HonedInstinctUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Honed Instinct\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.705,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.5,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.29,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.09,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.12,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.325,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.62,\n count = 5,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/HonedInstinctUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Honed Instinct\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.705,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.5,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.29,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.09,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.12,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.325,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.62,\n count = 5,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/HonedInstinctUpgradeSheet\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177907,7 +178859,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/GrizzledUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/GrizzledUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Grizzled\n\n-- Color information for buttons and input boxes\nboxSize = 40\ninputFontsize = 50\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.3, 0.25, -0.91 },\n width = 600\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.71,\n count = 1,\n },\n textField = {\n position = { 0.005, 0.25, -0.58 },\n width = 875\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.458,\n count = 2,\n },\n textField = {\n position = { 0.005, 0.25, -0.32 },\n width = 875\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.205,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.362,\n count = 4,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.82,\n count = 5,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/GrizzledUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/GrizzledUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Grizzled\n\n-- Color information for buttons and input boxes\nboxSize = 40\ninputFontsize = 50\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.3, 0.25, -0.91 },\n width = 600\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.71,\n count = 1,\n },\n textField = {\n position = { 0.005, 0.25, -0.58 },\n width = 875\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.458,\n count = 2,\n },\n textField = {\n position = { 0.005, 0.25, -0.32 },\n width = 875\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.205,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.362,\n count = 4,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.82,\n count = 5,\n },\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -177968,7 +178920,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/FriendsinLowPlacesUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/FriendsinLowPlacesUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Friends in Low Places\n\n-- Color information for buttons and input boxes\nboxSize = 36\ninputFontsize = 50\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0685\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.275, 0.25, -0.91 },\n width = 640\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.725,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.44,\n count = 2,\n },\n textField = {\n position = { 0.6295, 0.25, -0.44 },\n width = 290\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.05,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.25,\n count = 2,\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.545,\n count = 2,\n },\n },\n [7] = {\n checkboxes = {\n posZ = 0.75,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 0.95,\n count = 3,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/FriendsinLowPlacesUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/FriendsinLowPlacesUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Friends in Low Places\n\n-- Color information for buttons and input boxes\nboxSize = 36\ninputFontsize = 50\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0685\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.275, 0.25, -0.91 },\n width = 640\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.725,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.44,\n count = 2,\n },\n textField = {\n position = { 0.6295, 0.25, -0.44 },\n width = 290\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.05,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.25,\n count = 2,\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.545,\n count = 2,\n },\n },\n [7] = {\n checkboxes = {\n posZ = 0.75,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 0.95,\n count = 3,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178029,7 +178981,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/EmpiricalHypothesisUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Empirical Hypothesis\n\n-- Color information for buttons\nboxSize = 37\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.7,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.505,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.3,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.09,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.3,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.592,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.888,\n count = 4,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/EmpiricalHypothesisUpgradeSheet\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/EmpiricalHypothesisUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/EmpiricalHypothesisUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Empirical Hypothesis\n\n-- Color information for buttons\nboxSize = 37\n\n-- static values\nxInitial = -0.935\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.7,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.505,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.3,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.09,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.3,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.592,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.888,\n count = 4,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178090,7 +179042,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/DamningTestimonyUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/DamningTestimonyUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Damning Testimony\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.935\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.925,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.475,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.25,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.01,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.428,\n count = 3,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.772,\n count = 4,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/DamningTestimonyUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/DamningTestimonyUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Damning Testimony\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.935\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.925,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.475,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.25,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.01,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.428,\n count = 3,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.772,\n count = 4,\n }\n },\n}\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178151,7 +179103,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/CustomModificationsUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Custom Modifications\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0735\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.895,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.455,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.215,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.115,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.453,\n count = 3,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.794,\n count = 4,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/CustomModificationsUpgradeSheet\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/CustomModificationsUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/CustomModificationsUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Custom Modifications\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0735\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.895,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.455,\n count = 2,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.215,\n count = 2,\n }\n },\n [4] = {\n checkboxes = {\n posZ = 0.115,\n count = 3,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.453,\n count = 3,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.794,\n count = 4,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178212,7 +179164,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/AlchemicalDistillationUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/AlchemicalDistillationUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Alchemical Distillation\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.665,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.43,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.142,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 4,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.815,\n count = 5,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/AlchemicalDistillationUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/AlchemicalDistillationUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Alchemical Distillation\n\n-- Color information for buttons\nboxSize = 40\n\n-- static values\nxInitial = -0.933\nxOffset = 0.075\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.892,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.665,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.43,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.092,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.142,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.376,\n count = 4,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.815,\n count = 5,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178264,7 +179216,7 @@ }, "Description": "The Painter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03003\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Artist.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03003\",\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Artist.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 4,\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "342311", "Grid": true, "GridProjection": false, @@ -178326,7 +179278,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08067\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Mystic\",\r\n \"cost\": 3,\r\n \"level\": 3,\r\n \"traits\": \"Item. Tome.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 2,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08067\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 3,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 2,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "804397", "Grid": true, "GridProjection": false, @@ -178388,7 +179340,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07303\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Seeker\",\r\n \"level\": 3,\r\n \"traits\": \"Talent.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07303\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"level\": 3,\n \"traits\": \"Talent.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "7b7d14", "Grid": true, "GridProjection": false, @@ -178450,7 +179402,7 @@ }, "Description": "The Reporter", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02002\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Reporter.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02002\",\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Reporter.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "4271cb", "Grid": true, "GridProjection": false, @@ -178573,7 +179525,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02014\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Creature.\",\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02014\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Creature.\",\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "876557", "Grid": true, "GridProjection": false, @@ -178635,7 +179587,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"03009\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"startsInPlay\": true,\r\n \"traits\": \"Item. Spirit.\",\r\n \"cycle\": \"The Path to Carcosa\"\r\n}\r", + "GMNotes": "{\n \"id\": \"03009\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"startsInPlay\": true,\n \"traits\": \"Item. Spirit.\",\n \"cycle\": \"The Path to Carcosa\"\n}", "GUID": "4f46ad", "Grid": true, "GridProjection": false, @@ -178758,7 +179710,7 @@ }, "Description": "The Operator", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09011\",\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Chosen. Cursed.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09011\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Chosen. Cursed.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "4c2a3d", "Grid": true, "GridProjection": false, @@ -178829,7 +179781,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/TheRavenQuillUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/TheRavenQuillUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: The Raven Quill\n\n-- Color information for buttons and input boxes\nboxSize = 37\ninputFontsize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.5, 0.25, -0.905 },\n width = 425\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.72,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.52,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.305,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.105,\n count = 2,\n },\n textField = {\n position = { 0.125, 0.25, 0 },\n width = 775\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.1,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.4,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 0.695,\n count = 4,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/TheRavenQuillUpgradeSheet\")\nend)\n__bundle_register(\"playercards/customizable/TheRavenQuillUpgradeSheet\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: The Raven Quill\n\n-- Color information for buttons and input boxes\nboxSize = 37\ninputFontsize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n textField = {\n position = { 0.5, 0.25, -0.905 },\n width = 425\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.72,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.52,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.305,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = -0.105,\n count = 2,\n },\n textField = {\n position = { 0.125, 0.25, 0 },\n width = 775\n }\n },\n [6] = {\n checkboxes = {\n posZ = 0.1,\n count = 2,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.4,\n count = 3,\n }\n },\n [8] = {\n checkboxes = {\n posZ = 0.695,\n count = 4,\n }\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "CardCustom", @@ -178881,7 +179833,7 @@ }, "Description": "Tychokinetic Implement", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"88043\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"traits\": \"Item. Relic.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"88043\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"permanent\": true,\n \"traits\": \"Item. Relic.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "fefdfa", "Grid": true, "GridProjection": false, @@ -178943,7 +179895,7 @@ }, "Description": "The Torch Singer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"88044\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Performer.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"88044\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Performer.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "860cd7", "Grid": true, "GridProjection": false, @@ -179005,7 +179957,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02003-m\",\r\n \"alternate_ids\": [\r\n \"98001-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02003-m\",\n \"alternate_ids\": [\n \"98001-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "48b174", "Grid": true, "GridProjection": false, @@ -179129,7 +180081,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05001-m\",\r\n \"alternate_ids\": [\r\n \"98010-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05001-m\",\n \"alternate_ids\": [\n \"98010-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "30614e", "Grid": true, "GridProjection": false, @@ -179253,7 +180205,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07004-m\",\r\n \"alternate_ids\": [\r\n \"98016-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07004-m\",\n \"alternate_ids\": [\n \"98016-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "57668a", "Grid": true, "GridProjection": false, @@ -179377,7 +180329,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07005-m\",\r\n \"alternate_ids\": [\r\n \"98013-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07005-m\",\n \"alternate_ids\": [\n \"98013-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "574b59", "Grid": true, "GridProjection": false, @@ -179501,7 +180453,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01003-m\",\r\n \"alternate_ids\": [\r\n \"01503-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01003-m\",\n \"alternate_ids\": [\n \"01503-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "6b00ec", "Grid": true, "GridProjection": false, @@ -179625,7 +180577,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01005-m\",\r\n \"alternate_ids\": [\r\n \"01505-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01005-m\",\n \"alternate_ids\": [\n \"01505-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "15e40d", "Grid": true, "GridProjection": false, @@ -179749,7 +180701,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01001-m\",\r\n \"alternate_ids\": [\r\n \"98004-m\",\r\n \"01501-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01001-m\",\n \"alternate_ids\": [\n \"98004-m\",\n \"01501-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "5bde90", "Grid": true, "GridProjection": false, @@ -179934,7 +180886,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01002-m\",\r\n \"alternate_ids\": [\r\n \"01502-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01002-m\",\n \"alternate_ids\": [\n \"01502-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "bce6a5", "Grid": true, "GridProjection": false, @@ -180058,7 +181010,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01004-m\",\r\n \"alternate_ids\": [\r\n \"01504-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01004-m\",\n \"alternate_ids\": [\n \"01504-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "e53693", "Grid": true, "GridProjection": false, @@ -180182,7 +181134,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08004-m\",\r\n \"alternate_ids\": [\r\n \"98007-m\"\r\n ],\r\n \"type\": \"Minicard\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08004-m\",\n \"alternate_ids\": [\n \"98007-m\"\n ],\n \"type\": \"Minicard\"\n}", "GUID": "a5d9bb", "Grid": true, "GridProjection": false, @@ -180306,7 +181258,7 @@ }, "Description": "The Astronomer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"08004\",\r\n \"alternate_ids\": [\r\n \"98007\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"Edge of the Earth\"\r\n}\r", + "GMNotes": "{\n \"id\": \"08004\",\n \"alternate_ids\": [\n \"98007\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 1,\n \"cycle\": \"Edge of the Earth\"\n}", "GUID": "e0a155", "Grid": true, "GridProjection": false, @@ -180432,7 +181384,7 @@ }, "Description": "The Dilettante", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"02003\",\r\n \"alternate_ids\": [\r\n \"98001\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"The Dunwich Legacy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"02003\",\n \"alternate_ids\": [\n \"98001\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 3,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "9058d3", "Grid": true, "GridProjection": false, @@ -180558,7 +181510,7 @@ }, "Description": "The Psychologist", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"05001\",\r\n \"alternate_ids\": [\r\n \"98010\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Medic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 4,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Circle Undone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"05001\",\n \"alternate_ids\": [\n \"98010\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Medic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 4,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"The Circle Undone\"\n}", "GUID": "b03b12", "Grid": true, "GridProjection": false, @@ -180684,7 +181636,7 @@ }, "Description": "The Magician", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07004\",\r\n \"alternate_ids\": [\r\n \"98016\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer. Veteran.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07004\",\n \"alternate_ids\": [\n \"98016\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer. Veteran.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 3,\n \"agilityIcons\": 2,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e015f8", "Grid": true, "GridProjection": false, @@ -180810,7 +181762,7 @@ }, "Description": "The Sailor", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"07005\",\r\n \"alternate_ids\": [\r\n \"98013\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"The Innsmouth Conspiracy\"\r\n}\r", + "GMNotes": "{\n \"id\": \"07005\",\n \"alternate_ids\": [\n \"98013\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 2,\n \"combatIcons\": 4,\n \"agilityIcons\": 4,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "3f92cf", "Grid": true, "GridProjection": false, @@ -180936,7 +181888,7 @@ }, "Description": "The Fed", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01001\",\r\n \"alternate_ids\": [\r\n \"98004\",\r\n \"01501\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Guardian\",\r\n \"traits\": \"Agency. Detective.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 4,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01001\",\n \"alternate_ids\": [\n \"98004\",\n \"01501\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Guardian\",\n \"traits\": \"Agency. Detective.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "9e9e98", "Grid": true, "GridProjection": false, @@ -181124,7 +182076,7 @@ }, "Description": "The Ex-Con", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01003\",\r\n \"alternate_ids\": [\r\n \"01503\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Rogue\",\r\n \"traits\": \"Criminal.\",\r\n \"willpowerIcons\": 2,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 3,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01003\",\n \"alternate_ids\": [\n \"01503\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Rogue\",\n \"traits\": \"Criminal.\",\n \"willpowerIcons\": 2,\n \"intellectIcons\": 3,\n \"combatIcons\": 3,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "9015b4", "Grid": true, "GridProjection": false, @@ -181250,7 +182202,7 @@ }, "Description": "The Waitress", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01004\",\r\n \"alternate_ids\": [\r\n \"01504\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Mystic\",\r\n \"traits\": \"Sorcerer.\",\r\n \"willpowerIcons\": 5,\r\n \"intellectIcons\": 2,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 3,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01004\",\n \"alternate_ids\": [\n \"01504\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n \"traits\": \"Sorcerer.\",\n \"willpowerIcons\": 5,\n \"intellectIcons\": 2,\n \"combatIcons\": 2,\n \"agilityIcons\": 3,\n \"cycle\": \"Core\"\n}", "GUID": "25e2db", "Grid": true, "GridProjection": false, @@ -181376,7 +182328,7 @@ }, "Description": "The Urchin", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01005\",\r\n \"alternate_ids\": [\r\n \"01505\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Survivor\",\r\n \"traits\": \"Drifter.\",\r\n \"willpowerIcons\": 4,\r\n \"intellectIcons\": 3,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 4,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01005\",\n \"alternate_ids\": [\n \"01505\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Drifter.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 3,\n \"combatIcons\": 1,\n \"agilityIcons\": 4,\n \"cycle\": \"Core\"\n}", "GUID": "fc1d17", "Grid": true, "GridProjection": false, @@ -181502,7 +182454,7 @@ }, "Description": "The Librarian", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"01002\",\r\n \"alternate_ids\": [\r\n \"01502\"\r\n ],\r\n \"type\": \"Investigator\",\r\n \"class\": \"Seeker\",\r\n \"traits\": \"Miskatonic.\",\r\n \"willpowerIcons\": 3,\r\n \"intellectIcons\": 5,\r\n \"combatIcons\": 2,\r\n \"agilityIcons\": 2,\r\n \"cycle\": \"Core\"\r\n}\r", + "GMNotes": "{\n \"id\": \"01002\",\n \"alternate_ids\": [\n \"01502\"\n ],\n \"type\": \"Investigator\",\n \"class\": \"Seeker\",\n \"traits\": \"Miskatonic.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 5,\n \"combatIcons\": 2,\n \"agilityIcons\": 2,\n \"cycle\": \"Core\"\n}", "GUID": "6938eb", "Grid": true, "GridProjection": false, @@ -181628,7 +182580,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09766\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item. Evidence.\",\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09766\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Item. Evidence.\",\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "a72f6f", "Grid": true, "GridProjection": false, @@ -181690,7 +182642,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09765\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"traits\": \"Item.\",\r\n \"permanent\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09765\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"traits\": \"Item.\",\n \"permanent\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "8fbd1b", "Grid": true, "GridProjection": false, @@ -181752,7 +182704,7 @@ }, "Description": "\"Cryptozoologist\"", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09764\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Scholar.\",\r\n \"willpowerIcons\": 1,\r\n \"intellectIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09764\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Scholar.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "c76a06", "Grid": true, "GridProjection": false, @@ -181814,7 +182766,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09767\",\r\n \"type\": \"Treachery\",\r\n \"traits\": \"Madness. Paradox.\",\r\n \"weakness\": true,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09767\",\n \"type\": \"Treachery\",\n \"traits\": \"Madness. Paradox.\",\n \"weakness\": true,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "3c3dfa", "Grid": true, "GridProjection": false, @@ -181875,7 +182827,7 @@ }, "Description": "With Pride and Care", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09762\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 2,\r\n \"traits\": \"Ally. Agency. Detective.\",\r\n \"wildIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09762\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Ally. Agency. Detective.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "8247a5", "Grid": true, "GridProjection": false, @@ -181937,7 +182889,7 @@ }, "Description": "Foundation Researcher", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"09763\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Agency. Detective.\",\r\n \"intellectIcons\": 1,\r\n \"combatIcons\": 1,\r\n \"agilityIcons\": 1,\r\n \"cycle\": \"The Scarlet Keys\"\r\n}\r", + "GMNotes": "{\n \"id\": \"09763\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Agency. Detective.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Scarlet Keys\"\n}", "GUID": "d61c6a", "Grid": true, "GridProjection": false, @@ -181999,7 +182951,7 @@ }, "Description": "Tychokinetic Implement", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"88043\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"permanent\": true,\r\n \"traits\": \"Item. Relic.\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"88043\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"permanent\": true,\n \"traits\": \"Item. Relic.\",\n \"cycle\": \"Standalone\"\n}", "GUID": "fefdfa", "Grid": true, "GridProjection": false, @@ -182061,7 +183013,7 @@ }, "Description": "The Torch Singer", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"88044\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n \"cost\": 3,\r\n \"traits\": \"Ally. Performer.\",\r\n \"willpowerIcons\": 1,\r\n \"wildIcons\": 1,\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes": "{\n \"id\": \"88044\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 3,\n \"traits\": \"Ally. Performer.\",\n \"willpowerIcons\": 1,\n \"wildIcons\": 1,\n \"cycle\": \"Standalone\"\n}", "GUID": "860cd7", "Grid": true, "GridProjection": false, @@ -182104,14 +183056,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 101, + "CardID": 55101, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "551": { "BackIsHidden": true, "BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/", @@ -182166,14 +183118,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 103, + "CardID": 55103, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "551": { "BackIsHidden": true, "BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/", @@ -182228,14 +183180,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 102, + "CardID": 55102, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "551": { "BackIsHidden": true, "BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/", @@ -182290,14 +183242,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 100, + "CardID": 55100, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "551": { "BackIsHidden": true, "BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/", @@ -182380,7 +183332,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/RunicAxeUpgradeSheetTaboo\")\nend)\n__bundle_register(\"playercards/customizable/RunicAxeUpgradeSheetTaboo\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Runic Axe (Taboo)\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.715,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.415,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.018,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.265,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.66,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.86,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.065,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/RunicAxeUpgradeSheetTaboo\")\nend)\n__bundle_register(\"playercards/customizable/RunicAxeUpgradeSheetTaboo\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Runic Axe (Taboo)\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.935\nxOffset = 0.0705\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.92,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.715,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.415,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.018,\n count = 2,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.265,\n count = 1,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.66,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.86,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 1.065,\n count = 4,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "Card", @@ -182441,7 +183393,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PowerWordUpgradeSheetTaboo\")\nend)\n__bundle_register(\"playercards/customizable/PowerWordUpgradeSheetTaboo\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Power Word (Taboo)\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.933\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.6,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.42,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.12,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.18,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.38,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.675,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.875,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/customizable/PowerWordUpgradeSheetTaboo\")\nend)\n__bundle_register(\"playercards/customizable/PowerWordUpgradeSheetTaboo\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Customizable Cards: Power Word (Taboo)\n\n-- Color information for buttons\nboxSize = 38\n\n-- static values\nxInitial = -0.933\nxOffset = 0.069\n\ncustomizations = {\n [1] = {\n checkboxes = {\n posZ = -0.905,\n count = 1,\n }\n },\n [2] = {\n checkboxes = {\n posZ = -0.6,\n count = 1,\n }\n },\n [3] = {\n checkboxes = {\n posZ = -0.42,\n count = 1,\n }\n },\n [4] = {\n checkboxes = {\n posZ = -0.12,\n count = 1,\n }\n },\n [5] = {\n checkboxes = {\n posZ = 0.18,\n count = 2,\n },\n },\n [6] = {\n checkboxes = {\n posZ = 0.38,\n count = 3,\n }\n },\n [7] = {\n checkboxes = {\n posZ = 0.675,\n count = 3,\n },\n },\n [8] = {\n checkboxes = {\n posZ = 0.875,\n count = 3,\n },\n },\n}\n\nrequire(\"playercards/customizable/UpgradeSheetLibrary\")\nend)\n__bundle_register(\"playercards/customizable/UpgradeSheetLibrary\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Common code for handling customizable card upgrade sheets\n-- Define UI elements in the base card file, then include this\n-- UI element definition is an array of tables, each with this structure. A row may include\n-- checkboxes (number defined by count), a text field, both, or neither (if the row has custom\n-- handling, as Living Ink does)\n-- {\n-- checkboxes = {\n-- posZ = -0.71,\n-- count = 1,\n-- },\n-- textField = {\n-- position = { 0.005, 0.25, -0.58 },\n-- width = 875\n-- }\n-- }\n-- Fields should also be defined for xInitial (left edge of the checkboxes) and xOffset (amount to\n-- shift X from one box to the next) as well as boxSize (checkboxes) and inputFontSize.\n--\n-- selectedUpgrades holds the state of checkboxes and text input, each element being:\n-- selectedUpgrades[row] = { xp = #, text = \"\" }\n\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- Y position for UI elements. Visibility of checkboxes moves the checkbox inside the card object\n-- when not selected.\nlocal Y_VISIBLE = 0.25\nlocal Y_INVISIBLE = -0.5\n\n-- Used for Summoned Servitor and Living Ink\nlocal VECTOR_COLOR = {\n unselected = { 0.5, 0.5, 0.5, 0.75 },\n mystic = { 0.597, 0.195, 0.796 }\n}\n\n-- These match with ArkhamDB's way of storing the data in the dropdown menu\nlocal SUMMONED_SERVITOR_SLOT_INDICES = { arcane = \"1\", ally = \"0\", none = \"\" }\n\nlocal rowCheckboxFirstIndex = { }\nlocal rowInputIndex = { }\nlocal selectedUpgrades = { }\n\n-- save state when going into bags / decks\nfunction onDestroy() self.script_state = onSave() end\n\nfunction onSave()\n return JSON.encode({\n selections = selectedUpgrades\n })\nend\n\n-- Startup procedure\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n if loadedData.selections ~= nil then\n selectedUpgrades = loadedData.selections\n end\n end\n\n selfId = getSelfId()\n\n maybeLoadLivingInkSkills()\n createUi()\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\n\n self.addContextMenuItem(\"Clear Selections\", function() resetSelections() end)\n self.addContextMenuItem(\"Scale: 1x\", function() self.setScale({ 1, 1, 1 }) end)\n self.addContextMenuItem(\"Scale: 2x\", function() self.setScale({ 2, 1, 2 }) end)\n self.addContextMenuItem(\"Scale: 3x\", function() self.setScale({ 3, 1, 3 }) end)\nend\n\n-- Grabs the ID from the metadata for special functions (Living Ink, Summoned Servitor)\nfunction getSelfId()\n local metadata = JSON.decode(self.getGMNotes())\n return metadata.id\nend\n\nfunction isUpgradeActive(row)\n return customizations[row] ~= nil\n and customizations[row].checkboxes ~= nil\n and customizations[row].checkboxes.count ~= nil\n and customizations[row].checkboxes.count \u003e 0\n and selectedUpgrades[row] ~= nil\n and selectedUpgrades[row].xp ~= nil\n and selectedUpgrades[row].xp \u003e= customizations[row].checkboxes.count\nend\n\nfunction resetSelections()\n selectedUpgrades = { }\n updateDisplay()\nend\n\nfunction createUi()\n if customizations == nil then\n return\n end\n for i = 1, #customizations do\n if customizations[i].checkboxes ~= nil then\n createRowCheckboxes(i)\n end\n if customizations[i].textField ~= nil then\n createRowTextField(i)\n end\n end\n maybeMakeLivingInkSkillSelectionButtons()\n maybeMakeServitorSlotSelectionButtons()\n updateDisplay()\nend\n\nfunction createRowCheckboxes(rowIndex)\n local checkboxes = customizations[rowIndex].checkboxes\n rowCheckboxFirstIndex[rowIndex] = 0\n local previousButtons = self.getButtons()\n if previousButtons ~= nil then\n rowCheckboxFirstIndex[rowIndex] = #previousButtons\n end\n for col = 1, checkboxes.count do\n local funcName = \"checkboxRow\" .. rowIndex .. \"Col\" .. col\n local func = function() clickCheckbox(rowIndex, col) end\n self.setVar(funcName, func)\n local checkboxPos = getCheckboxPosition(rowIndex, col)\n\n self.createButton({\n click_function = funcName,\n function_owner = self,\n position = checkboxPos,\n height = boxSize * 10,\n width = boxSize * 10,\n font_size = 1000,\n scale = { 0.1, 0.1, 0.1 },\n color = { 0, 0, 0 },\n font_color = { 0, 0, 0 }\n })\n end\nend\n\nfunction getCheckboxPosition(row, col)\n return {\n x = xInitial + col * xOffset,\n y = Y_VISIBLE,\n z = customizations[row].checkboxes.posZ\n }\nend\n\nfunction createRowTextField(rowIndex)\n local textField = customizations[rowIndex].textField\n\n rowInputIndex[rowIndex] = 0\n local previousInputs = self.getInputs()\n if previousInputs ~= nil then\n rowInputIndex[rowIndex] = #previousInputs\n end\n local funcName = \"textbox\" .. rowIndex\n local func = function(_, _, val, sel) clickTextbox(rowIndex, val, sel) end\n self.setVar(funcName, func)\n\n self.createInput({\n input_function = funcName,\n function_owner = self,\n label = \"Click to type\",\n alignment = 2,\n position = textField.position,\n scale = { 0.1, 0.1, 0.1 },\n width = textField.width * 10,\n height = inputFontsize * 10 + 75,\n font_size = inputFontsize * 10.5,\n color = \"White\",\n value = \"\"\n })\nend\n\nfunction updateDisplay()\n for i = 1, #customizations do\n updateRowDisplay(i)\n end\n maybeUpdateLivingInkSkillDisplay()\n maybeUpdateServitorSlotDisplay()\nend\n\nfunction updateRowDisplay(rowIndex)\n if customizations[rowIndex].checkboxes ~= nil then\n updateCheckboxes(rowIndex)\n end\n if customizations[rowIndex].textField ~= nil then\n updateTextField(rowIndex)\n end\nend\n\nfunction updateCheckboxes(rowIndex)\n local checkboxCount = customizations[rowIndex].checkboxes.count\n local selected = 0\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].xp ~= nil then\n selected = selectedUpgrades[rowIndex].xp\n end\n local checkboxIndex = rowCheckboxFirstIndex[rowIndex]\n for col = 1, checkboxCount do\n local pos = getCheckboxPosition(rowIndex, col)\n if col \u003c= selected then\n pos.y = Y_VISIBLE\n else\n pos.y = Y_INVISIBLE\n end\n self.editButton({\n index = checkboxIndex,\n position = pos\n })\n checkboxIndex = checkboxIndex + 1\n end\nend\n\nfunction updateTextField(rowIndex)\n local inputIndex = rowInputIndex[rowIndex]\n if selectedUpgrades[rowIndex] ~= nil and selectedUpgrades[rowIndex].text ~= nil then\n self.editInput({\n index = inputIndex,\n value = \" \" .. selectedUpgrades[rowIndex].text\n })\n end\nend\n\nfunction clickCheckbox(row, col, buttonIndex)\n if selectedUpgrades[row] == nil then\n selectedUpgrades[row] = { }\n selectedUpgrades[row].xp = 0\n end\n if selectedUpgrades[row].xp == col then\n selectedUpgrades[row].xp = col - 1\n else\n selectedUpgrades[row].xp = col\n end\n updateCheckboxes(row)\n playmatApi.syncAllCustomizableCards()\nend\n\n-- Updates saved value for given text box when it loses focus\nfunction clickTextbox(rowIndex, value, selected)\n if selected == false then\n if selectedUpgrades[rowIndex] == nil then\n selectedUpgrades[rowIndex] = { }\n end\n selectedUpgrades[rowIndex].text = value:gsub(\"^%s*(.-)%s*$\", \"%1\")\n -- Editing isn't actually done yet, and will block the update. Wait a frame so it's finished\n Wait.frames(function() updateRowDisplay(rowIndex) end, 1)\n end\nend\n\n---------------------------------------------------------\n-- Living Ink related functions\n---------------------------------------------------------\n\n-- Builds the list of boolean skill selections from the Row 1 text field\nfunction maybeLoadLivingInkSkills()\n if selfId ~= \"09079-c\" then return end\n selectedSkills = {\n willpower = false,\n intellect = false,\n combat = false,\n agility = false\n }\n if selectedUpgrades[1] ~= nil and selectedUpgrades[1].text ~= nil then\n for skill in string.gmatch(selectedUpgrades[1].text, \"([^,]+)\") do\n selectedSkills[skill] = true\n end\n end\nend\n\nfunction clickSkill(skillname)\n selectedSkills[skillname] = not selectedSkills[skillname]\n maybeUpdateLivingInkSkillDisplay()\n updateSelectedLivingInkSkillText()\nend\n\n-- Creates the invisible buttons overlaying the skill icons\nfunction maybeMakeLivingInkSkillSelectionButtons()\n if selfId ~= \"09079-c\" then return end\n\n local buttonData = {\n function_owner = self,\n position = { y = 0.2 },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n\n for skillname, _ in pairs(selectedSkills) do\n local funcName = \"clickSkill\" .. skillname\n self.setVar(funcName, function() clickSkill(skillname) end)\n\n buttonData.click_function = funcName\n buttonData.position.x = -1 * SKILL_ICON_POSITIONS[skillname].x\n buttonData.position.z = SKILL_ICON_POSITIONS[skillname].z\n self.createButton(buttonData)\n end\nend\n\n-- Builds a comma-delimited string of skills and places it in the Row 1 text field\nfunction updateSelectedLivingInkSkillText()\n local skillString = \"\"\n if selectedSkills.willpower then\n skillString = skillString .. \"willpower\" .. \",\"\n end\n if selectedSkills.intellect then\n skillString = skillString .. \"intellect\" .. \",\"\n end\n if selectedSkills.combat then\n skillString = skillString .. \"combat\" .. \",\"\n end\n if selectedSkills.agility then\n skillString = skillString .. \"agility\" .. \",\"\n end\n if selectedUpgrades[1] == nil then\n selectedUpgrades[1] = { }\n end\n selectedUpgrades[1].text = skillString\nend\n\n-- Refresh the vector circles indicating a skill is selected. Since we can only have one table of\n-- vectors set, have to refresh all 4 at once\nfunction maybeUpdateLivingInkSkillDisplay()\n if selfId ~= \"09079-c\" then return end\n local circles = {}\n for skill, isSelected in pairs(selectedSkills) do\n if isSelected then\n local circle = getCircleVector(SKILL_ICON_POSITIONS[skill])\n if circle ~= nil then\n table.insert(circles, circle)\n end\n end\n end\n self.setVectorLines(circles)\nend\n\nfunction getCircleVector(center)\n local diameter = Vector(0, 0, 0.1)\n local pointOfOrigin = Vector(center.x, Y_VISIBLE, center.z)\n local vec\n local vecList = {}\n local arcStep = 5\n for i = 0, 360, arcStep do\n diameter:rotateOver('y', arcStep)\n vec = pointOfOrigin + diameter\n vec.y = pointOfOrigin.y\n table.insert(vecList, vec)\n end\n\n return {\n points = vecList,\n color = VECTOR_COLOR.mystic,\n thickness = 0.02,\n }\nend\n\n---------------------------------------------------------\n-- Summoned Servitor related functions\n---------------------------------------------------------\n\n-- Creates the invisible buttons overlaying the slot words\nfunction maybeMakeServitorSlotSelectionButtons()\n if selfId ~= \"09080-c\" then return end\n\n local buttonData = {\n click_function = \"clickArcane\",\n function_owner = self,\n position = { x = -1 * SLOT_ICON_POSITIONS.arcane.x, y = 0.2, z = SLOT_ICON_POSITIONS.arcane.z },\n height = 130,\n width = 130,\n color = { 0, 0, 0, 0 },\n }\n self.createButton(buttonData)\n\n buttonData.click_function = \"clickAlly\"\n buttonData.position.x = -1 * SLOT_ICON_POSITIONS.ally.x\n self.createButton(buttonData)\nend\n\n-- toggles the clicked slot\nfunction clickArcane()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.arcane\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- toggles the clicked slot\nfunction clickAlly()\n if selectedUpgrades[6] == nil then\n selectedUpgrades[6] = { }\n end\n if selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.none\n else\n selectedUpgrades[6].text = SUMMONED_SERVITOR_SLOT_INDICES.ally\n end\n maybeUpdateServitorSlotDisplay()\nend\n\n-- Refresh the vector circles indicating a slot is selected.\nfunction maybeUpdateServitorSlotDisplay()\n if selfId ~= \"09080-c\" then return end\n\n local center = SLOT_ICON_POSITIONS[\"arcane\"]\n local arcaneVecList = {\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.12, Y_VISIBLE, center.z + 0.05),\n }\n\n center = SLOT_ICON_POSITIONS[\"ally\"]\n local allyVecList = {\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z + 0.05),\n Vector(center.x - 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z - 0.05),\n Vector(center.x + 0.07, Y_VISIBLE, center.z + 0.05),\n }\n\n local arcaneVecColor = VECTOR_COLOR.unselected\n local allyVecColor = VECTOR_COLOR.unselected\n\n if selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.arcane then\n arcaneVecColor = VECTOR_COLOR.mystic\n elseif selectedUpgrades[6] ~= nil and selectedUpgrades[6].text == SUMMONED_SERVITOR_SLOT_INDICES.ally then\n allyVecColor = VECTOR_COLOR.mystic\n end\n\n self.setVectorLines({\n {\n points = arcaneVecList,\n color = arcaneVecColor,\n thickness = 0.02,\n },\n {\n points = allyVecList,\n color = allyVecColor,\n thickness = 0.02,\n }\n })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", "MeasureMovement": false, "Name": "Card", @@ -183351,7 +184303,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"07122-t\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Covenant. Blessed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", + "GMNotes": "{\n \"id\": \"07122-t\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"startsInPlay\": true,\n \"level\": 2,\n \"traits\": \"Covenant. Blessed.\",\n \"permanent\": true,\n \"cycle\": \"The Innsmouth Conspiracy\"\n}", "GUID": "e01cc7", "Grid": true, "GridProjection": false, @@ -183914,7 +184866,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/FluteoftheOuterGods4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param tokenData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FluteoftheOuterGods4\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/FluteoftheOuterGods4\", function(require, _LOADED, __bundle_register, __bundle_modules)\nVALID_TOKENS = {\n [\"Curse\"] = true\n}\n\nSHOW_SINGLE_RELEASE = true\nKEEP_OPEN = true\n\nrequire(\"playercards/CardsThatSealTokens\")\nend)\n__bundle_register(\"playercards/CardsThatSealTokens\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Library for cards that seal tokens\nThis file is used to add sealing option to cards' context menu.\nValid options (set before requiring this file):\n\nUPDATE_ON_HOVER --@type: boolean\n - automatically updates the context menu options when the card is hovered\n - the \"Read Bag\" function reads the content of the chaos bag to update the context menu\n - example usage: \"Unrelenting\" (to only display valid tokens)\n\nKEEP_OPEN --@type: boolean\n- meant for cards that seal single tokens multiple times (one by one)\n- makes the context menu stay open after selecting an option\n- example usage: \"Unrelenting\"\n\nSHOW_SINGLE_RELEASE --@type: boolean\n - enables an entry in the context menu\n - this entry allows releasing a single token\n - example usage: \"Holy Spear\" (to keep the other tokens and just release one)\n\nSHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)\n - enables an entry in the context menu\n - this entry allows releasing of multiple tokens at once\n - example usage: \"Nephthys\" (to release 3 bless tokens at once)\n\nSHOW_MULTI_RETURN --@type: number (amount of tokens to return to pool at once)\n - enables an entry in the context menu\n - this entry allows returning tokens to the token pool\n - example usage: \"Nephthys\" (to return 3 bless tokens at once)\n\nSHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)\n - enables an entry in the context menu\n - this entry allows sealing of multiple tokens at once\n - example usage: \"Holy Spear\" (to seal two bless tokens at once)\n\nVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens should be abled to be sealed\n - needs to be defined for each card -\u003e even if empty\n - example usage: \"The Chthonian Stone\"\n \u003e VALID_TOKENS = {\n \u003e [\"Skull\"] = true,\n \u003e [\"Cultist\"] = true,\n \u003e [\"Tablet\"] = true,\n \u003e [\"Elder Thing\"] = true,\n \u003e }\n\nINVALID_TOKENS --@type: table ([tokenName] = true)\n - this table defines which tokens are invalid for sealing\n - only needs to be defined if needed\n - usually combined with empty \"VALID_TOKENS\" table\n - example usage: \"Protective Incantation\" (not allowed to seal Auto-fail)\n\n----------------------------------------------------------\nExample 1: Crystalline Elder Sign\nThis card can only seal the \"+1\" or \"Elder Sign\" token,\nit does not need specific options for multi-sealing or releasing.\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"+1\"] = true,\n \u003e [\"Elder Sign\"] = true\n \u003e }\n \u003e require...\n----------------------------------------------------------\nExample 2: Holy Spear\nThis card features the following abilities (just listing the relevant parts):\n- releasing a single bless token\n- sealing two bless tokens\nThus it should be implemented like this:\n \u003e VALID_TOKENS = {\n \u003e [\"Bless\"] = true\n \u003e }\n \u003e SHOW_SINGLE_RELEASE = true\n \u003e SHOW_MULTI_SEAL = 2\n \u003e require...\n----------------------------------------------------------]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal tokenArrangerApi = require(\"accessories/TokenArrangerApi\")\n\nlocal sealedTokens = {}\nlocal ID_URL_MAP = {}\nlocal tokensInBag = {}\n\nfunction onSave() return JSON.encode(sealedTokens) end\n\nfunction onLoad(savedData)\n sealedTokens = JSON.decode(savedData) or {}\n ID_URL_MAP = chaosBagApi.getIdUrlMap()\n generateContextMenu()\n self.addTag(\"CardThatSeals\")\nend\n\n-- builds the context menu\nfunction generateContextMenu()\n -- conditional single or multi release options\n if SHOW_SINGLE_RELEASE then\n self.addContextMenuItem(\"Release token\", releaseOneToken)\n elseif SHOW_MULTI_RELEASE then\n self.addContextMenuItem(\"Release \" .. SHOW_MULTI_RELEASE .. \" token(s)\", releaseMultipleTokens)\n else\n self.addContextMenuItem(\"Release token(s)\", releaseAllTokens)\n end\n\n -- conditional release option\n if SHOW_MULTI_RETURN then\n self.addContextMenuItem(\"Return \" .. SHOW_MULTI_RETURN .. \" token(s)\", returnMultipleTokens)\n end\n\n -- main context menu options to seal tokens\n for _, map in pairs(ID_URL_MAP) do\n if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then\n if not SHOW_MULTI_SEAL then\n self.addContextMenuItem(\"Seal \" .. map.name, function(playerColor)\n sealToken(map.name, playerColor)\n end, KEEP_OPEN)\n else\n self.addContextMenuItem(\"Seal \" .. SHOW_MULTI_SEAL .. \" \" .. map.name, function(playerColor)\n readBag()\n local allowed = true\n local notFound\n\n for name, _ in pairs(VALID_TOKENS) do\n if (tokensInBag[name] or 0) \u003c SHOW_MULTI_SEAL then\n allowed = false\n notFound = name\n end\n end\n\n if allowed then\n for i = 1, SHOW_MULTI_SEAL do\n sealToken(map.name, playerColor)\n end\n else\n printToColor(\"Not enough \" .. notFound .. \" tokens in the chaos bag.\", playerColor)\n end\n end)\n end\n end\n end\nend\n\n-- generates a list of chaos tokens that is in the chaos bag\nfunction readBag()\n local chaosbag = chaosBagApi.findChaosBag()\n tokensInBag = {}\n\n for _, token in ipairs(chaosbag.getObjects()) do\n tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1\n end\nend\n\nfunction resetSealedTokens()\n sealedTokens = {}\nend\n\n-- native event from TTS - used to update the context menu for cards like \"Unrelenting\"\nfunction onHover()\n if UPDATE_ON_HOVER then\n readBag()\n self.clearContextMenu()\n generateContextMenu()\n end\nend\n\n-- seals the named token on this card\nfunction sealToken(name, playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n local chaosbag = chaosBagApi.findChaosBag()\n for i, obj in ipairs(chaosbag.getObjects()) do\n if obj.name == name then\n chaosbag.takeObject({\n position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),\n rotation = self.getRotation(),\n index = i - 1,\n smooth = false,\n callback_function = function(token)\n local guid = token.getGUID()\n table.insert(sealedTokens, guid)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.sealedToken(name, guid)\n end\n end\n })\n return\n end\n end\n printToColor(name .. \" token not found in chaos bag\", playerColor)\nend\n\n-- release the last sealed token\nfunction releaseOneToken(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token\", playerColor)\n putTokenAway(table.remove(sealedTokens))\n end\nend\n\n-- release multiple tokens at once\nfunction releaseMultipleTokens(playerColor)\n if SHOW_MULTI_RELEASE \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RELEASE do\n putTokenAway(table.remove(sealedTokens))\n end\n printToColor(\"Releasing \" .. SHOW_MULTI_RELEASE .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- releases all sealed tokens\nfunction releaseAllTokens(playerColor)\n if not chaosBagApi.canTouchChaosTokens() then return end\n if #sealedTokens == 0 then\n printToColor(\"No sealed token(s) found\", playerColor)\n else\n printToColor(\"Releasing token(s)\", playerColor)\n for _, guid in ipairs(sealedTokens) do\n putTokenAway(guid)\n end\n sealedTokens = {}\n end\nend\n\n-- returns multiple tokens at once to the token pool\nfunction returnMultipleTokens(playerColor)\n if SHOW_MULTI_RETURN \u003c= #sealedTokens then\n for i = 1, SHOW_MULTI_RETURN do\n returnToken(table.remove(sealedTokens))\n end\n printToColor(\"Returning \" .. SHOW_MULTI_RETURN .. \" tokens\", playerColor)\n else\n printToColor(\"Not enough tokens sealed.\", playerColor)\n end\nend\n\n-- returns the token (referenced by GUID) to the chaos bag\nfunction putTokenAway(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n local chaosbag = chaosBagApi.findChaosBag()\n chaosbag.putObject(token)\n tokenArrangerApi.layout()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.releasedToken(name, guid)\n end\nend\n\n-- returns the token to the pool (== removes it)\nfunction returnToken(guid)\n local token = getObjectFromGUID(guid)\n if not token then return end\n\n local name = token.getName()\n token.destruct()\n if name == \"Bless\" or name == \"Curse\" then\n blessCurseManagerApi.returnedToken(name, guid)\n end\nend\nend)\n__bundle_register(\"accessories/TokenArrangerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenArrangerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- local function to call the token arranger, if it is on the table\n ---@param functionName String Name of the function to cal\n ---@param argument Variant Parameter to pass\n local function callIfExistent(functionName, argument)\n local tokenArranger = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenArranger\")\n if tokenArranger ~= nil then\n tokenArranger.call(functionName, argument)\n end\n end\n\n -- updates the token modifiers with the provided data\n ---@param fullData Table Contains the chaos token metadata\n TokenArrangerApi.onTokenDataChanged = function(fullData)\n callIfExistent(\"onTokenDataChanged\", fullData)\n end\n\n -- deletes already laid out tokens\n TokenArrangerApi.deleteCopiedTokens = function()\n callIfExistent(\"deleteCopiedTokens\")\n end\n\n -- updates the laid out tokens\n TokenArrangerApi.layout = function()\n Wait.time(function() callIfExistent(\"layout\") end, 0.1)\n end\n\n return TokenArrangerApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/FluteoftheOuterGods4\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -184221,7 +185173,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -184899,7 +185851,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -185701,7 +186653,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/cards/ScrollofSecrets\")\nend)\n__bundle_register(\"playercards/cards/ScrollofSecrets\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- get class via metadata and create context menu accordingly\nfunction onLoad()\n local notes = JSON.decode(self.getGMNotes())\n if notes then\n createContextMenu(notes.id)\n else\n print(\"Missing metadata for Scroll of Secrets!\")\n end\nend\n\nfunction createContextMenu(id)\n if id == \"05116\" or id == \"05116-t\" then\n -- lvl 0: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n elseif id == \"05188\" or id == \"05188-t\" then\n -- seeker lvl 3: draw 3 cards from the bottom\n self.addContextMenuItem(\"Draw bottom card(s)\", function(playerColor) contextFunc(playerColor, 3) end)\n elseif id == \"05189\" or id == \"05189-t\" then\n -- mystic lvl 3: draw 1 card from the bottom\n self.addContextMenuItem(\"Draw bottom card\", function(playerColor) contextFunc(playerColor, 1) end)\n end\nend\n\nfunction contextFunc(playerColor, amount)\n local options = { \"Encounter Deck\" }\n\n -- check for players with a deck and only display them as option\n for _, color in ipairs(Player.getAvailableColors()) do\n local matColor = playmatApi.getMatColor(color)\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n\n if deckAreaObjects.draw or deckAreaObjects.topCard then\n table.insert(options, color)\n end\n end\n\n -- show the target selection dialog\n Player[playerColor].showOptionsDialog(\"Select target deck\", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)\nend\n\nfunction drawCardsFromBottom(playerColor, owner, amount)\n -- variable initialization\n local deck = nil\n local deckSize = 1\n local deckAreaObjects = {}\n\n -- get the respective deck\n if owner == \"Encounter Deck\" then\n deck = mythosAreaApi.getEncounterDeck()\n else\n local matColor = playmatApi.getMatColor(owner)\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deck = deckAreaObjects.draw\n end\n\n -- error handling\n if not deck then\n printToColor(\"Couldn't find deck!\", playerColor)\n return\n end\n\n -- set deck size if there is actually a deck and not just a card\n if deck.type == \"Deck\" then\n deckSize = #deck.getObjects()\n end\n\n -- proceed according to deck size\n if deckSize \u003e amount then\n for i = 1, amount do\n local card = deck.takeObject({ top = false, flip = true })\n card.deal(1, playerColor)\n end\n else\n -- deal the whole deck\n deck.deal(amount, playerColor)\n\n if deckSize \u003c amount then\n -- Norman Withers handling\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.deal(1, playerColor)\n deckSize = deckSize + 1\n end\n\n -- warning message for player\n if deckSize \u003c amount then\n printToColor(\"Deck didn't contain enough cards.\", playerColor)\n end\n end\n end\n printToColor(\"Handle the drawn cards according to the ability text on 'Scroll of Secrets'.\", playerColor)\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", @@ -185980,14 +186932,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 106, + "CardID": 12106, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186041,14 +186993,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 102, + "CardID": 12102, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186060,7 +187012,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10040\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10040\",\n \"type\": \"Asset\",\n \"slot\": \"Accessory\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "da9727", "Grid": true, "GridProjection": false, @@ -186103,14 +187055,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 109, + "CardID": 12109, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186164,14 +187116,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 101, + "CardID": 12101, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186225,14 +187177,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 103, + "CardID": 12103, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186244,7 +187196,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10042\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10042\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Seeker\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Tool. Science.\",\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "48be49", "Grid": true, "GridProjection": false, @@ -186287,14 +187239,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 100, + "CardID": 12100, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186348,14 +187300,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 105, + "CardID": 12105, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186367,7 +187319,7 @@ }, "Description": "Knows His Purpose", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10041\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Science.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10041\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Seeker\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Ally. Science.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "72efed", "Grid": true, "GridProjection": false, @@ -186410,14 +187362,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 104, + "CardID": 12104, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186472,14 +187424,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 108, + "CardID": 12108, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186533,14 +187485,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 107, + "CardID": 12107, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186594,14 +187546,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 110, + "CardID": 12110, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186656,14 +187608,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 111, + "CardID": 12111, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "121": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", @@ -186675,7 +187627,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10110\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10110\",\n \"type\": \"Asset\",\n \"slot\": \"Hand x2\",\n \"class\": \"Survivor\",\n \"cost\": 3,\n \"level\": 0,\n \"traits\": \"Item. Tool. Weapon. Melee.\",\n \"combatIcons\": 1,\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "45a724", "Grid": true, "GridProjection": false, @@ -186737,7 +187689,7 @@ }, "Description": "The Dead Speak (Advanced)", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"90050\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Instrument. Relic.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", + "GMNotes": "{\n \"id\": \"90050\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Item. Instrument. Relic.\",\n \"willpowerIcons\": 2,\n \"wildIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}", "GUID": "7dfd5f", "Grid": true, "GridProjection": false, @@ -187169,7 +188121,7 @@ }, "Description": "Friend or Foe?", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10119\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Ally. Creature. Cursed.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10119\",\n \"type\": \"Asset\",\n \"slot\": \"Ally\",\n \"class\": \"Survivor\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Ally. Creature. Cursed.\",\n \"agilityIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "2a0ba5", "Grid": true, "GridProjection": false, @@ -187182,7 +188134,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "CardCustom", - "Nickname": "\"Devil\"", + "Nickname": "\"Devil\" (2)", "SidewaysCard": false, "Snap": true, "Sticky": true, @@ -187415,7 +188367,7 @@ }, "Description": "Cursed Blade", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10092\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee. Cursed.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10092\",\n \"type\": \"Asset\",\n \"slot\": \"Hand\",\n \"class\": \"Mystic\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Item. Weapon. Melee. Cursed.\",\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "c9fb1f", "Grid": true, "GridProjection": false, @@ -187451,6 +188403,68 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 74100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "741": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278323044302431462/6976437175C83B7356B6C95335C1ED88140CD57A/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Moon's Sire", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10023\",\n \"type\": \"Asset\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm. Mask.\",\n \"agilityIcons\": 1,\n \"combatIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "975d89", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Wolf Mask", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.468, + "posY": 3.209, + "posZ": 18.322, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -187574,6 +188588,128 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 10200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "102": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2280574378897290922/CDA9AB9A68466987CF29AD56DA4BD4A98B19A638/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10125\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 2,\n \"traits\": \"Innate. Blessed.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "2cf42a", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Providential (2)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 10500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "105": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2280574378897291066/DC879288F0D5EFCF4309F03DC305A081902FEB29/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10074\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Trick.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "add232", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Vamp", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -187674,7 +188810,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "CardCustom", - "Nickname": "Occult Reliquary", + "Nickname": "Occult Reliquary (3)", "SidewaysCard": false, "Snap": true, "Sticky": true, @@ -187758,6 +188894,742 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 105100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1051": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255556703/D151EE26C6909481B57B07C1716A8E7BCED4B988/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10025\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 2,\n \"level\": 0,\n \"traits\": \"Spirit. Blessed.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "aef282", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Guided by Faith", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 8474100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "84741": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557283/E14EDC6948598047D0D876439AD44E924073F6BF/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557407/20471F625A68290478EF8A681CBA7CB68E1CD521/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10015-m\",\n \"type\": \"Minicard\"\n}", + "GUID": "3764cc", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hank Samson", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Minicard" + ], + "Tooltip": true, + "Transform": { + "posX": 5.756, + "posY": 3.649, + "posZ": 15.392, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.6, + "scaleY": 1, + "scaleZ": 0.6 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 11600, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "116": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557010/8DF21C152DA7F606A8037D24279E9517F8BB3E85/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557149/D8D7CA505C221592685FFE01A493875A859DBE3F/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Farmhand", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10015\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Assistant. Warden.\",\n \"bonded\": [\n {\n \"count\": 1,\n \"id\": \"10015-b1\"\n },\n {\n \"count\": 1,\n \"id\": \"10015-b2\"\n }\n ],\n \"willpowerIcons\": 3,\n \"intellectIcons\": 1,\n \"combatIcons\": 5,\n \"agilityIcons\": 3,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "3764cd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hank Samson", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.227, + "posY": 3.548, + "posZ": 2.42, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 115200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1152": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557010/8DF21C152DA7F606A8037D24279E9517F8BB3E85/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255556877/A9A8E5091268C0B6D076058B2FC4B0FDECC62388/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Farmhand", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10015-b1\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Assistant. Resolute.\",\n \"willpowerIcons\": 3,\n \"intellectIcons\": 3,\n \"combatIcons\": 4,\n \"agilityIcons\": 4,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "3764ce", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hank Samson (Assistant)", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.227, + "posY": 3.548, + "posZ": 2.42, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 115300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1153": { + "BackIsHidden": true, + "BackURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557010/8DF21C152DA7F606A8037D24279E9517F8BB3E85/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557592/1223DD109412F49A37C56EB5164325C52F0F3924/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Farmhand", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10015-b2\",\n \"type\": \"Investigator\",\n \"class\": \"Survivor\",\n \"traits\": \"Warden. Resolute\",\n \"willpowerIcons\": 4,\n \"intellectIcons\": 1,\n \"combatIcons\": 6,\n \"agilityIcons\": 3,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "3764cf", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hank Samson (Warden)", + "SidewaysCard": true, + "Snap": true, + "Sticky": true, + "Tags": [ + "Investigator", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.227, + "posY": 3.548, + "posZ": 2.42, + "rotX": 0, + "rotY": 180, + "rotZ": 0, + "scaleX": 1.15, + "scaleY": 1, + "scaleZ": 1.15 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 105300, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1053": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557726/4725495E403D9EE65EF5F9136F700D429C81AF52/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10026\",\n \"type\": \"Event\",\n \"class\": \"Guardian\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Tactic. Trick.\",\n \"agilityIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "aef182", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Hold Up", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 51400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "514": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255557867/008C1DCB5CE961BEB32E83846BBEF4DA0F9EB38E/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10109\",\n \"type\": \"Asset\",\n \"class\": \"Survivor\",\n \"level\": 0,\n \"traits\": \"Item. Supply.\",\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "aa11bc", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Pelt Shipment", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.005, + "posY": 3.859, + "posZ": -16.695, + "rotX": 1, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 131500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1315": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255558285/956F8A6681A8C59624AFE2EE21D137D467182515/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10083\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 3,\n \"level\": 5,\n \"traits\": \"Trick. Gambit.\",\n \"intellectIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "add252", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Stir the Pot (5)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 10800, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "108": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255558157/7F564EC50CF2DED0C98A9D3AB8912C2ACA5C49F5/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10078\",\n \"type\": \"Event\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 2,\n \"traits\": \"Favor. Trick.\",\n \"agilityIcons\": 1,\n \"intellectIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "add242", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Snitch (2)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 910400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "9104": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255558543/20409C8476361342F4067117A61ABFC07326F948/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10018\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Flaw.\",\n \"weakness\": true,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "9aba43", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "\"Where's Pa?\"", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 10.69, + "posY": 2.439, + "posZ": 43.876, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 12400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "124": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255558022/32883D27BAD8B1BD11F955D75BC7DA0BB0C8BBC3/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10118\",\n \"type\": \"Skill\",\n \"class\": \"Survivor\",\n \"level\": 1,\n \"traits\": \"Innate.\",\n \"wildIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "2cf51", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Persistence (1)", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": 6.499, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 25200, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "252": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2278324073255558420/A4269A773E17F55209B1DEBC2EA627314E1070E5/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10017\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n \"cost\": 2,\n \"traits\": \"Spirit.\",\n \"combatIcons\": 1,\n \"wildIcons\": 1,\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "265ad2", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Stouthearted", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 9.325, + "posY": 3.548, + "posZ": -0.836, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -187907,7 +189779,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"10091\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent. Ritual.\",\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GMNotes": "{\n \"id\": \"10091\",\n \"type\": \"Asset\",\n \"slot\": \"Arcane\",\n \"class\": \"Mystic\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Talent. Ritual.\",\n \"uses\": [\n {\n \"count\": 6,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"willpowerIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", "GUID": "c763aa", "Grid": true, "GridProjection": false, @@ -187950,14 +189822,14 @@ "z": 0 }, "Autoraise": true, - "CardID": 100, + "CardID": 20100, "ColorDiffuse": { "b": 0.71324, "g": 0.71324, "r": 0.71324 }, "CustomDeck": { - "1": { + "201": { "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2172484009070977509/27A8CCF2BC48CAD909180D64177E86B8232F66C6/", @@ -188003,6 +189875,191 @@ }, "Value": 0, "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 13100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "131": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2316603641240722224/B99E98444E70743A1A55DF86CC7EF09C9B4B43FF/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10049\",\n \"type\": \"Event\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Gambit. Improvised.\",\n \"intellectIcons\": 1,\n \"combatIcons\": 1,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "d617ab", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "\"Throw the Book at Them!\"", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2500, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "25": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2316603641240799540/C9D5A77FF0A0ED8DB1BBBBF0B02296B49E0E3CE8/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Wise Trickster", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10067\",\n \"type\": \"Asset\",\n \"class\": \"Rogue\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm. Mask.\",\n \"intellectIcons\": 1,\n \"agilityIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "4144cd", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Fox Mask", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 2400, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "24": { + "BackIsHidden": true, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2317731538678126539/603CACA51D3BB18D8E97BB18CE9DE3A6E517AFF6/", + "NumHeight": 1, + "NumWidth": 1, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Meek Watcher", + "DragSelectable": true, + "GMNotes": "{\n \"id\": \"10043\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n \"cost\": 1,\n \"level\": 0,\n \"traits\": \"Item. Charm. Mask.\",\n \"willpowerIcons\": 1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 2,\n \"type\": \"Offering\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Feast of Hemlock Vale\"\n}", + "GUID": "32ad21", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "CardCustom", + "Nickname": "Mouse Mask", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 13.082, + "posY": 3.548, + "posZ": -7.159, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" } ], "Description": "", @@ -188016,7 +190073,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/AllCardsBag\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal cardIdIndex = { }\nlocal classAndLevelIndex = { }\nlocal basicWeaknessList = { }\nlocal uniqueWeaknessList = { }\nlocal cycleIndex = { }\n\nlocal indexingDone = false\nlocal allowRemoval = false\n\nfunction onLoad()\n self.addContextMenuItem(\"Rebuild Index\", startIndexBuild)\n math.randomseed(os.time())\n Wait.frames(startIndexBuild, 30)\nend\n\n-- Called by Hotfix bags when they load. If we are still loading indexes, then\n-- the all cards and hotfix bags are being loaded together, and we can ignore\n-- this call as the hotfix will be included in the initial indexing. If it is\n-- called once indexing is complete it means the hotfix bag has been added\n-- later, and we should rebuild the index to integrate the hotfix bag.\nfunction rebuildIndexForHotfix()\n if (indexingDone) then\n startIndexBuild()\n end\nend\n\n-- Resets all current bag indexes\nfunction clearIndexes()\n indexingDone = false\n cardIdIndex = { }\n classAndLevelIndex = { }\n classAndLevelIndex[\"Guardian-upgrade\"] = { }\n classAndLevelIndex[\"Seeker-upgrade\"] = { }\n classAndLevelIndex[\"Mystic-upgrade\"] = { }\n classAndLevelIndex[\"Survivor-upgrade\"] = { }\n classAndLevelIndex[\"Rogue-upgrade\"] = { }\n classAndLevelIndex[\"Neutral-upgrade\"] = { }\n classAndLevelIndex[\"Guardian-level0\"] = { }\n classAndLevelIndex[\"Seeker-level0\"] = { }\n classAndLevelIndex[\"Mystic-level0\"] = { }\n classAndLevelIndex[\"Survivor-level0\"] = { }\n classAndLevelIndex[\"Rogue-level0\"] = { }\n classAndLevelIndex[\"Neutral-level0\"] = { }\n cycleIndex = { }\n basicWeaknessList = { }\n uniqueWeaknessList = { }\nend\n\n-- Clears the bag indexes and starts the coroutine to rebuild the indexes\nfunction startIndexBuild(playerColor)\n clearIndexes()\n startLuaCoroutine(self, \"buildIndex\")\nend\n\nfunction onObjectLeaveContainer(container, object)\n if (container == self and not allowRemoval) then\n broadcastToAll(\n \"Removing cards from the All Player Cards bag may break some functions. Please replace the card.\",\n {0.9, 0.2, 0.2}\n )\n end\nend\n\n-- Debug option to suppress the warning when cards are removed from the bag\nfunction setAllowCardRemoval()\n allowRemoval = true\nend\n\n-- Create the card indexes by iterating all cards in the bag, parsing their\n-- metadata, and creating the keyed lookup tables for the cards. This is a\n-- coroutine which will spread the workload by processing 20 cards before\n-- yielding. Based on the current count of cards this will require\n-- approximately 60 frames to complete.\nfunction buildIndex()\n indexingDone = false\n if (self.getData().ContainedObjects == nil) then\n return 1\n end\n for i, cardData in ipairs(self.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(cardData.GMNotes)\n if (cardMetadata ~= nil) then\n addCardToIndex(cardData, cardMetadata)\n end\n if (i % 20 == 0) then\n coroutine.yield(0)\n end\n end\n local hotfixBags = getObjectsWithTag(\"AllCardsHotfix\")\n for _, hotfixBag in ipairs(hotfixBags) do\n if (#hotfixBag.getObjects() \u003e 0) then\n for i, cardData in ipairs(hotfixBag.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(cardData.GMNotes)\n if (cardMetadata ~= nil) then\n addCardToIndex(cardData, cardMetadata)\n end\n end\n end\n end\n buildSupplementalIndexes()\n indexingDone = true\n return 1\nend\n\n-- Adds a card to any indexes it should be a part of, based on its metadata.\n-- Param cardData: TTS object data for the card\n-- Param cardMetadata: SCED metadata for the card\nfunction addCardToIndex(cardData, cardMetadata)\n cardIdIndex[cardMetadata.id] = { data = cardData, metadata = cardMetadata }\n if (cardMetadata.alternate_ids ~= nil) then\n for _, alternateId in ipairs(cardMetadata.alternate_ids) do\n cardIdIndex[alternateId] = { data = cardData, metadata = cardMetadata }\n end\n end\nend\n\nfunction buildSupplementalIndexes()\n for cardId, card in pairs(cardIdIndex) do\n local cardData = card.data\n local cardMetadata = card.metadata\n -- If the ID key and the metadata ID don't match this is a duplicate card created by an\n -- alternate_id, and we should skip it\n if cardId == cardMetadata.id then\n -- Add card to the basic weakness list, if appropriate. Some weaknesses have\n -- multiple copies, and are added multiple times\n if cardMetadata.weakness then\n table.insert(uniqueWeaknessList, cardMetadata.id)\n if cardMetadata.basicWeaknessCount ~= nil then\n for i = 1, cardMetadata.basicWeaknessCount do\n table.insert(basicWeaknessList, cardMetadata.id)\n end\n end\n end\n\n -- Add the card to the appropriate class and level indexes\n local isGuardian = false\n local isSeeker = false\n local isMystic = false\n local isRogue = false\n local isSurvivor = false\n local isNeutral = false\n local upgradeKey\n -- Excludes signature cards (which have no class or level) and alternate\n -- ID entries\n if (cardMetadata.class ~= nil and cardMetadata.level ~= nil) then\n isGuardian = string.match(cardMetadata.class, \"Guardian\")\n isSeeker = string.match(cardMetadata.class, \"Seeker\")\n isMystic = string.match(cardMetadata.class, \"Mystic\")\n isRogue = string.match(cardMetadata.class, \"Rogue\")\n isSurvivor = string.match(cardMetadata.class, \"Survivor\")\n isNeutral = string.match(cardMetadata.class, \"Neutral\")\n if (cardMetadata.level \u003e 0) then\n upgradeKey = \"-upgrade\"\n else\n upgradeKey = \"-level0\"\n end\n if (isGuardian) then\n table.insert(classAndLevelIndex[\"Guardian\"..upgradeKey], cardMetadata.id)\n end\n if (isSeeker) then\n table.insert(classAndLevelIndex[\"Seeker\"..upgradeKey], cardMetadata.id)\n end\n if (isMystic) then\n table.insert(classAndLevelIndex[\"Mystic\"..upgradeKey], cardMetadata.id)\n end\n if (isRogue) then\n table.insert(classAndLevelIndex[\"Rogue\"..upgradeKey], cardMetadata.id)\n end\n if (isSurvivor) then\n table.insert(classAndLevelIndex[\"Survivor\"..upgradeKey], cardMetadata.id)\n end\n if (isNeutral) then\n table.insert(classAndLevelIndex[\"Neutral\"..upgradeKey], cardMetadata.id)\n end\n\n local cycleName = cardMetadata.cycle\n if cycleName ~= nil then\n cycleName = string.lower(cycleName)\n if string.match(cycleName, \"return\") then\n cycleName = string.sub(cycleName, 11)\n end\n if cycleName == \"the night of the zealot\" then\n cycleName = \"core\"\n end\n if cycleIndex[cycleName] == nil then\n cycleIndex[cycleName] = { }\n end\n table.insert(cycleIndex[cycleName], cardMetadata.id)\n end\n end\n end\n end\n for _, indexTable in pairs(classAndLevelIndex) do\n table.sort(indexTable, cardComparator)\n end\n for _, indexTable in pairs(cycleIndex) do\n table.sort(indexTable)\n end\n table.sort(basicWeaknessList, cardComparator)\n table.sort(uniqueWeaknessList, cardComparator)\nend\n\n-- Comparison function used to sort the class card bag indexes. Sorts by card\n-- level, then name, then subname.\nfunction cardComparator(id1, id2)\n local card1 = cardIdIndex[id1]\n local card2 = cardIdIndex[id2]\n\n if (card1.metadata.level ~= card2.metadata.level) then\n return card1.metadata.level \u003c card2.metadata.level\n end\n if (card1.data.Nickname ~= card2.data.Nickname) then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\nend\n\nfunction isIndexReady()\n return indexingDone\nend\n\n-- Returns a specific card from the bag, based on ArkhamDB ID\n-- Params table:\n-- id: String ID of the card to retrieve\n-- Return: If the indexes are still being constructed, an empty table is\n-- returned. Otherwise, a single table with the following fields\n-- cardData: TTS object data, suitable for spawning the card\n-- cardMetadata: Table of parsed metadata\nfunction getCardById(params)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n return cardIdIndex[params.id]\nend\n\n-- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n-- Params table:\n-- class: String class to retrieve (\"Guardian\", \"Seeker\", etc)\n-- isUpgraded: true for upgraded cards (Level 1-5), false for Level 0\n-- Return: If the indexes are still being constructed, returns an empty table.\n-- Otherwise, a list of tables, each with the following fields\n-- cardData: TTS object data, suitable for spawning the card\n-- cardMetadata: Table of parsed metadata\nfunction getCardsByClassAndLevel(params)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n local upgradeKey\n if (params.upgraded) then\n upgradeKey = \"-upgrade\"\n else\n upgradeKey = \"-level0\"\n end\n return classAndLevelIndex[params.class..upgradeKey];\nend\n\nfunction getCardsByCycle(cycleName)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n return cycleIndex[string.lower(cycleName)]\nend\n\n-- Searches the bag for cards which match the given name and returns a list. Note that this is\n-- an O(n) search without index support. It may be slow.\n-- Parameter array must contain these fields to define the search:\n-- name String or string fragment to search for names\n-- exact Whether the name match should be exact\nfunction getCardsByName(params)\n local name = params.name\n local exact = params.exact\n local results = { }\n -- Track cards (by ID) that we've added to avoid duplicates that may come from alternate IDs\n local addedCards = { }\n for _, cardData in pairs(cardIdIndex) do\n if (not addedCards[cardData.metadata.id]) then\n if (exact and (string.lower(cardData.data.Nickname) == string.lower(name)))\n or (not exact and string.find(string.lower(cardData.data.Nickname), string.lower(name), 1, true)) then\n table.insert(results, cardData)\n addedCards[cardData.metadata.id] = true\n end\n end\n end\n return results\nend\n\n-- Gets a random basic weakness from the bag. Once a given ID has been returned\n-- it will be removed from the list and cannot be selected again until a reload\n-- occurs or the indexes are rebuilt, which will refresh the list to include all\n-- weaknesses.\n-- Return: String ID of the selected weakness.\nfunction getRandomWeaknessId()\n local availableWeaknesses = buildAvailableWeaknesses()\n if (#availableWeaknesses \u003e 0) then\n return availableWeaknesses[math.random(#availableWeaknesses)]\n end\nend\n\n-- Constructs a list of available basic weaknesses by starting with the full pool of basic\n-- weaknesses then removing any which are currently in the play or deck construction areas\n-- Return: Table array of weakness IDs which are valid to choose from\nfunction buildAvailableWeaknesses()\n local weaknessesInPlay = { }\n local allObjects = getAllObjects()\n for _, object in ipairs(allObjects) do\n if (object.name == \"Deck\") then\n for _, cardData in ipairs(object.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(cardData.GMNotes)\n incrementWeaknessCount(weaknessesInPlay, cardMetadata)\n end\n elseif (object.name == \"Card\") then\n local cardMetadata = JSON.decode(object.getGMNotes())\n incrementWeaknessCount(weaknessesInPlay, cardMetadata)\n end\n end\n\n local availableWeaknesses = { }\n for _, weaknessId in ipairs(basicWeaknessList) do\n if (weaknessesInPlay[weaknessId] ~= nil and weaknessesInPlay[weaknessId] \u003e 0) then\n weaknessesInPlay[weaknessId] = weaknessesInPlay[weaknessId] - 1\n else\n table.insert(availableWeaknesses, weaknessId)\n end\n end\n return availableWeaknesses\nend\n\nfunction getBasicWeaknesses()\n return basicWeaknessList\nend\n\nfunction getUniqueWeaknesses()\n return uniqueWeaknessList\nend\n\n-- Helper function that adds one to the table entry for the number of weaknesses in play\nfunction incrementWeaknessCount(table, cardMetadata)\n if (isBasicWeakness(cardMetadata)) then\n if (table[cardMetadata.id] == nil) then\n table[cardMetadata.id] = 1\n else\n table[cardMetadata.id] = table[cardMetadata.id] + 1\n end\n end\nend\n\nfunction isBasicWeakness(cardMetadata)\n return cardMetadata ~= nil\n and cardMetadata.weakness\n and cardMetadata.basicWeaknessCount ~= nil\n and cardMetadata.basicWeaknessCount \u003e 0\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/AllCardsBag\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/AllCardsBag\")\nend)\n__bundle_register(\"playercards/AllCardsBag\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal cardIdIndex = { }\nlocal classAndLevelIndex = { }\nlocal basicWeaknessList = { }\nlocal uniqueWeaknessList = { }\nlocal cycleIndex = { }\n\nlocal indexingDone = false\nlocal allowRemoval = false\n\nfunction onLoad()\n self.addContextMenuItem(\"Rebuild Index\", startIndexBuild)\n math.randomseed(os.time())\n Wait.frames(startIndexBuild, 30)\nend\n\n-- Called by Hotfix bags when they load. If we are still loading indexes, then\n-- the all cards and hotfix bags are being loaded together, and we can ignore\n-- this call as the hotfix will be included in the initial indexing. If it is\n-- called once indexing is complete it means the hotfix bag has been added\n-- later, and we should rebuild the index to integrate the hotfix bag.\nfunction rebuildIndexForHotfix()\n if (indexingDone) then\n startIndexBuild()\n end\nend\n\n-- Resets all current bag indexes\nfunction clearIndexes()\n indexingDone = false\n cardIdIndex = { }\n classAndLevelIndex = { }\n classAndLevelIndex[\"Guardian-upgrade\"] = { }\n classAndLevelIndex[\"Seeker-upgrade\"] = { }\n classAndLevelIndex[\"Mystic-upgrade\"] = { }\n classAndLevelIndex[\"Survivor-upgrade\"] = { }\n classAndLevelIndex[\"Rogue-upgrade\"] = { }\n classAndLevelIndex[\"Neutral-upgrade\"] = { }\n classAndLevelIndex[\"Guardian-level0\"] = { }\n classAndLevelIndex[\"Seeker-level0\"] = { }\n classAndLevelIndex[\"Mystic-level0\"] = { }\n classAndLevelIndex[\"Survivor-level0\"] = { }\n classAndLevelIndex[\"Rogue-level0\"] = { }\n classAndLevelIndex[\"Neutral-level0\"] = { }\n cycleIndex = { }\n basicWeaknessList = { }\n uniqueWeaknessList = { }\nend\n\n-- Clears the bag indexes and starts the coroutine to rebuild the indexes\nfunction startIndexBuild(playerColor)\n clearIndexes()\n startLuaCoroutine(self, \"buildIndex\")\nend\n\nfunction onObjectLeaveContainer(container, object)\n if (container == self and not allowRemoval) then\n broadcastToAll(\n \"Removing cards from the All Player Cards bag may break some functions. Please replace the card.\",\n {0.9, 0.2, 0.2}\n )\n end\nend\n\n-- Debug option to suppress the warning when cards are removed from the bag\nfunction setAllowCardRemoval()\n allowRemoval = true\nend\n\n-- Create the card indexes by iterating all cards in the bag, parsing their\n-- metadata, and creating the keyed lookup tables for the cards. This is a\n-- coroutine which will spread the workload by processing 20 cards before\n-- yielding. Based on the current count of cards this will require\n-- approximately 60 frames to complete.\nfunction buildIndex()\n local cardCount = 0\n indexingDone = false\n if (self.getData().ContainedObjects == nil) then\n return 1\n end\n for i, cardData in ipairs(self.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(cardData.GMNotes)\n if (cardMetadata ~= nil) then\n addCardToIndex(cardData, cardMetadata)\n cardCount = cardCount + 1\n if cardCount \u003e 9 then\n cardCount = 0\n coroutine.yield(0)\n end\n end\n end\n local hotfixBags = getObjectsWithTag(\"AllCardsHotfix\")\n for _, hotfixBag in ipairs(hotfixBags) do\n if (#hotfixBag.getObjects() \u003e 0) then\n for i, cardData in ipairs(hotfixBag.getData().ContainedObjects) do\n if cardData.ContainedObjects then\n for j, deepCardData in ipairs(cardData.ContainedObjects) do\n local deepCardMetadata = JSON.decode(deepCardData.GMNotes)\n if deepCardMetadata ~= nil then\n addCardToIndex(deepCardData, deepCardMetadata)\n cardCount = cardCount + 1\n if cardCount \u003e 9 then\n cardCount = 0\n coroutine.yield(0)\n end\n end\n end\n else\n local cardMetadata = JSON.decode(cardData.GMNotes)\n if cardMetadata ~= nil then\n addCardToIndex(cardData, cardMetadata)\n cardCount = cardCount + 1\n if cardCount \u003e 9 then\n cardCount = 0\n coroutine.yield(0)\n end\n end\n end\n end\n end\n end\n buildSupplementalIndexes()\n indexingDone = true\n return 1\nend\n\n-- Adds a card to any indexes it should be a part of, based on its metadata.\n---@param cardData: TTS object data for the card\n---@param cardMetadata: SCED metadata for the card\nfunction addCardToIndex(cardData, cardMetadata)\n -- use the ZoopGuid as fallback if no id present\n if cardMetadata.id == nil and cardMetadata.TtsZoopGuid then\n cardMetadata.id = cardMetadata.TtsZoopGuid\n end\n cardIdIndex[cardMetadata.id] = { data = cardData, metadata = cardMetadata }\n if (cardMetadata.alternate_ids ~= nil) then\n for _, alternateId in ipairs(cardMetadata.alternate_ids) do\n cardIdIndex[alternateId] = { data = cardData, metadata = cardMetadata }\n end\n end\nend\n\nfunction buildSupplementalIndexes()\n for cardId, card in pairs(cardIdIndex) do\n local cardData = card.data\n local cardMetadata = card.metadata\n -- If the ID key and the metadata ID don't match this is a duplicate card created by an\n -- alternate_id, and we should skip it\n if cardId == cardMetadata.id then\n -- Add card to the basic weakness list, if appropriate. Some weaknesses have\n -- multiple copies, and are added multiple times\n if cardMetadata.weakness then\n table.insert(uniqueWeaknessList, cardMetadata.id)\n if cardMetadata.basicWeaknessCount ~= nil then\n for i = 1, cardMetadata.basicWeaknessCount do\n table.insert(basicWeaknessList, cardMetadata.id)\n end\n end\n end\n\n -- Add the card to the appropriate class and level indexes\n local isGuardian = false\n local isSeeker = false\n local isMystic = false\n local isRogue = false\n local isSurvivor = false\n local isNeutral = false\n local upgradeKey\n -- Excludes signature cards (which have no class or level) and alternate\n -- ID entries\n if (cardMetadata.class ~= nil and cardMetadata.level ~= nil) then\n isGuardian = string.match(cardMetadata.class, \"Guardian\")\n isSeeker = string.match(cardMetadata.class, \"Seeker\")\n isMystic = string.match(cardMetadata.class, \"Mystic\")\n isRogue = string.match(cardMetadata.class, \"Rogue\")\n isSurvivor = string.match(cardMetadata.class, \"Survivor\")\n isNeutral = string.match(cardMetadata.class, \"Neutral\")\n if (cardMetadata.level \u003e 0) then\n upgradeKey = \"-upgrade\"\n else\n upgradeKey = \"-level0\"\n end\n if (isGuardian) then\n table.insert(classAndLevelIndex[\"Guardian\"..upgradeKey], cardMetadata.id)\n end\n if (isSeeker) then\n table.insert(classAndLevelIndex[\"Seeker\"..upgradeKey], cardMetadata.id)\n end\n if (isMystic) then\n table.insert(classAndLevelIndex[\"Mystic\"..upgradeKey], cardMetadata.id)\n end\n if (isRogue) then\n table.insert(classAndLevelIndex[\"Rogue\"..upgradeKey], cardMetadata.id)\n end\n if (isSurvivor) then\n table.insert(classAndLevelIndex[\"Survivor\"..upgradeKey], cardMetadata.id)\n end\n if (isNeutral) then\n table.insert(classAndLevelIndex[\"Neutral\"..upgradeKey], cardMetadata.id)\n end\n\n local cycleName = cardMetadata.cycle\n if cycleName ~= nil then\n cycleName = string.lower(cycleName)\n if string.match(cycleName, \"return\") then\n cycleName = string.sub(cycleName, 11)\n end\n if cycleName == \"the night of the zealot\" then\n cycleName = \"core\"\n end\n if cycleIndex[cycleName] == nil then\n cycleIndex[cycleName] = { }\n end\n table.insert(cycleIndex[cycleName], cardMetadata.id)\n end\n end\n end\n end\n for _, indexTable in pairs(classAndLevelIndex) do\n table.sort(indexTable, cardComparator)\n end\n for _, indexTable in pairs(cycleIndex) do\n table.sort(indexTable)\n end\n table.sort(basicWeaknessList, cardComparator)\n table.sort(uniqueWeaknessList, cardComparator)\nend\n\n-- Comparison function used to sort the class card bag indexes. Sorts by card\n-- level, then name, then subname.\nfunction cardComparator(id1, id2)\n local card1 = cardIdIndex[id1]\n local card2 = cardIdIndex[id2]\n\n if (card1.metadata.level ~= card2.metadata.level) then\n return card1.metadata.level \u003c card2.metadata.level\n end\n if (card1.data.Nickname ~= card2.data.Nickname) then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\nend\n\nfunction isIndexReady()\n return indexingDone\nend\n\n-- Returns a specific card from the bag, based on ArkhamDB ID\n-- Params table:\n-- id: String ID of the card to retrieve\n-- Return: If the indexes are still being constructed, an empty table is\n-- returned. Otherwise, a single table with the following fields\n-- cardData: TTS object data, suitable for spawning the card\n-- cardMetadata: Table of parsed metadata\nfunction getCardById(params)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n return cardIdIndex[params.id]\nend\n\n-- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n-- Params table:\n-- class: String class to retrieve (\"Guardian\", \"Seeker\", etc)\n-- isUpgraded: true for upgraded cards (Level 1-5), false for Level 0\n-- Return: If the indexes are still being constructed, returns an empty table.\n-- Otherwise, a list of tables, each with the following fields\n-- cardData: TTS object data, suitable for spawning the card\n-- cardMetadata: Table of parsed metadata\nfunction getCardsByClassAndLevel(params)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n local upgradeKey\n if (params.upgraded) then\n upgradeKey = \"-upgrade\"\n else\n upgradeKey = \"-level0\"\n end\n return classAndLevelIndex[params.class..upgradeKey];\nend\n\nfunction getCardsByCycle(cycleName)\n if (not indexingDone) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return { }\n end\n return cycleIndex[string.lower(cycleName)]\nend\n\n-- Searches the bag for cards which match the given name and returns a list. Note that this is\n-- an O(n) search without index support. It may be slow.\n-- Parameter array must contain these fields to define the search:\n-- name String or string fragment to search for names\n-- exact Whether the name match should be exact\nfunction getCardsByName(params)\n local name = params.name\n local exact = params.exact\n local results = { }\n -- Track cards (by ID) that we've added to avoid duplicates that may come from alternate IDs\n local addedCards = { }\n for _, cardData in pairs(cardIdIndex) do\n if (not addedCards[cardData.metadata.id]) then\n if (exact and (string.lower(cardData.data.Nickname) == string.lower(name)))\n or (not exact and string.find(string.lower(cardData.data.Nickname), string.lower(name), 1, true)) then\n table.insert(results, cardData)\n addedCards[cardData.metadata.id] = true\n end\n end\n end\n return results\nend\n\n-- Gets a random basic weakness from the bag. Once a given ID has been returned\n-- it will be removed from the list and cannot be selected again until a reload\n-- occurs or the indexes are rebuilt, which will refresh the list to include all\n-- weaknesses.\n-- Return: String ID of the selected weakness.\nfunction getRandomWeaknessId()\n local availableWeaknesses = buildAvailableWeaknesses()\n if (#availableWeaknesses \u003e 0) then\n return availableWeaknesses[math.random(#availableWeaknesses)]\n end\nend\n\n-- Constructs a list of available basic weaknesses by starting with the full pool of basic\n-- weaknesses then removing any which are currently in the play or deck construction areas\n-- Return: Table array of weakness IDs which are valid to choose from\nfunction buildAvailableWeaknesses()\n local weaknessesInPlay = { }\n local allObjects = getAllObjects()\n for _, object in ipairs(allObjects) do\n if (object.name == \"Deck\") then\n for _, cardData in ipairs(object.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(cardData.GMNotes)\n incrementWeaknessCount(weaknessesInPlay, cardMetadata)\n end\n elseif (object.name == \"Card\") then\n local cardMetadata = JSON.decode(object.getGMNotes())\n incrementWeaknessCount(weaknessesInPlay, cardMetadata)\n end\n end\n\n local availableWeaknesses = { }\n for _, weaknessId in ipairs(basicWeaknessList) do\n if (weaknessesInPlay[weaknessId] ~= nil and weaknessesInPlay[weaknessId] \u003e 0) then\n weaknessesInPlay[weaknessId] = weaknessesInPlay[weaknessId] - 1\n else\n table.insert(availableWeaknesses, weaknessId)\n end\n end\n return availableWeaknesses\nend\n\nfunction getBasicWeaknesses()\n return basicWeaknessList\nend\n\nfunction getUniqueWeaknesses()\n return uniqueWeaknessList\nend\n\n-- Helper function that adds one to the table entry for the number of weaknesses in play\nfunction incrementWeaknessCount(table, cardMetadata)\n if (isBasicWeakness(cardMetadata)) then\n if (table[cardMetadata.id] == nil) then\n table[cardMetadata.id] = 1\n else\n table[cardMetadata.id] = table[cardMetadata.id] + 1\n end\n end\nend\n\nfunction isBasicWeakness(cardMetadata)\n return cardMetadata ~= nil\n and cardMetadata.weakness\n and cardMetadata.basicWeaknessCount ~= nil\n and cardMetadata.basicWeaknessCount \u003e 0\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, @@ -188075,7 +190132,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal BUTTON_PARAMETERS = {}\nBUTTON_PARAMETERS.function_owner = self\nBUTTON_PARAMETERS.height = 650\nBUTTON_PARAMETERS.width = 700\nBUTTON_PARAMETERS.position = { x = -4.775, y = 0.1, z = -0.03 }\nBUTTON_PARAMETERS.color = { 0, 0, 0, 0 }\nBUTTON_PARAMETERS.font_color = { 0, 0, 0, 100 }\nBUTTON_PARAMETERS.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(saved_data)\n stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }\n\n for i = 1, 4 do\n BUTTON_PARAMETERS.label = stats[i] .. \" \"\n BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91\n BUTTON_PARAMETERS.click_function = attachIndex(\"button_click\", i)\n self.createButton(BUTTON_PARAMETERS)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\n-- helper function to carry index\nfunction attachIndex(click_function, index)\n local fn_name = click_function .. index\n _G[fn_name] = function(obj, player_color, isRightClick)\n _G[click_function](obj, player_color, isRightClick, index)\n end\n return fn_name\nend\n\nfunction button_click(_, _, isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n changeButton(index)\nend\n\nfunction changeButton(index)\n local font_size = BUTTON_PARAMETERS.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n font_size = BUTTON_PARAMETERS.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })\nend\n\n-- formatting of \"newStats\": {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n return\n end\n\n for i = 1, 4 do changeButton(i) end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 650\nbuttonParameters.width = 700\nbuttonParameters.position = { x = -4.775, y = 0.1, z = -0.03 }\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.font_color = { 0, 0, 0, 100 }\nbuttonParameters.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(savedData)\n stats = JSON.decode(savedData) or { 1, 1, 1, 1 }\n\n for index = 1, 4 do\n local fnName = \"buttonClick\" .. index\n _G[fnName] = function(_, _, isRightClick) buttonClick(isRightClick, index) end\n buttonParameters.click_function = fnName\n buttonParameters.position.x = buttonParameters.position.x + 1.91\n self.createButton(buttonParameters)\n updateButtonLabel(index)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\nfunction buttonClick(isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n updateButtonLabel(index)\nend\n\n-- sync the button label to the internal value\nfunction updateButtonLabel(index)\n local fontSize = buttonParameters.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n fontSize = buttonParameters.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = fontSize })\nend\n\n-- update the stats to the provided values\n---@param newStats Table Contains the new values for the stats: {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n\n for i = 1, 4 do updateButtonLabel(i) end\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, "Name": "Custom_Token", @@ -188136,7 +190193,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal BUTTON_PARAMETERS = {}\nBUTTON_PARAMETERS.function_owner = self\nBUTTON_PARAMETERS.height = 650\nBUTTON_PARAMETERS.width = 700\nBUTTON_PARAMETERS.position = { x = -4.775, y = 0.1, z = -0.03 }\nBUTTON_PARAMETERS.color = { 0, 0, 0, 0 }\nBUTTON_PARAMETERS.font_color = { 0, 0, 0, 100 }\nBUTTON_PARAMETERS.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(saved_data)\n stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }\n\n for i = 1, 4 do\n BUTTON_PARAMETERS.label = stats[i] .. \" \"\n BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91\n BUTTON_PARAMETERS.click_function = attachIndex(\"button_click\", i)\n self.createButton(BUTTON_PARAMETERS)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\n-- helper function to carry index\nfunction attachIndex(click_function, index)\n local fn_name = click_function .. index\n _G[fn_name] = function(obj, player_color, isRightClick)\n _G[click_function](obj, player_color, isRightClick, index)\n end\n return fn_name\nend\n\nfunction button_click(_, _, isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n changeButton(index)\nend\n\nfunction changeButton(index)\n local font_size = BUTTON_PARAMETERS.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n font_size = BUTTON_PARAMETERS.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })\nend\n\n-- formatting of \"newStats\": {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n return\n end\n\n for i = 1, 4 do changeButton(i) end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 650\nbuttonParameters.width = 700\nbuttonParameters.position = { x = -4.775, y = 0.1, z = -0.03 }\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.font_color = { 0, 0, 0, 100 }\nbuttonParameters.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(savedData)\n stats = JSON.decode(savedData) or { 1, 1, 1, 1 }\n\n for index = 1, 4 do\n local fnName = \"buttonClick\" .. index\n _G[fnName] = function(_, _, isRightClick) buttonClick(isRightClick, index) end\n buttonParameters.click_function = fnName\n buttonParameters.position.x = buttonParameters.position.x + 1.91\n self.createButton(buttonParameters)\n updateButtonLabel(index)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\nfunction buttonClick(isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n updateButtonLabel(index)\nend\n\n-- sync the button label to the internal value\nfunction updateButtonLabel(index)\n local fontSize = buttonParameters.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n fontSize = buttonParameters.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = fontSize })\nend\n\n-- update the stats to the provided values\n---@param newStats Table Contains the new values for the stats: {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n\n for i = 1, 4 do updateButtonLabel(i) end\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, "Name": "Custom_Token", @@ -188197,7 +190254,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal BUTTON_PARAMETERS = {}\nBUTTON_PARAMETERS.function_owner = self\nBUTTON_PARAMETERS.height = 650\nBUTTON_PARAMETERS.width = 700\nBUTTON_PARAMETERS.position = { x = -4.775, y = 0.1, z = -0.03 }\nBUTTON_PARAMETERS.color = { 0, 0, 0, 0 }\nBUTTON_PARAMETERS.font_color = { 0, 0, 0, 100 }\nBUTTON_PARAMETERS.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(saved_data)\n stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }\n\n for i = 1, 4 do\n BUTTON_PARAMETERS.label = stats[i] .. \" \"\n BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91\n BUTTON_PARAMETERS.click_function = attachIndex(\"button_click\", i)\n self.createButton(BUTTON_PARAMETERS)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\n-- helper function to carry index\nfunction attachIndex(click_function, index)\n local fn_name = click_function .. index\n _G[fn_name] = function(obj, player_color, isRightClick)\n _G[click_function](obj, player_color, isRightClick, index)\n end\n return fn_name\nend\n\nfunction button_click(_, _, isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n changeButton(index)\nend\n\nfunction changeButton(index)\n local font_size = BUTTON_PARAMETERS.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n font_size = BUTTON_PARAMETERS.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })\nend\n\n-- formatting of \"newStats\": {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n return\n end\n\n for i = 1, 4 do changeButton(i) end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 650\nbuttonParameters.width = 700\nbuttonParameters.position = { x = -4.775, y = 0.1, z = -0.03 }\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.font_color = { 0, 0, 0, 100 }\nbuttonParameters.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(savedData)\n stats = JSON.decode(savedData) or { 1, 1, 1, 1 }\n\n for index = 1, 4 do\n local fnName = \"buttonClick\" .. index\n _G[fnName] = function(_, _, isRightClick) buttonClick(isRightClick, index) end\n buttonParameters.click_function = fnName\n buttonParameters.position.x = buttonParameters.position.x + 1.91\n self.createButton(buttonParameters)\n updateButtonLabel(index)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\nfunction buttonClick(isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n updateButtonLabel(index)\nend\n\n-- sync the button label to the internal value\nfunction updateButtonLabel(index)\n local fontSize = buttonParameters.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n fontSize = buttonParameters.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = fontSize })\nend\n\n-- update the stats to the provided values\n---@param newStats Table Contains the new values for the stats: {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n\n for i = 1, 4 do updateButtonLabel(i) end\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n end\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, "Name": "Custom_Token", @@ -188258,7 +190315,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal BUTTON_PARAMETERS = {}\nBUTTON_PARAMETERS.function_owner = self\nBUTTON_PARAMETERS.height = 650\nBUTTON_PARAMETERS.width = 700\nBUTTON_PARAMETERS.position = { x = -4.775, y = 0.1, z = -0.03 }\nBUTTON_PARAMETERS.color = { 0, 0, 0, 0 }\nBUTTON_PARAMETERS.font_color = { 0, 0, 0, 100 }\nBUTTON_PARAMETERS.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(saved_data)\n stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }\n\n for i = 1, 4 do\n BUTTON_PARAMETERS.label = stats[i] .. \" \"\n BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91\n BUTTON_PARAMETERS.click_function = attachIndex(\"button_click\", i)\n self.createButton(BUTTON_PARAMETERS)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\n-- helper function to carry index\nfunction attachIndex(click_function, index)\n local fn_name = click_function .. index\n _G[fn_name] = function(obj, player_color, isRightClick)\n _G[click_function](obj, player_color, isRightClick, index)\n end\n return fn_name\nend\n\nfunction button_click(_, _, isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n changeButton(index)\nend\n\nfunction changeButton(index)\n local font_size = BUTTON_PARAMETERS.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n font_size = BUTTON_PARAMETERS.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })\nend\n\n-- formatting of \"newStats\": {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n return\n end\n\n for i = 1, 4 do changeButton(i) end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playermat/InvestigatorSkillTracker\")\nend)\n__bundle_register(\"playermat/InvestigatorSkillTracker\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 650\nbuttonParameters.width = 700\nbuttonParameters.position = { x = -4.775, y = 0.1, z = -0.03 }\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.font_color = { 0, 0, 0, 100 }\nbuttonParameters.font_size = 450\n\nfunction onSave() return JSON.encode(stats) end\n\n-- load stats and make buttons (left to right)\nfunction onLoad(savedData)\n stats = JSON.decode(savedData) or { 1, 1, 1, 1 }\n\n for index = 1, 4 do\n local fnName = \"buttonClick\" .. index\n _G[fnName] = function(_, _, isRightClick) buttonClick(isRightClick, index) end\n buttonParameters.click_function = fnName\n buttonParameters.position.x = buttonParameters.position.x + 1.91\n self.createButton(buttonParameters)\n updateButtonLabel(index)\n end\n\n self.addContextMenuItem(\"Reset to 1s\", function() updateStats({ 1, 1, 1, 1 }) end)\nend\n\nfunction buttonClick(isRightClick, index)\n stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)\n updateButtonLabel(index)\nend\n\n-- sync the button label to the internal value\nfunction updateButtonLabel(index)\n local fontSize = buttonParameters.font_size\n local whitespace = \" \"\n\n if stats[index] \u003e 9 then\n fontSize = buttonParameters.font_size * 0.65\n whitespace = \" \"\n end\n\n self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = fontSize })\nend\n\n-- update the stats to the provided values\n---@param newStats Table Contains the new values for the stats: {Willpower, Intellect, Fight, Agility}\nfunction updateStats(newStats)\n if newStats and #newStats == 4 then\n stats = newStats\n\n for i = 1, 4 do updateButtonLabel(i) end\n elseif newStats then\n printToAll(\"Provided new stats are incomplete or incorrectly formatted.\", \"Red\")\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, "Name": "Custom_Token", @@ -188388,7 +190445,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/CardSearch\")\nend)\n__bundle_register(\"playercards/CardSearch\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardSpawner\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 200\nbuttonParameters.width = 1200\nbuttonParameters.font_size = 75\n\nlocal BUTTON_LABELS = {}\n\nBUTTON_LABELS[\"spawn\"] = {}\nBUTTON_LABELS[\"spawn\"][true] = \"Mode: Spawn all matching cards \"\nBUTTON_LABELS[\"spawn\"][false] = \"Mode: Spawn first matching card\"\n\nBUTTON_LABELS[\"search\"] = {}\nBUTTON_LABELS[\"search\"][true] = \"Mode: Name matches search term\"\nBUTTON_LABELS[\"search\"][false] = \"Mode: Name contains search term\"\n\nlocal inputParameters = {}\ninputParameters.label = \"Click to enter card name\"\ninputParameters.input_function = \"input_func\"\ninputParameters.function_owner = self\ninputParameters.alignment = 2\ninputParameters.position = { 0, 0.05, -1.6 }\ninputParameters.width = 1200\ninputParameters.height = 130\ninputParameters.font_size = 107\n\n-- main code\nfunction onSave()\n return JSON.encode({ spawnAll, searchExact, inputParameters.value })\nend\n\nfunction onLoad(savedData)\n local loadedData = JSON.decode(savedData)\n spawnAll = loadedData[1] or false\n searchExact = loadedData[2] or false\n inputParameters.value = loadedData[3] or \"\"\n\n -- index 0: button for spawn mode\n buttonParameters.click_function = \"search\"\n buttonParameters.label = \"Spawn matching card(s)!\"\n buttonParameters.position = { 0, 0.06, 1.15 }\n self.createButton(buttonParameters)\n\n -- index 1: button for spawn mode\n buttonParameters.click_function = \"spawnMode\"\n buttonParameters.label = BUTTON_LABELS[\"spawn\"][spawnAll]\n buttonParameters.position[3] = buttonParameters.position[3] + 0.4\n self.createButton(buttonParameters)\n\n -- index 2: button for search mode\n buttonParameters.click_function = \"searchMode\"\n buttonParameters.label = BUTTON_LABELS[\"search\"][searchExact]\n buttonParameters.position[3] = buttonParameters.position[3] + 0.4\n self.createButton(buttonParameters)\n\n self.createInput(inputParameters)\nend\n\nfunction spawnMode()\n spawnAll = not spawnAll\n self.editButton({ index = 1, label = BUTTON_LABELS[\"spawn\"][spawnAll] })\nend\n\nfunction searchMode()\n searchExact = not searchExact\n self.editButton({ index = 2, label = BUTTON_LABELS[\"search\"][searchExact] })\nend\n\n-- if \"Enter press\" (\\n) is found, start search and recreate input\nfunction input_func(_, _, input, stillEditing)\n if not stillEditing then\n inputParameters.value = input\n elseif string.find(input, \"%\\n\") ~= nil then\n inputParameters.value = input.gsub(input, \"%\\n\", \"\")\n search()\n self.removeInput(0)\n self.createInput(inputParameters)\n end\nend\n\nfunction search()\n if inputParameters.value == nil or string.len(inputParameters.value) == 0 then\n printToAll(\"Please enter a search string.\", \"Yellow\")\n return\n end\n\n if string.len(inputParameters.value) \u003c 3 then\n printToAll(\"Please enter a longer search string.\", \"Yellow\")\n return\n end\n \n if not allCardsBagApi.isBagPresent() then\n printToAll(\"Player card bag couldn't be found.\", \"Red\")\n return\n end\n\n -- search all objects in bag\n local cardList = allCardsBagApi.getCardsByName(inputParameters.value, searchExact)\n if cardList == nil or #cardList == 0 then\n printToAll(\"No match found.\", \"Red\")\n return\n end\n if (#cardList \u003e 100) then\n printToAll(\"Matched more than 100 cards, please try a more specific search.\", \"Yellow\")\n return\n end\n\n -- sort table by name (reverse for multiple results, because bottom card spawns first)\n table.sort(cardList, function(k1, k2) return spawnAll == (k1.data.Nickname \u003e k2.data.Nickname) end)\n\n local rot = self.getRotation()\n local pos = self.positionToWorld(Vector(0, 2, -0.225))\n Spawner.spawnCards(cardList, pos, rot, true)\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param card: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/CardSearch\")\nend)\n__bundle_register(\"playercards/CardSearch\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardSpawner\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.height = 200\nbuttonParameters.width = 1200\nbuttonParameters.font_size = 75\n\nlocal BUTTON_LABELS = {}\n\nBUTTON_LABELS[\"spawn\"] = {}\nBUTTON_LABELS[\"spawn\"][true] = \"Mode: Spawn all matching cards \"\nBUTTON_LABELS[\"spawn\"][false] = \"Mode: Spawn first matching card\"\n\nBUTTON_LABELS[\"search\"] = {}\nBUTTON_LABELS[\"search\"][true] = \"Mode: Name matches search term\"\nBUTTON_LABELS[\"search\"][false] = \"Mode: Name contains search term\"\n\nlocal inputParameters = {}\ninputParameters.label = \"Click to enter card name\"\ninputParameters.input_function = \"input_func\"\ninputParameters.function_owner = self\ninputParameters.alignment = 2\ninputParameters.position = { 0, 0.05, -1.6 }\ninputParameters.width = 1200\ninputParameters.height = 130\ninputParameters.font_size = 107\n\n-- main code\nfunction onSave()\n return JSON.encode({ spawnAll, searchExact, inputParameters.value })\nend\n\nfunction onLoad(savedData)\n local loadedData = JSON.decode(savedData)\n spawnAll = loadedData[1] or false\n searchExact = loadedData[2] or false\n inputParameters.value = loadedData[3] or \"\"\n\n -- index 0: button for spawn mode\n buttonParameters.click_function = \"search\"\n buttonParameters.label = \"Spawn matching card(s)!\"\n buttonParameters.position = { 0, 0.06, 1.15 }\n self.createButton(buttonParameters)\n\n -- index 1: button for spawn mode\n buttonParameters.click_function = \"spawnMode\"\n buttonParameters.label = BUTTON_LABELS[\"spawn\"][spawnAll]\n buttonParameters.position[3] = buttonParameters.position[3] + 0.4\n self.createButton(buttonParameters)\n\n -- index 2: button for search mode\n buttonParameters.click_function = \"searchMode\"\n buttonParameters.label = BUTTON_LABELS[\"search\"][searchExact]\n buttonParameters.position[3] = buttonParameters.position[3] + 0.4\n self.createButton(buttonParameters)\n\n self.createInput(inputParameters)\nend\n\nfunction spawnMode()\n spawnAll = not spawnAll\n self.editButton({ index = 1, label = BUTTON_LABELS[\"spawn\"][spawnAll] })\nend\n\nfunction searchMode()\n searchExact = not searchExact\n self.editButton({ index = 2, label = BUTTON_LABELS[\"search\"][searchExact] })\nend\n\n-- if \"Enter press\" (\\n) is found, start search and recreate input\nfunction input_func(_, _, input, stillEditing)\n if not stillEditing then\n inputParameters.value = input\n elseif string.find(input, \"%\\n\") ~= nil then\n inputParameters.value = input.gsub(input, \"%\\n\", \"\")\n search()\n self.removeInput(0)\n self.createInput(inputParameters)\n end\nend\n\nfunction search()\n if inputParameters.value == nil or string.len(inputParameters.value) == 0 then\n printToAll(\"Please enter a search string.\", \"Yellow\")\n return\n end\n\n if string.len(inputParameters.value) \u003c 3 then\n printToAll(\"Please enter a longer search string.\", \"Yellow\")\n return\n end\n \n if not allCardsBagApi.isBagPresent() then\n printToAll(\"Player card bag couldn't be found.\", \"Red\")\n return\n end\n\n -- search all objects in bag\n local cardList = allCardsBagApi.getCardsByName(inputParameters.value, searchExact)\n if cardList == nil or #cardList == 0 then\n printToAll(\"No match found.\", \"Red\")\n return\n end\n if (#cardList \u003e 100) then\n printToAll(\"Matched more than 100 cards, please try a more specific search.\", \"Yellow\")\n return\n end\n\n -- sort table by name (reverse for multiple results, because bottom card spawns first)\n table.sort(cardList, function(k1, k2) return spawnAll == (k1.data.Nickname \u003e k2.data.Nickname) end)\n\n local rot = self.getRotation()\n local pos = self.positionToWorld(Vector(0, 2, -0.225))\n Spawner.spawnCards(cardList, pos, rot, true)\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param cardData: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[true,false,\"\"]", "MeasureMovement": false, "Name": "Custom_Token", @@ -192941,7 +194998,7 @@ }, "Autoraise": true, "ColorDiffuse": { - "a": 0.75, + "a": 0.25, "b": 0.25, "g": 0.25, "r": 0.25 @@ -192971,13 +195028,13 @@ "Tooltip": true, "Transform": { "posX": 78, - "posY": 1.9, + "posY": 2.4, "posZ": 0, "rotX": 0, "rotY": 270, "rotZ": 0, "scaleX": 84, - "scaleY": 1.5, + "scaleY": 2.5, "scaleZ": 3 }, "Value": 0, @@ -193018,7 +195075,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/tour/TourStarter\")\nend)\n__bundle_register(\"core/tour/TourStarter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal tourManager = require(\"core/tour/TourManager\")\n\nfunction onLoad()\n self.createButton({\n click_function = \"startTour\",\n function_owner = self,\n position = { 1.27, 0.05, 0.035},\n width = 500,\n height = 20,\n color = { 0, 0, 0, 0 },\n -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size\n scale = { 1, 1, 0.82 },\n tooltip = \"Start the Tour\",\n })\n self.createButton({\n click_function = \"deleteStarter\",\n function_owner = self,\n position = { 1.27, 0.05, 0.309},\n width = 500,\n height = 20,\n color = { 0, 0, 0, 0 },\n -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size\n scale = { 1, 1, 0.82 },\n tooltip = \"Delete this Panel\",\n })\nend\n\nfunction startTour(_, playerColor, _)\n tourManager.startTour(playerColor)\nend\n\nfunction deleteStarter(_, _, _)\n self.destruct()\nend\nend)\n__bundle_register(\"core/tour/TourManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n require(\"core/tour/TourScript\")\n require(\"core/tour/TourCard\")\n local TourManager = {}\n local internal = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Base IDs for various tour card UI elements. Actual IDs will have _[playerColor] appended\n local CARD_ID = \"tourCard\"\n local LEFT_NARRATOR_ID = \"tourNarratorImageLeft\"\n local RIGHT_NARRATOR_ID = \"tourNarratorImageRight\"\n local BUBBLE_ID = \"tourSpeechBubble\"\n local TEXT_ID = \"tourText\"\n local NEXT_BUTTON_ID = \"tourNext\"\n local STOP_BUTTON_ID = \"tourStop\"\n\n -- Table centerpoint for the camera hook object. Camera handling is a bit erratic so it doesn't\n -- always land right where you think it's going to, but it's close\n local HOOK_CAMERA_HOME = {\n x = -30.2,\n y = 60,\n z = 0,\n }\n\n -- Default (0) position for the camera, as defined in the mod. If we don't recreate this position\n -- EXACTLY when exiting the tour then camera controls get weird\n local DEFAULT_CAMERA_POS = {\n position = { x = -22.265, y = -2.5, z = 5.2575},\n pitch=64.343,\n yaw=90.333,\n distance=104.7}\n\n -- Global XML coordinates where we can present a card\n local SCREEN_POSITIONS = {\n center = \"0 0 0\",\n north = \"0 300 0\",\n east = \"600 0 0\",\n west = \"-600 0 0\",\n south = \"0 -300 0\",\n -- Northwest is only used by the Mandy card, move it a little right than standard so it's\n -- closer to the importer\n northwest = \"-500 300 0\",\n northeast = \"600 300 0\",\n southwest = \"-600 -300 0\",\n -- Used by the Diana and Wini cards referencing the bottom-right global controls, moved a little\n -- closer to them\n southeast = \"730 -365 0\"\n }\n\n -- Tracks the current state of the tours. Keyed by player color to keep each player's tour\n -- separate, will hold the camera hook and current card.\n local tourState = { }\n\n -- Kicks off the tour by initializing the card and camera hook. A callback on the hook creation\n -- will then show the first card.\n ---@param playerColor String Player color to start the tour for\n TourManager.startTour = function(playerColor)\n tourState[playerColor] = {\n currentCardIndex = 1\n }\n -- Camera gets really screwy when we finalize if we don't start settled in ThirdPerson at the\n -- default position before attaching to the hook. Unfortunately there are no callbacks for when\n -- the movement is done, but the delay seems to handle it\n Player[playerColor].setCameraMode(\"ThirdPerson\")\n Player[playerColor].lookAt(DEFAULT_CAMERA_POS)\n -- Initial camera rotation is painfully slow. White and Orange players are likely oriented\n -- correctly, but need a longer start delay for Green and Red\n local delay = 0.5\n if playerColor ~= \"White\" and playerColor ~= \"Orange\" then\n delay = 2\n broadcastToColor(\"Starting the tour, please wait...\", playerColor)\n end\n Wait.time(function()\n internal.createTourCard(playerColor)\n -- XML update to add the new card takes a few frames to load, wait for it to finish then\n -- create the hook\n Wait.condition(\n function()\n internal.createCameraHook(playerColor)\n end,\n function()\n return not Global.UI.loading\n end\n )\n end, delay)\n end\n\n -- Shows the next card in the tour script. This method is exposed (rather than being part of\n -- internal) because the XMLUI callbacks expect the method to be on the object directly.\n ---@param player Player object to show the next card for, provided by XMLUI callback\n function nextCard(player)\n internal.hideCard(player.color)\n Wait.time(function()\n tourState[player.color].currentCardIndex = tourState[player.color].currentCardIndex + 1\n if tourState[player.color].currentCardIndex \u003e #TOUR_SCRIPT then\n internal.finalizeTour(player.color)\n else\n internal.showCurrentCard(player.color)\n end\n end, 0.3)\n end\n\n -- Ends the tour and cleans up the camera. This method is exposed (rather than being part of\n -- internal) because the XMLUI callbacks expect the method to be on the object directly.\n ---@param player Player object to end the tour for, provided by XMLUI callback\n function stopTour(player)\n internal.hideCard(player.color)\n Wait.time(function()\n internal.finalizeTour(player.color)\n end, 0.3)\n end\n\n -- Updates the card UI for the script at the current index, moves the camera to the proper\n -- position, and shows the card.\n ---@param playerColor String Player color to show the current card for\n internal.showCurrentCard = function(playerColor)\n internal.updateCardDisplay(playerColor)\n local delay = 0\n local cardIndex = tourState[playerColor].currentCardIndex\n local hook = getObjectFromGUID(tourState[playerColor].cameraHookGuid)\n\n if not TOUR_SCRIPT[cardIndex].skipCentering then\n hook.setPositionSmooth(HOOK_CAMERA_HOME, false, false)\n delay = delay + 0.5\n end\n local lookPos\n local objReferenceData = TOUR_SCRIPT[cardIndex].objReferenceData\n if objReferenceData ~= nil then\n local lookAtObj = guidReferenceApi.getObjectByOwnerAndType(objReferenceData.owner, objReferenceData.type)\n lookPos = lookAtObj.getPosition()\n lookPos.y = TOUR_SCRIPT[cardIndex].distanceFromObj or 0\n -- Since camera isn't directly above the hook, changing the Y affects the visual position of\n -- whatever object we're trying to look at. This is an approximation, but close enough to\n -- keep the object more centered\n lookPos.x = lookPos.x - lookPos.y / 2\n elseif TOUR_SCRIPT[cardIndex].showPos ~= nil then\n lookPos = TOUR_SCRIPT[cardIndex].showPos\n end\n if lookPos ~= nil then\n Wait.time(function()\n hook.setPositionSmooth(lookPos, false, false)\n end, delay)\n delay = delay + 0.5\n end\n Wait.time(function() Global.UI.show(internal.getUiId(CARD_ID, playerColor)) end, delay)\n end\n\n -- Hides the current card being shown to a player. This can be in preparation for showing the\n -- next card, or ending the tour.\n ---@param playerColor String Player color to hide the current card for\n internal.hideCard = function(playerColor)\n Global.UI.hide(internal.getUiId(CARD_ID, playerColor))\n end\n\n -- Cleans up all the various resources associated with the tour, and (hopefully) resets the\n -- camera to the default position. Camera handling is erratic, the final card in the script\n -- should include instructions for the player to fix it.\n ---@param playerColor String Player color to clean up\n internal.finalizeTour = function(playerColor)\n local cameraHook = getObjectFromGUID(tourState[playerColor].cameraHookGuid)\n cameraHook.destruct()\n Player[playerColor].setCameraMode(\"ThirdPerson\")\n tourState[playerColor] = nil\n Wait.frames(function()\n Player[playerColor].lookAt(DEFAULT_CAMERA_POS)\n end, 3)\n end\n\n -- Updates the card UI to show the appropriate card configuration.\n ---@param playerColor String Player color to update card for\n internal.updateCardDisplay = function(playerColor)\n local index = tourState[playerColor].currentCardIndex\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"image\", \"Inv-\" .. TOUR_SCRIPT[index].narrator)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"image\", \"Inv-\" .. TOUR_SCRIPT[index].narrator)\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"text\", \"\\\"\" .. TOUR_SCRIPT[index].text .. \"\\\"\")\n local cardPos = TOUR_SCRIPT[index].position or \"north\"\n Global.UI.setAttribute(internal.getUiId(CARD_ID, playerColor), \"position\", SCREEN_POSITIONS[cardPos])\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"active\", index \u003c #TOUR_SCRIPT)\n\n -- Adjust images so the narrator is on the left or right, as defined by the card\n if TOUR_SCRIPT[index].speakerSide == \"right\" then\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"active\", false)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"active\", true)\n Global.UI.setAttribute(internal.getUiId(BUBBLE_ID, playerColor), \"rotation\", \"0 180 0\")\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"offsetXY\", \"-15 -15\")\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"offsetXY\", \"-35 -45\")\n Global.UI.setAttribute(internal.getUiId(STOP_BUTTON_ID, playerColor), \"offsetXY\", \"5 -45\")\n else\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"active\", true)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"active\", false)\n Global.UI.setAttribute(internal.getUiId(BUBBLE_ID, playerColor), \"rotation\", \"0 0 0\")\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"offsetXY\", \"15 -15\")\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"offsetXY\", \"-5 -45\")\n Global.UI.setAttribute(internal.getUiId(STOP_BUTTON_ID, playerColor), \"offsetXY\", \"35 -45\")\n end\n end\n\n -- Creates a small, transparent object which the camera will be attached to in order to move the\n -- user's view around the table. This should be called only at the beginning of the tour. Once\n -- creation is complete the user's camera will be attached to the hook and the first card will be\n -- shown.\n ---@param playerColor String Player color to create the hook for\n internal.createCameraHook = function(playerColor)\n local hookData = {\n Name = \"BlockSquare\",\n Transform = {\n posX = HOOK_CAMERA_HOME.x,\n posY = HOOK_CAMERA_HOME.y,\n posZ = HOOK_CAMERA_HOME.z,\n rotX = 0,\n rotY = 270.0,\n rotZ = 0,\n scaleX = 0.1,\n scaleY = 0.1,\n scaleZ = 0.1,\n },\n ColorDiffuse = {\n r = 0,\n g = 0,\n b = 0,\n a = 0,\n },\n Locked = true,\n GMNotes = playerColor\n }\n\n spawnObjectData({ data = hookData, callback_function = internal.onHookCreated })\n end\n\n -- Callback for creation of the camera hook object. Will attach the camera and show the current\n -- (presumably first) card.\n ---@param hook Created object\n internal.onHookCreated = function(hook)\n local playerColor = hook.getGMNotes()\n tourState[playerColor].cameraHookGuid = hook.getGUID()\n Player[playerColor].attachCameraToObject({\n object = hook,\n offset = { x = -20, y = 30, z = 0 }\n })\n internal.showCurrentCard(playerColor)\n end\n\n -- Creates an XMLUI entry in Global for a player-specific tour card. Dynamically creating this\n -- is somewhat complex, but ensures we can properly handle any player color.\n ---@param playerColor String Player color to create the card for\n internal.createTourCard = function(playerColor)\n -- Make sure the card doesn't exist before we create a new one\n if Global.UI.getAttributes(internal.getUiId(CARD_ID, playerColor)) ~= nil then\n return\n end\n tourCardTemplate.attributes.id = internal.getUiId(CARD_ID, playerColor)\n tourCardTemplate.children[1].attributes.id = internal.getUiId(LEFT_NARRATOR_ID, playerColor)\n tourCardTemplate.children[2].attributes.id = internal.getUiId(RIGHT_NARRATOR_ID, playerColor)\n tourCardTemplate.children[3].attributes.id = internal.getUiId(BUBBLE_ID, playerColor)\n tourCardTemplate.children[4].attributes.id = internal.getUiId(TEXT_ID, playerColor)\n tourCardTemplate.children[5].attributes.id = internal.getUiId(NEXT_BUTTON_ID, playerColor)\n tourCardTemplate.children[5].attributes.onClick = self.getGUID()..\"/nextCard\"\n tourCardTemplate.children[6].attributes.id = internal.getUiId(STOP_BUTTON_ID, playerColor)\n tourCardTemplate.children[6].attributes.onClick = self.getGUID()..\"/stopTour\"\n internal.setDeepVisibility(tourCardTemplate, playerColor)\n\n local globalXml = Global.UI.getXmlTable()\n table.insert(globalXml, tourCardTemplate)\n Global.UI.setXmlTable(globalXml)\n end\n\n -- Panels don't cause their children to inherit their visibility value, so this recurses down the\n -- XML table to set all children to the same visibility.\n ---@param xmlUi Table. Lua table describing the XML\n ---@param playerColor String. String color of the player to make this visible for\n internal.setDeepVisibility = function(xmlUi, playerColor)\n xmlUi.attributes.visibility = \"\" .. playerColor\n if xmlUi.children ~= nil then\n for _, child in ipairs(xmlUi.children) do\n internal.setDeepVisibility(child, playerColor)\n end\n end\n end\n\n internal.getUiId = function(baseId, playerColor)\n return baseId .. \"_\" .. playerColor\n end\n\n return TourManager\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/tour/TourCard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table definition for the tour card layout. This is functionally XMLUI in Lua form, but using\n-- this for dynamic creation ensures we can handle any player color without needing 10\n-- near-duplicate definitions in Global.xml\n\ntourCardTemplate = {\n tag = \"Panel\",\n attributes = {\n id = \"tourCard\",\n height = 215,\n width = 330,\n rotation = \"0 0 0\",\n position = \"0 300 30\",\n showAnimation = \"FadeIn\",\n hideAnimation = \"FadeOut\",\n active=false,\n },\n children = {\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNarratorImageLeft\",\n height=120,\n width=80,\n rectAlignment=\"UpperLeft\",\n offsetXY = \"-80 0\",\n -- Image will be set when the card is updated\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNarratorImageRight\",\n active = false,\n height=125,\n width=80,\n rectAlignment=\"UpperRight\",\n offsetXY = \"80 0\"\n -- Image will be set when the card is updated\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourSpeechBubble\",\n color = \"#F5F5DC\",\n height = 215,\n width = 330,\n rectAlignment = \"MiddleCenter\",\n image = \"SpeechBubble\",\n },\n },\n {\n tag = \"Text\",\n attributes = {\n id = \"tourText\",\n -- Everything on this is double-sized and scaled down to keep the text sharps\n height = 370,\n width = 520,\n scale = \"0.5 0.5 1\",\n rectAlignment = \"UpperCenter\",\n offsetXY = \"15 -15\",\n resizeTextForBestFit = true,\n resizeTextMinSize = 20,\n resizeTextMaxSize = 32,\n color = \"#050505\",\n alignment = \"UpperLeft\",\n horizontalOverflow = \"wrap\",\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNext\",\n height = 45,\n width = 45,\n rectAlignment = \"LowerRight\",\n offsetXY = \"-5 -45\",\n image = \"NextArrow\"\n },\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourStop\",\n height = 45,\n width = 45,\n rectAlignment = \"LowerLeft\",\n offsetXY = \"35 -45\",\n image = \"Exit\"\n }\n },\n }\n}\nend)\n__bundle_register(\"core/tour/TourScript\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Script for the SCED tour. Documentation and definitions to come.\n\nTOUR_SCRIPT = {\n {\n narrator = \"Roland\",\n text = \"Despite my best efforts, looks like you found us. You may live to regret that. As long as you're here though we might as well show you around.\\n\\nUse the arrow to move forward, and if the horrors get to be too much you can quit whenever you like. Ready to get started?\",\n position = \"center\"\n },\n {\n narrator = \"Darrell\",\n text = \"Cameras can be tricky things. Best you leave handling it to the professionals during the tour. Don't try to move the camera until the tour is complete.\\n\\nOnce we're done, remember you can use the 'p' key to switch back to third-person mode, and the spacebar to reset the position.\",\n position = \"center\",\n speakerSide = \"right\",\n },\n {\n narrator = \"Daisy\",\n text = \"If you're new to the game, the library here has everything you'll need. A little research can go a long way, and looking into old newspapers for the weird and unusual can yield some surprisingly helpful information.\\n\\nI put a few right there that might prove enlightening.\",\n objReferenceData = { owner = \"Mythos\", type = \"RulesReference\" },\n distanceFromObj = 20,\n position = \"west\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Mandy\",\n text = \"To survive what's coming you'll need a deck. If it's safely hidden away on ArkhamDB you can load it here, and even find the newest version after an upgrade without changing the ID.\\n\\nNo need to publish all your decks, use 'Private' and you can see it. Just make sure to select 'Make your decks public' in ArkhamDB.\",\n objReferenceData = { owner = \"Mythos\", type = \"DeckImporter\" },\n distanceFromObj = -5,\n position = \"northwest\",\n skipCentering = true,\n },\n {\n narrator = \"Daniela\",\n text = \"I prefer the hands-on approach to building things, if you do too you can build a deck yourself.\\n\\nAll the cards you could ever need are here, laid out like a disassembled engine. Place the cards on the table, copy them for your deck, and you'll be ready for anything.\",\n objReferenceData = { owner = \"Mythos\", type = \"PlayerCardPanel\" },\n distanceFromObj = -7,\n position = \"south\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Finn\",\n text = \"Ready to face the unknown? We've smuggled shocking revelations and devious enemies from all over the world. Download the campaign you want to play, then Place it on the table to see the scenarios.\\n\\nJust remember - if it turns out to be too much for you, I was never here.\",\n objReferenceData = { owner = \"Mythos\", type = \"CampaignThePathToCarcosa\" },\n distanceFromObj = 20,\n position = \"northwest\",\n },\n {\n narrator = \"Diana\",\n text = \"These symbols on the bottom right are a repository of arcane knowledge, containing all the official content to download plus some deviously creative works from fans. One should beware those who seem too fond of the darkness, but you cannot deny the quality of their efforts.\\n\\nDon't see anything here? Only promoted players can access these.\",\n position = \"southeast\",\n },\n {\n narrator = \"Winifred\",\n text = \"No good aviator would fly a plane she didn't know and hadn't tweaked a bit herself. The gear icon contains settings to customize your play experience, from alternate ways to track your clues to a variety of helpers to streamline the game.\\n\\nEverything here is optional, but who doesn't want to go as fast as they can? Just remember that all settings affect all players, so strap in and trust your pilot!\",\n position = \"southeast\",\n },\n {\n narrator = \"Amina\",\n text = \"This is the Mythos area. Encounter cards, acts, and agenda will all be placed here while the large map below is where you will be exploring - be sure to set the number of investigators!\\n\\nYou can count doom on the agenda by clicking the large counter, and the smaller will automatically count doom tokens on the table. The chaos bag is in that book over on the right, and you can add or remove tokens from it whenever you need.\",\n showPos = { x = -2.85, y = 0, z = 0.55 },\n position = \"north\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Gloria\",\n text = \"The evils that lurk in this world are out there, creeping ever closer. When they find you, this will easily draw a card from the encounter deck. The deck will even reshuffle itself when needed, for the enemies we face are unending.\",\n showPos = { x = -35, y = -20, z = 28 },\n position = \"west\",\n },\n {\n narrator = \"Jacqueline\",\n text = \"When the ire of fate finds you and the chaos looms, this large button will draw a chaos token. Click it again to return the token to the bag.\\n\\nWhether a vision of the future or a curse from the opponents we face, if you need additional tokens a right-click will draw more. I wish you luck, but have a vision of red tentacles reaching for you...\",\n showPos = { x = -35, y = -20, z = 4.25 },\n position = \"north\",\n skipCentering = true,\n speakerSide = \"right\"\n },\n {\n narrator = \"Preston\",\n text = \"I can afford to buy what I need, but for those less well-off we've provided an endless pool of tokens to track your game. Simply drag one out of the pools here.\\n\\nResources are my favorite of course, but damage and horror are as inevitable as taxes. I leave those to my bookkeeper though. Those tokens can work like counters, use the number keys to change the value.\",\n objReferenceData = { owner = \"Mythos\", type = \"ResourceTokenBag\" },\n position = \"north\",\n skipCentering = true,\n speakerSide = \"right\"\n },\n {\n narrator = \"Norman\",\n text = \"That's the end of the tour, but there's much more to discover if you look in the right places. Some cards have helpers on the right-click menu, and every new version adds new content and functions.\\n\\nDon't be afraid to explore, and best of luck out there! We'll all need it...\",\n position = \"center\",\n speakerSide = \"right\"\n },\n}\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/tour/TourCard\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Table definition for the tour card layout. This is functionally XMLUI in Lua form, but using\n-- this for dynamic creation ensures we can handle any player color without needing 10\n-- near-duplicate definitions in Global.xml\n\ntourCardTemplate = {\n tag = \"Panel\",\n attributes = {\n id = \"tourCard\",\n height = 215,\n width = 330,\n rotation = \"0 0 0\",\n position = \"0 300 30\",\n showAnimation = \"FadeIn\",\n hideAnimation = \"FadeOut\",\n active = false\n },\n children = {\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNarratorImageLeft\",\n height = 120,\n width = 80,\n rectAlignment = \"UpperLeft\",\n offsetXY = \"-80 0\"\n -- Image will be set when the card is updated\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNarratorImageRight\",\n active = false,\n height = 125,\n width = 80,\n rectAlignment = \"UpperRight\",\n offsetXY = \"80 0\"\n -- Image will be set when the card is updated\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourSpeechBubble\",\n color = \"#F5F5DC\",\n height = 215,\n width = 330,\n rectAlignment = \"MiddleCenter\",\n image = \"SpeechBubble\"\n }\n },\n {\n tag = \"Text\",\n attributes = {\n id = \"tourText\",\n -- Everything on this is double-sized and scaled down to keep the text sharps\n height = 370,\n width = 520,\n scale = \"0.5 0.5 1\",\n rectAlignment = \"UpperCenter\",\n offsetXY = \"15 -15\",\n resizeTextForBestFit = true,\n resizeTextMinSize = 20,\n resizeTextMaxSize = 32,\n color = \"#050505\",\n alignment = \"UpperLeft\",\n horizontalOverflow = \"wrap\"\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourNext\",\n height = 45,\n width = 45,\n rectAlignment = \"LowerRight\",\n offsetXY = \"-5 -45\",\n image = \"NextArrow\"\n }\n },\n {\n tag = \"Image\",\n attributes = {\n id = \"tourStop\",\n height = 45,\n width = 45,\n rectAlignment = \"LowerLeft\",\n offsetXY = \"35 -45\",\n image = \"Exit\"\n }\n }\n }\n}\nend)\n__bundle_register(\"core/tour/TourScript\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Script for the SCED tour. Documentation and definitions to come.\n\nTOUR_SCRIPT = {\n {\n narrator = \"Roland\",\n text = \"Despite my best efforts, looks like you found us. You may live to regret that. As long as you're here though we might as well show you around.\\n\\nUse the arrow to move forward, and if the horrors get to be too much you can quit whenever you like. Ready to get started?\",\n position = \"center\"\n },\n {\n narrator = \"Darrell\",\n text = \"Cameras can be tricky things. Best you leave handling it to the professionals during the tour. Don't try to move the camera until the tour is complete.\\n\\nOnce we're done, remember you can use the 'p' key to switch back to third-person mode, and the spacebar to reset the position.\",\n position = \"center\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Daisy\",\n text = \"If you're new to the game, the library here has everything you'll need. A little research can go a long way, and looking into old newspapers for the weird and unusual can yield some surprisingly helpful information.\\n\\nI put a few right there that might prove enlightening.\",\n objReferenceData = { owner = \"Mythos\", type = \"RulesReference\" },\n distanceFromObj = 20,\n position = \"west\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Mandy\",\n text = \"To survive what's coming you'll need a deck. If it's safely hidden away on ArkhamDB you can load it here, and even find the newest version after an upgrade without changing the ID.\\n\\nNo need to publish all your decks, use 'Private' and you can see it. Just make sure to select 'Make your decks public' in ArkhamDB.\",\n objReferenceData = { owner = \"Mythos\", type = \"DeckImporter\" },\n distanceFromObj = -5,\n position = \"northwest\",\n skipCentering = true\n },\n {\n narrator = \"Daniela\",\n text = \"I prefer the hands-on approach to building things, if you do too you can build a deck yourself.\\n\\nAll the cards you could ever need are here, laid out like a disassembled engine. Place the cards on the table, copy them for your deck, and you'll be ready for anything.\",\n objReferenceData = { owner = \"Mythos\", type = \"PlayerCardPanel\" },\n distanceFromObj = -7,\n position = \"south\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Finn\",\n text = \"Ready to face the unknown? We've smuggled shocking revelations and devious enemies from all over the world. Download the campaign you want to play, then Place it on the table to see the scenarios.\\n\\nJust remember - if it turns out to be too much for you, I was never here.\",\n objReferenceData = { owner = \"Mythos\", type = \"CampaignThePathToCarcosa\" },\n distanceFromObj = 20,\n position = \"northwest\",\n skipCentering = true\n },\n {\n narrator = \"Diana\",\n text = \"These symbols on the bottom right are a repository of arcane knowledge, containing all the official content to download plus some deviously creative works from fans. One should beware those who seem too fond of the darkness, but you cannot deny the quality of their efforts.\\n\\nDon't see anything here? Only promoted players can access these.\",\n position = \"southeast\"\n },\n {\n narrator = \"Winifred\",\n text = \"No good aviator would fly a plane she didn't know and hadn't tweaked a bit herself. The gear icon contains settings to customize your play experience, from alternate ways to track your clues to a variety of helpers to streamline the game.\\n\\nEverything here is optional, but who doesn't want to go as fast as they can? Just remember that all settings affect all players, so strap in and trust your pilot!\",\n position = \"southeast\"\n },\n {\n narrator = \"Amina\",\n text = \"This is the Mythos area. Encounter cards, acts, and agenda will all be placed here while the large map below is where you will be exploring - be sure to set the number of investigators!\\n\\nYou can count doom on the agenda by clicking the large counter, and the smaller will automatically count doom tokens on the table. The chaos bag is in that book over on the right, and you can add or remove tokens from it whenever you need.\",\n showPos = { x = -2.85, y = 0, z = 0.55 },\n position = \"north\",\n speakerSide = \"right\"\n },\n {\n narrator = \"Gloria\",\n text = \"The evils that lurk in this world are out there, creeping ever closer. When they find you, this will easily draw a card from the encounter deck. The deck will even reshuffle itself when needed, for the enemies we face are unending.\",\n showPos = { x = -35, y = -20, z = 28 },\n position = \"west\",\n skipCentering = true\n },\n {\n narrator = \"Jacqueline\",\n text = \"When the ire of fate finds you and the chaos looms, this large button will draw a chaos token. Click it again to return the token to the bag.\\n\\nWhether a vision of the future or a curse from the opponents we face, if you need additional tokens a right-click will draw more. I wish you luck, but have a vision of red tentacles reaching for you...\",\n showPos = { x = -35, y = -20, z = 4.25 },\n position = \"north\",\n skipCentering = true,\n speakerSide = \"right\"\n },\n {\n narrator = \"Kohaku\",\n text = \"Folklorists, immersed in the rich narratives of blessings and curses, explore the essence of human beliefs. You can use this tool to control the amount of bless and curse tokens in the chaos bag. It will also display the amount in the bag (+ sealed on cards) for you. Remember to remove bless / curse tokens with this after resolving them.\",\n objReferenceData = { owner = \"Mythos\", type = \"BlessCurseManager\" },\n position = \"center\",\n skipCentering = true,\n speakerSide = \"left\"\n },\n {\n narrator = \"Preston\",\n text = \"I can afford to buy what I need, but for those less well-off we've provided an endless pool of tokens to track your game. Simply drag one out of the pools here.\\n\\nResources are my favorite of course, but damage and horror are as inevitable as taxes. I leave those to my bookkeeper though. Those tokens can work like counters, use the number keys to change the value.\",\n objReferenceData = { owner = \"Mythos\", type = \"ResourceTokenBag\" },\n position = \"north\",\n skipCentering = true,\n speakerSide = \"right\"\n },\n {\n narrator = \"Norman\",\n text = \"That's the end of the tour, but there's much more to discover if you look in the right places. Some cards have helpers on the right-click menu, and every new version adds new content and functions.\\n\\nDon't be afraid to explore, and best of luck out there! We'll all need it...\",\n position = \"center\",\n speakerSide = \"right\"\n }\n}\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/tour/TourStarter\")\nend)\n__bundle_register(\"core/tour/TourStarter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal tourManager = require(\"core/tour/TourManager\")\n\nfunction onLoad()\n self.createButton({\n click_function = \"startTour\",\n function_owner = self,\n position = { 1.27, 0.05, 0.035},\n width = 500,\n height = 20,\n color = { 0, 0, 0, 0 },\n -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size\n scale = { 1, 1, 0.82 },\n tooltip = \"Start the Tour\",\n })\n self.createButton({\n click_function = \"deleteStarter\",\n function_owner = self,\n position = { 1.27, 0.05, 0.309},\n width = 500,\n height = 20,\n color = { 0, 0, 0, 0 },\n -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size\n scale = { 1, 1, 0.82 },\n tooltip = \"Delete this Panel\",\n })\nend\n\nfunction startTour(_, playerColor, _)\n tourManager.startTour(playerColor)\nend\n\nfunction deleteStarter(_, _, _)\n self.destruct()\nend\nend)\n__bundle_register(\"core/tour/TourManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n require(\"core/tour/TourScript\")\n require(\"core/tour/TourCard\")\n local TourManager = {}\n local internal = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Base IDs for various tour card UI elements. Actual IDs will have _[playerColor] appended\n local CARD_ID = \"tourCard\"\n local LEFT_NARRATOR_ID = \"tourNarratorImageLeft\"\n local RIGHT_NARRATOR_ID = \"tourNarratorImageRight\"\n local BUBBLE_ID = \"tourSpeechBubble\"\n local TEXT_ID = \"tourText\"\n local NEXT_BUTTON_ID = \"tourNext\"\n local STOP_BUTTON_ID = \"tourStop\"\n\n -- Table centerpoint for the camera hook object. Camera handling is a bit erratic so it doesn't\n -- always land right where you think it's going to, but it's close\n local HOOK_CAMERA_HOME = {\n x = -30.2,\n y = 60,\n z = 0,\n }\n\n -- Default (0) position for the camera, as defined in the mod. If we don't recreate this position\n -- EXACTLY when exiting the tour then camera controls get weird\n local DEFAULT_CAMERA_POS = {\n position = { x = -22.26, y = -2.5, z = 5.26 },\n pitch = 64.34,\n yaw = 90,\n distance = 104\n }\n\n -- Global XML coordinates where we can present a card\n local SCREEN_POSITIONS = {\n center = \"0 0 0\",\n north = \"0 300 0\",\n east = \"600 0 0\",\n west = \"-600 0 0\",\n south = \"0 -300 0\",\n\n -- Northwest is only used by the Mandy card, move it a little right than standard so it's\n -- closer to the importer\n northwest = \"-500 300 0\",\n northeast = \"600 300 0\",\n southwest = \"-600 -300 0\",\n\n -- Used by the Diana and Wini cards referencing the bottom-right global controls, moved a little\n -- closer to them\n southeast = \"730 -365 0\"\n }\n\n -- Tracks the current state of the tours. Keyed by player color to keep each player's tour\n -- separate, will hold the camera hook and current card.\n local tourState = {}\n\n -- Kicks off the tour by initializing the card and camera hook. A callback on the hook creation\n -- will then show the first card.\n ---@param playerColor String Player color to start the tour for\n TourManager.startTour = function(playerColor)\n tourState[playerColor] = {\n currentCardIndex = 1\n }\n -- Camera gets really screwy when we finalize if we don't start settled in ThirdPerson at the\n -- default position before attaching to the hook. Unfortunately there are no callbacks for when\n -- the movement is done, but the delay seems to handle it\n Player[playerColor].setCameraMode(\"ThirdPerson\")\n Player[playerColor].lookAt(DEFAULT_CAMERA_POS)\n\n -- Initial camera rotation is painfully slow. White and Orange players are likely oriented\n -- correctly, but need a longer start delay for Green and Red\n local delay = 0.5\n if playerColor ~= \"White\" and playerColor ~= \"Orange\" then\n delay = 2\n broadcastToColor(\"Starting the tour, please wait...\", playerColor)\n end\n Wait.time(function()\n internal.createTourCard(playerColor)\n -- XML update to add the new card takes a few frames to load, wait for it to finish then create the hook\n Wait.condition(function() internal.createCameraHook(playerColor) end, function() return not Global.UI.loading end)\n end, delay)\n end\n\n -- Shows the next card in the tour script. This method is exposed (rather than being part of\n -- internal) because the XMLUI callbacks expect the method to be on the object directly.\n ---@param player Player object to show the next card for, provided by XMLUI callback\n function nextCard(player)\n internal.hideCard(player.color)\n Wait.time(function()\n tourState[player.color].currentCardIndex = tourState[player.color].currentCardIndex + 1\n if tourState[player.color].currentCardIndex \u003e #TOUR_SCRIPT then\n internal.finalizeTour(player.color)\n else\n internal.showCurrentCard(player.color)\n end\n end, 0.3)\n end\n\n -- Ends the tour and cleans up the camera. This method is exposed (rather than being part of\n -- internal) because the XMLUI callbacks expect the method to be on the object directly.\n ---@param player Player object to end the tour for, provided by XMLUI callback\n function stopTour(player)\n internal.hideCard(player.color)\n Wait.time(function()\n internal.finalizeTour(player.color)\n end, 0.3)\n end\n\n -- Updates the card UI for the script at the current index, moves the camera to the proper\n -- position, and shows the card.\n ---@param playerColor String Player color to show the current card for\n internal.showCurrentCard = function(playerColor)\n internal.updateCardDisplay(playerColor)\n local delay = 0\n local cardIndex = tourState[playerColor].currentCardIndex\n local hook = getObjectFromGUID(tourState[playerColor].cameraHookGuid)\n\n if not TOUR_SCRIPT[cardIndex].skipCentering then\n hook.setPositionSmooth(HOOK_CAMERA_HOME, false, false)\n delay = delay + 0.5\n end\n local lookPos\n local objReferenceData = TOUR_SCRIPT[cardIndex].objReferenceData\n if objReferenceData ~= nil then\n local lookAtObj = guidReferenceApi.getObjectByOwnerAndType(objReferenceData.owner, objReferenceData.type)\n lookPos = lookAtObj.getPosition()\n lookPos.y = TOUR_SCRIPT[cardIndex].distanceFromObj or 0\n -- Since camera isn't directly above the hook, changing the Y affects the visual position of\n -- whatever object we're trying to look at. This is an approximation, but close enough to\n -- keep the object more centered\n lookPos.x = lookPos.x - lookPos.y / 2\n elseif TOUR_SCRIPT[cardIndex].showPos ~= nil then\n lookPos = TOUR_SCRIPT[cardIndex].showPos\n end\n if lookPos ~= nil then\n Wait.time(function()\n hook.setPositionSmooth(lookPos, false, false)\n end, delay)\n delay = delay + 0.5\n end\n Wait.time(function() Global.UI.show(internal.getUiId(CARD_ID, playerColor)) end, delay)\n end\n\n -- Hides the current card being shown to a player. This can be in preparation for showing the\n -- next card, or ending the tour.\n ---@param playerColor String Player color to hide the current card for\n internal.hideCard = function(playerColor)\n Global.UI.hide(internal.getUiId(CARD_ID, playerColor))\n end\n\n -- Cleans up all the various resources associated with the tour, and (hopefully) resets the\n -- camera to the default position. Camera handling is erratic, the final card in the script\n -- should include instructions for the player to fix it.\n ---@param playerColor String Player color to clean up\n internal.finalizeTour = function(playerColor)\n local cameraHook = getObjectFromGUID(tourState[playerColor].cameraHookGuid)\n cameraHook.destruct()\n Player[playerColor].setCameraMode(\"ThirdPerson\")\n tourState[playerColor] = nil\n Wait.frames(function()\n Player[playerColor].lookAt(DEFAULT_CAMERA_POS)\n end, 3)\n end\n\n -- Updates the card UI to show the appropriate card configuration.\n ---@param playerColor String Player color to update card for\n internal.updateCardDisplay = function(playerColor)\n local index = tourState[playerColor].currentCardIndex\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"image\", \"Inv-\" .. TOUR_SCRIPT[index].narrator)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"image\", \"Inv-\" .. TOUR_SCRIPT[index].narrator)\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"text\", \"\\\"\" .. TOUR_SCRIPT[index].text .. \"\\\"\")\n local cardPos = TOUR_SCRIPT[index].position or \"north\"\n Global.UI.setAttribute(internal.getUiId(CARD_ID, playerColor), \"position\", SCREEN_POSITIONS[cardPos])\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"active\", index \u003c #TOUR_SCRIPT)\n\n -- Adjust images so the narrator is on the left or right, as defined by the card\n if TOUR_SCRIPT[index].speakerSide == \"right\" then\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"active\", false)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"active\", true)\n Global.UI.setAttribute(internal.getUiId(BUBBLE_ID, playerColor), \"rotation\", \"0 180 0\")\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"offsetXY\", \"-15 -15\")\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"offsetXY\", \"-35 -45\")\n Global.UI.setAttribute(internal.getUiId(STOP_BUTTON_ID, playerColor), \"offsetXY\", \"5 -45\")\n else\n Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), \"active\", true)\n Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), \"active\", false)\n Global.UI.setAttribute(internal.getUiId(BUBBLE_ID, playerColor), \"rotation\", \"0 0 0\")\n Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), \"offsetXY\", \"15 -15\")\n Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), \"offsetXY\", \"-5 -45\")\n Global.UI.setAttribute(internal.getUiId(STOP_BUTTON_ID, playerColor), \"offsetXY\", \"35 -45\")\n end\n end\n\n -- Creates a small, transparent object which the camera will be attached to in order to move the\n -- user's view around the table. This should be called only at the beginning of the tour. Once\n -- creation is complete the user's camera will be attached to the hook and the first card will be\n -- shown.\n ---@param playerColor String Player color to create the hook for\n internal.createCameraHook = function(playerColor)\n local hookData = {\n Name = \"BlockSquare\",\n Transform = {\n posX = HOOK_CAMERA_HOME.x,\n posY = HOOK_CAMERA_HOME.y,\n posZ = HOOK_CAMERA_HOME.z,\n rotX = 0,\n rotY = 270,\n rotZ = 0,\n scaleX = 0.1,\n scaleY = 0.1,\n scaleZ = 0.1,\n },\n ColorDiffuse = {\n r = 0,\n g = 0,\n b = 0,\n a = 0,\n },\n Locked = true,\n GMNotes = playerColor\n }\n\n spawnObjectData({ data = hookData, callback_function = internal.onHookCreated })\n end\n\n -- Callback for creation of the camera hook object. Will attach the camera and show the current\n -- (presumably first) card.\n ---@param hook Created object\n internal.onHookCreated = function(hook)\n local playerColor = hook.getGMNotes()\n tourState[playerColor].cameraHookGuid = hook.getGUID()\n Player[playerColor].attachCameraToObject({\n object = hook,\n offset = { x = -20, y = 30, z = 0 }\n })\n internal.showCurrentCard(playerColor)\n end\n\n -- Creates an XMLUI entry in Global for a player-specific tour card. Dynamically creating this\n -- is somewhat complex, but ensures we can properly handle any player color.\n ---@param playerColor String Player color to create the card for\n internal.createTourCard = function(playerColor)\n -- Make sure the card doesn't exist before we create a new one\n if Global.UI.getAttributes(internal.getUiId(CARD_ID, playerColor)) ~= nil then return end\n \n tourCardTemplate.attributes.id = internal.getUiId(CARD_ID, playerColor)\n tourCardTemplate.children[1].attributes.id = internal.getUiId(LEFT_NARRATOR_ID, playerColor)\n tourCardTemplate.children[2].attributes.id = internal.getUiId(RIGHT_NARRATOR_ID, playerColor)\n tourCardTemplate.children[3].attributes.id = internal.getUiId(BUBBLE_ID, playerColor)\n tourCardTemplate.children[4].attributes.id = internal.getUiId(TEXT_ID, playerColor)\n tourCardTemplate.children[5].attributes.id = internal.getUiId(NEXT_BUTTON_ID, playerColor)\n tourCardTemplate.children[5].attributes.onClick = self.getGUID() .. \"/nextCard\"\n tourCardTemplate.children[6].attributes.id = internal.getUiId(STOP_BUTTON_ID, playerColor)\n tourCardTemplate.children[6].attributes.onClick = self.getGUID() .. \"/stopTour\"\n internal.setDeepVisibility(tourCardTemplate, playerColor)\n\n local globalXml = Global.UI.getXmlTable()\n table.insert(globalXml, tourCardTemplate)\n Global.UI.setXmlTable(globalXml)\n end\n\n -- Panels don't cause their children to inherit their visibility value, so this recurses down the\n -- XML table to set all children to the same visibility.\n ---@param xmlUi Table. Lua table describing the XML\n ---@param playerColor String. String color of the player to make this visible for\n internal.setDeepVisibility = function(xmlUi, playerColor)\n xmlUi.attributes.visibility = \"\" .. playerColor\n if xmlUi.children ~= nil then\n for _, child in ipairs(xmlUi.children) do\n internal.setDeepVisibility(child, playerColor)\n end\n end\n end\n\n internal.getUiId = function(baseId, playerColor)\n return baseId .. \"_\" .. playerColor\n end\n\n return TourManager\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", @@ -193040,6 +195097,72 @@ "Value": 0, "XmlUI": "" }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "AttachedSnapPoints": [ + { + "Position": { + "x": 0, + "y": 0.1, + "z": 0.05 + } + } + ], + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomToken": { + "MergeDistancePixels": 15, + "Stackable": false, + "StandUp": false, + "Thickness": 0.1 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2280574378890547614/63FE6CDF23322B6C4001514E2B8891BA998FAD71/", + "WidthScale": 0 + }, + "Description": "This tool can generate an description for you deck on ArkhamDB that will instruct the deck importer to add the specified cards.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "240522", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"arkhamdb/InstructionGenerator\")\nend)\n__bundle_register(\"arkhamdb/InstructionGenerator\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\n\nfunction onLoad()\n local buttonParameters = {}\n buttonParameters.function_owner = self\n buttonParameters.height = 200\n buttonParameters.width = 1200\n buttonParameters.font_size = 75\n buttonParameters.click_function = \"generate\"\n buttonParameters.label = \"Generate instructions!\"\n buttonParameters.position = { 0, 0.06, 1.55 }\n self.createButton(buttonParameters)\n\n local inputParameters = {}\n inputParameters.label = \"Click button above\"\n inputParameters.input_function = \"none\"\n inputParameters.function_owner = self\n inputParameters.position = { 0, 0.05, 1.95 }\n inputParameters.width = 1200\n inputParameters.height = 130\n inputParameters.font_size = 107\n self.createInput(inputParameters)\nend\n\nfunction generate(_, playerColor)\n local idList = {}\n for _, obj in ipairs(searchLib.onObject(self, \"isCardOrDeck\")) do\n if obj.type == \"Card\" then\n local cardMetadata = JSON.decode(obj.getGMNotes())\n \n if cardMetadata then\n local id = getIdFromData(cardMetadata)\n if id then\n table.insert(idList, id)\n end\n end\n elseif obj.type == \"Deck\" then\n for _, deepObj in ipairs(obj.getData().ContainedObjects) do\n local cardMetadata = JSON.decode(deepObj.GMNotes)\n if cardMetadata then\n local id = getIdFromData(cardMetadata)\n if id then\n table.insert(idList, id)\n end\n end\n end\n end\n end\n\n if #idList == 0 then\n broadcastToColor(\"Didn't find any valid cards.\", playerColor, \"Red\")\n return\n else\n broadcastToColor(\"Created deck instruction for \" .. #idList .. \" card(s). Copy it from the input field.\", playerColor, \"Green\")\n end\n\n -- construct the string\n local description = \"++SCED import instructions++\\n- add: \"\n for _, id in ipairs(idList) do\n description = description .. id .. \", \"\n end\n \n -- remove last delimiter (last two characters)\n description = description:sub(1, -3)\n self.editInput({index = 0, value = description})\nend\n\n-- use the ZoopGuid as fallback if no id present\nfunction getIdFromData(metadata)\n if metadata.id then\n return metadata.id\n elseif metadata.TtsZoopGuid then\n return metadata.TtsZoopGuid\n end\nend\n\nfunction none() end\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Token", + "Nickname": "Instruction Generator", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": -17.5, + "posY": 1.531, + "posZ": 83, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.25, + "scaleY": 1, + "scaleZ": 1.35 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -193075,7 +195198,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"arkhamdb/ArkhamDb\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n \n local ArkhamDb = { }\n local internal = { }\n\n local RANDOM_WEAKNESS_ID = \"01000\"\n\n local tabooList = { }\n --Forward declaration\n ---@type Request\n local Request = {}\n local configuration\n\n -- Sets up the ArkhamDb interface. Should be called from the parent object on load.\n ArkhamDb.initialize = function()\n configuration = internal.getConfiguration()\n Request.start({ configuration.api_uri, configuration.taboo }, function(status)\n local json = JSON.decode(internal.fixUtf16String(status.text))\n for _, taboo in pairs(json) do\n ---@type \u003cstring, boolean\u003e\n local cards = {}\n\n for _, card in pairs(JSON.decode(taboo.cards)) do\n cards[card.code] = true\n end\n\n tabooList[taboo.id] = {\n date = taboo.date_start,\n cards = cards\n }\n end\n return true, nil\n end)\n end\n\n -- Start the deck build process for the given player color and deck ID. This\n -- will retrieve the deck from ArkhamDB, and pass to a callback for processing.\n ---@param playerColor String. Color name of the player mat to place this deck on (e.g. \"Red\").\n ---@param deckId String. ArkhamDB deck id to be loaded\n ---@param isPrivate Boolean. Whether this deck is published or private on ArkhamDB\n ---@param loadNewest Boolean. Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean. Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function. Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n ArkhamDb.getDecklist = function(\n playerColor,\n deckId,\n isPrivate,\n loadNewest,\n loadInvestigators,\n callback)\n -- Get a simple card to see if the bag indexes are complete. If not, abort\n -- the deck load. The called method will handle player notification.\n local checkCard = allCardsBagApi.getCardById(\"01001\")\n if (checkCard ~= nil and checkCard.data == nil) then\n return\n end\n\n local deckUri = { configuration.api_uri,\n isPrivate and configuration.private_deck or configuration.public_deck, deckId }\n\n local deck = Request.start(deckUri, function(status)\n if string.find(status.text, \"\u003c!DOCTYPE html\u003e\") then\n internal.maybePrint(\"Private deck ID \" .. deckId .. \" is not shared\", playerColor)\n return false, table.concat({ \"Private deck \", deckId, \" is not shared\" })\n end\n local json = JSON.decode(status.text)\n\n if not json then\n internal.maybePrint(\"Deck ID \" .. deckId .. \" not found\", playerColor)\n return false, \"Deck not found!\"\n end\n\n return true, json\n end)\n\n deck:with(internal.onDeckResult, playerColor, loadNewest, loadInvestigators, callback)\n end\n\n -- Logs that a card could not be loaded in the mod by printing it to the console in the given\n -- color of the player owning the deck. Attempts to look up the name on ArkhamDB for clarity,\n -- but prints the card ID if the name cannot be retrieved.\n ---@param cardId String. ArkhamDB ID of the card that could not be found\n ---@param playerColor String. Color of the player's deck that had the problem\n ArkhamDb.logCardNotFound = function(cardId, playerColor)\n local request = Request.start({\n configuration.api_uri,\n configuration.cards,\n cardId\n },\n function(result)\n local adbCardInfo = JSON.decode(internal.fixUtf16String(result.text))\n local cardName = adbCardInfo.real_name\n if (cardName ~= nil) then\n if (adbCardInfo.xp ~= nil and adbCardInfo.xp \u003e 0) then\n cardName = cardName .. \" (\" .. adbCardInfo.xp .. \")\"\n end\n internal.maybePrint(\"Card not found: \" .. cardName .. \", ArkhamDB ID \" .. cardId, playerColor)\n else\n internal.maybePrint(\"Card not found in ArkhamDB, ID \" .. cardId, playerColor)\n end\n end)\n end\n\n -- Callback when the deck information is received from ArkhamDB. Parses the\n -- response then applies standard transformations to the deck such as adding\n -- random weaknesses and checking for taboos. Once the deck is processed,\n -- passes to loadCards to actually spawn the defined deck.\n ---@param deck ArkhamImportDeck\n ---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n ---@param loadNewest Boolean Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- bondedList A table of cardID keys to meaningless values. Card IDs in this list were\n --- added from a parent bonded card.\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n internal.onDeckResult = function(deck, playerColor, loadNewest, loadInvestigators, callback)\n -- Load the next deck in the upgrade path if the option is enabled\n if (loadNewest and deck.next_deck ~= nil and deck.next_deck ~= \"\") then\n buildDeck(playerColor, deck.next_deck)\n return\n end\n\n internal.maybePrint(table.concat({ \"Found decklist: \", deck.name }), playerColor)\n\n -- Initialize deck slot table and perform common transformations. The order of these should not\n -- be changed, as later steps may act on cards added in each. For example, a random weakness or\n -- investigator may have bonded cards or taboo entries, and should be present\n local slots = deck.slots\n internal.maybeDrawRandomWeakness(slots, playerColor)\n local loadAltInvestigator = \"normal\"\n if loadInvestigators then\n loadAltInvestigator = internal.addInvestigatorCards(deck, slots)\n end\n \n internal.maybeAddSummonedServitor(slots)\n internal.maybeAddOnTheMend(slots, playerColor)\n internal.maybeAddRealityAcidReference(slots)\n local bondList = internal.extractBondedCards(slots)\n internal.checkTaboos(deck.taboo_id, slots, playerColor)\n internal.maybeAddUpgradeSheets(slots)\n\n -- get upgrades for customizable cards\n local customizations = {}\n if deck.meta then\n customizations = JSON.decode(deck.meta)\n end\n\n callback(slots, deck.investigator_code, bondList, customizations, playerColor, loadAltInvestigator)\n end\n\n -- Checks to see if the slot list includes the random weakness ID. If it does,\n -- removes it from the deck and replaces it with the ID of a random basic weakness provided by the\n -- all cards bag\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n --- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast\n --- if a weakness is added.\n internal.maybeDrawRandomWeakness = function(slots, playerColor)\n local randomWeaknessAmount = slots[RANDOM_WEAKNESS_ID] or 0\n slots[RANDOM_WEAKNESS_ID] = nil\n\n if randomWeaknessAmount ~= 0 then\n for i=1, randomWeaknessAmount do\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n slots[weaknessId] = (slots[weaknessId] or 0) + 1\n end\n internal.maybePrint(\"Added \" .. randomWeaknessAmount .. \" random basic weakness(es) to deck\", playerColor)\n end\n end\n\n -- Adds both the investigator (XXXXX) and minicard (XXXXX-m) slots with one copy each\n ---@param deck Table The processed ArkhamDB deck response\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the\n --- number of those cards which will be spawned\n ---@return string: Contains the name of the art that should be loaded (\"normal\", \"promo\" or \"revised\")\n internal.addInvestigatorCards = function(deck, slots)\n local investigatorId = deck.investigator_code\n slots[investigatorId .. \"-m\"] = 1\n local deckMeta = JSON.decode(deck.meta)\n -- handling alternative investigator art and parallel investigators\n local loadAltInvestigator = \"normal\"\n if deckMeta ~= nil then\n local altFrontId = tonumber(deckMeta.alternate_front) or 0\n local altBackId = tonumber(deckMeta.alternate_back) or 0\n local altArt = { front = \"normal\", back = \"normal\" }\n\n -- translating front ID\n if altFrontId \u003e 90000 and altFrontId \u003c 90100 then\n altArt.front = \"parallel\"\n elseif altFrontId \u003e 01500 and altFrontId \u003c 01506 then\n altArt.front = \"revised\"\n elseif altFrontId \u003e 98000 then\n altArt.front = \"promo\"\n end\n\n -- translating back ID\n if altBackId \u003e 90000 and altBackId \u003c 90100 then\n altArt.back = \"parallel\"\n elseif altBackId \u003e 01500 and altBackId \u003c 01506 then\n altArt.back = \"revised\"\n elseif altBackId \u003e 98000 then\n altArt.back = \"promo\"\n end\n\n -- updating investigatorID based on alt investigator selection\n -- precedence: parallel \u003e promo \u003e revised\n if altArt.front == \"parallel\" then\n if altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-p\"\n else\n investigatorId = investigatorId .. \"-pf\"\n end\n elseif altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-pb\"\n elseif altArt.front == \"promo\" or altArt.back == \"promo\" then\n loadAltInvestigator = \"promo\"\n elseif altArt.front == \"revised\" or altArt.back == \"revised\" then\n loadAltInvestigator = \"revised\"\n end\n end\n slots[investigatorId] = 1\n deck.investigator_code = investigatorId\n return loadAltInvestigator\n end\n\n -- Process the card list looking for the customizable cards, and add their upgrade sheets if needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddUpgradeSheets = function(slots)\n for cardId, _ in pairs(slots) do\n -- upgrade sheets for customizable cards\n local upgradesheet = allCardsBagApi.getCardById(cardId .. \"-c\")\n if upgradesheet ~= nil then\n slots[cardId .. \"-c\"] = 1\n end\n end\n end\n\n -- Process the card list looking for the Summoned Servitor, and add its minicard to the list if\n -- needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddSummonedServitor = function(slots)\n if slots[\"09080\"] ~= nil then\n slots[\"09080-m\"] = 1\n end\n end\n\n -- On the Mend should have 1-per-investigator copies set aside, but ArkhamDB always sends 1. Update\n -- the count based on the investigator count\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast if an error occurs\n internal.maybeAddOnTheMend = function(slots, playerColor)\n if slots[\"09006\"] ~= nil then\n local investigatorCount = playAreaApi.getInvestigatorCount()\n if investigatorCount ~= nil then\n slots[\"09006\"] = investigatorCount\n else\n internal.maybePrint(\"Something went wrong with the load, adding 4 copies of On the Mend\", playerColor)\n slots[\"09006\"] = 4\n end\n end\n end\n\n -- Process the card list looking for Reality Acid and adds the reference sheet when needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddRealityAcidReference = function(slots)\n if slots[\"89004\"] ~= nil then\n slots[\"89005\"] = 1\n end\n end\n\n -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list.\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.extractBondedCards = function(slots)\n -- Create a list of bonded cards first so we don't modify slots while iterating\n local bondedCards = { }\n local bondedList = { }\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil and card.metadata.bonded ~= nil) then\n for _, bond in ipairs(card.metadata.bonded) do\n -- add a bonded card for each copy of the parent card (except for Pendant of the Queen)\n if bond.id == \"06022\" then\n bondedCards[bond.id] = bond.count\n else\n bondedCards[bond.id] = bond.count * cardCount\n end\n -- We need to know which cards are bonded to determine their position, remember them\n bondedList[bond.id] = true\n -- Also adding taboo versions of bonded cards to the list\n bondedList[bond.id .. \"-t\"] = true\n end\n end\n end\n -- Add any bonded cards to the main slots list\n for bondedId, bondedCount in pairs(bondedCards) do\n slots[bondedId] = bondedCount\n end\n\n return bondedList\n end\n\n -- Check the deck for cards on its taboo list. If they're found, replace the entry in the slot with the Taboo id (i.e. \"XXXX\" becomes \"XXXX-t\")\n ---@param tabooId String The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.checkTaboos = function(tabooId, slots, playerColor)\n if tabooId then\n for cardId, _ in pairs(tabooList[tabooId].cards) do\n if slots[cardId] ~= nil then\n -- Make sure there's a taboo version of the card before we replace it\n -- SCED only maintains the most recent taboo cards. If a deck is using\n -- an older taboo list it's possible the card isn't a taboo any more\n local tabooCard = allCardsBagApi.getCardById(cardId .. \"-t\")\n if tabooCard == nil then\n local basicCard = allCardsBagApi.getCardById(cardId)\n internal.maybePrint(\"Taboo version for \" .. basicCard.data.Nickname .. \" is not available. Using standard version\", playerColor)\n else\n slots[cardId .. \"-t\"] = slots[cardId]\n slots[cardId] = nil\n end\n end\n end\n end\n end\n\n internal.maybePrint = function(message, playerColor)\n if playerColor ~= \"None\" then\n printToAll(message, playerColor)\n end\n end\n\n -- Gets the ArkhamDB config info from the configuration object.\n ---@return Table. Configuration data\n internal.getConfiguration = function()\n local configuration = getObjectsWithTag(\"import_configuration_provider\")[1]:getTable(\"configuration\")\n printPriority = configuration.priority\n return configuration\n end\n\n internal.fixUtf16String = function(str)\n return str:gsub(\"\\\\u(%w%w%w%w)\", function(match)\n return string.char(tonumber(match, 16))\n end)\n end\n\n ---@type Request\n Request = {\n is_done = false,\n is_successful = false\n }\n\n -- Creates a new instance of a Request. Should not be directly called. Instead use Request.start and Request.deferred.\n ---@param uri string\n ---@param configure fun(request: Request, status: WebRequestStatus)\n ---@return Request\n function Request:new(uri, configure)\n local this = {}\n\n setmetatable(this, self)\n self.__index = self\n\n if type(uri) == \"table\" then\n uri = table.concat(uri, \"/\")\n end\n\n this.uri = uri\n\n WebRequest.get(uri, function(status)\n configure(this, status)\n end)\n\n return this\n end\n\n -- Creates a new request. on_success should set the request's is_done, is_successful, and content variables.\n -- Deferred should be used when you don't want to set is_done immediately (such as if you want to wait for another request to finish)\n ---@param uri string\n ---@param on_success fun(request: Request, status: WebRequestStatus, vararg any)\n ---@param on_error fun(status: WebRequestStatus)|nil\n ---@vararg any[]\n ---@return Request\n function Request.deferred(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request:new(uri, function(request, status)\n if (status.is_done) then\n if (status.is_error) then\n request.error_message = on_error and on_error(status, table.unpack(parameters)) or status.error\n request.is_successful = false\n request.is_done = true\n else\n on_success(request, status)\n end\n end\n end)\n end\n\n -- Creates a new request. on_success should return weather the resultant data is as expected, and the processed content of the request.\n ---@param uri string\n ---@param on_success fun(status: WebRequestStatus, vararg any): boolean, any\n ---@param on_error nil|fun(status: WebRequestStatus, vararg any): string\n ---@vararg any[]\n ---@return Request\n function Request.start(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request.deferred(uri, function(request, status)\n local result, message = on_success(status, table.unpack(parameters))\n if not result then request.error_message = message else request.content = message end\n request.is_successful = result\n request.is_done = true\n end, on_error, table.unpack(parameters))\n end\n\n ---@param requests Request[]\n ---@param on_success fun(content: any[], vararg any[])\n ---@param on_error fun(requests: Request[], vararg any[])|nil\n ---@vararg any\n function Request.with_all(requests, on_success, on_error, ...)\n local parameters = table.pack(...)\n\n Wait.condition(function()\n ---@type any[]\n local results = {}\n\n ---@type Request[]\n local errors = {}\n\n for _, request in ipairs(requests) do\n if request.is_successful then\n table.insert(results, request.content)\n else\n table.insert(errors, request)\n end\n end\n\n if (#errors \u003c= 0) then\n on_success(results, table.unpack(parameters))\n elseif on_error == nil then\n for _, request in ipairs(errors) do\n internal.maybePrint(table.concat({ \"[ERROR]\", request.uri, \":\", request.error_message }))\n end\n else\n on_error(requests, table.unpack(parameters))\n end\n end, function()\n for _, request in ipairs(requests) do\n if not request.is_done then return false end\n end\n return true\n end)\n end\n\n ---@param callback fun(content: any, vararg any)\n function Request:with(callback, ...)\n local arguments = table.pack(...)\n Wait.condition(function()\n if self.is_successful then\n callback(self.content, table.unpack(arguments))\n end\n end, function() return self.is_done\n end)\n end\n\n return ArkhamDb\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardPanel\")\nend)\n__bundle_register(\"playercards/PlayerCardPanel\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardPanelData\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\nlocal arkhamDb = require(\"arkhamdb/ArkhamDb\")\nlocal spawnBag = require(\"playercards/SpawnBag\")\n\n-- Size and position information for the three rows of class buttons\nlocal CIRCLE_BUTTON_SIZE = 250\nlocal CLASS_BUTTONS_X_OFFSET = 0.1325\nlocal INVESTIGATOR_ROW_START = Vector(0.125, 0.1, -0.447)\nlocal LEVEL_ZERO_ROW_START = Vector(0.125, 0.1, -0.007)\nlocal UPGRADED_ROW_START = Vector(0.125, 0.1, 0.333)\n\n-- Size and position information for the two blocks of other buttons\nlocal MISC_BUTTONS_X_OFFSET = 0.155\nlocal WEAKNESS_ROW_START = Vector(0.157, 0.1, 0.666)\nlocal OTHER_ROW_START = Vector(0.605, 0.1, 0.666)\n\n-- Size and position information for the Cycle (box) buttons\nlocal CYCLE_BUTTON_SIZE = 468\nlocal CYCLE_BUTTON_START = Vector(-0.716, 0.1, -0.39)\nlocal CYCLE_COLUMN_COUNT = 3\nlocal CYCLE_BUTTONS_X_OFFSET = 0.267\nlocal CYCLE_BUTTONS_Z_OFFSET = 0.2665\n\nlocal STARTER_DECK_MODE_SELECTED_COLOR = { 0.2, 0.2, 0.2, 0.8 }\nlocal TRANSPARENT = { 0, 0, 0, 0 }\nlocal STARTER_DECK_MODE_STARTERS = \"starters\"\nlocal STARTER_DECK_MODE_CARDS_ONLY = \"cards\"\n\nlocal FACE_UP_ROTATION = { x = 0, y = 270, z = 0}\nlocal FACE_DOWN_ROTATION = { x = 0, y = 270, z = 180}\n\n-- ---------- IMPORTANT ----------\n-- Coordinates defined below are in global dimensions relative to the panel - DO NOT USE THESE\n-- DIRECTLY. Call scalePositions() before use, and reference the variables below\n\n-- Layout width for a single card, in global coordinate space\nlocal CARD_WIDTH = 2.3\n\n-- Coordinates to begin laying out cards. These vary based on the cards that are being placed by\n-- considering the width of the cards, number of cards, and desired spread intervals.\n-- IMPORTANT! Because of the mix of global card sizes and relative-to-scale positions, the X and Y\n-- coordinates on these provide global disances while the Z is local.\nlocal START_POSITIONS = {\n classCards = Vector(CARD_WIDTH * 9.5, 2, 1.4),\n investigator = Vector(6 * 2.5, 2, 1.3),\n cycle = Vector(CARD_WIDTH * 9.5, 2, 2.4),\n other = Vector(CARD_WIDTH * 9.5, 2, 1.4),\n randomWeakness = Vector(0, 2, 1.4),\n -- Because the card spread is handled by the SpawnBag, we don't know (programatically) where this\n -- should be placed. If more customizable cards are added it will need to be moved.\n summonedServitor = Vector(CARD_WIDTH * -7.5, 2, 1.7),\n}\n\n-- Shifts to move rows of cards, and groups of rows, as different groupings are laid out\nlocal CARD_ROW_OFFSET = 3.7\nlocal CARD_GROUP_OFFSET = 2\n\n-- Position offsets for investigator decks in investigator mode, defines the spacing for how the\n-- rows and columns are laid out\nlocal INVESTIGATOR_POSITION_SHIFT_ROW = Vector(0, 0, 11)\nlocal INVESTIGATOR_POSITION_SHIFT_COL = Vector(-6, 0, 0)\nlocal INVESTIGATOR_MAX_COLS = 6\n\n-- Positions relative to the minicard to place other stacks. Both signature card piles and starter\n-- decks use SIGNATURE_OFFSET\nlocal INVESTIGATOR_CARD_OFFSET = Vector(0, 0, 2.55)\nlocal INVESTIGATOR_SIGNATURE_OFFSET = Vector(0, 0, 5.75)\n\n-- USE THESE! Positions and offset shifts accounting for the scale of the panel\nlocal startPositions\nlocal cardRowOffset\nlocal cardGroupOffset\nlocal investigatorPositionShiftRow\nlocal investigatorPositionShiftCol\nlocal investigatorCardOffset\nlocal investigatorSignatureOffset\n\nlocal CLASS_LIST = { \"Guardian\", \"Seeker\", \"Rogue\", \"Mystic\", \"Survivor\", \"Neutral\" }\nlocal CYCLE_LIST = {\n \"Core\",\n \"The Dunwich Legacy\",\n \"The Path to Carcosa\",\n \"The Forgotten Age\",\n \"The Circle Undone\",\n \"The Dream-Eaters\",\n \"The Innsmouth Conspiracy\",\n \"Edge of the Earth\",\n \"The Scarlet Keys\",\n \"The Feast of Hemlock Vale\",\n \"Investigator Packs\"\n}\n\nlocal excludedNonBasicWeaknesses\n\nlocal starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY\nlocal helpVisibleToPlayers = { }\n\nfunction onSave()\n local saveState = {\n spawnBagState = spawnBag.getStateForSave(),\n }\n return JSON.encode(saveState)\nend\n\nfunction onLoad(savedData)\n arkhamDb.initialize()\n if (savedData ~= nil) then\n local saveState = JSON.decode(savedData) or { }\n if (saveState.spawnBagState ~= nil) then\n spawnBag.loadFromSave(saveState.spawnBagState)\n end\n end\n buildExcludedWeaknessList()\n createButtons()\nend\n\n-- Build a list of non-basic weaknesses which should be excluded from the last weakness set,\n-- including all signature cards and evolved weaknesses.\nfunction buildExcludedWeaknessList()\n excludedNonBasicWeaknesses = { }\n for _, investigator in pairs(INVESTIGATORS) do\n for _, signatureId in ipairs(investigator.signatures) do\n excludedNonBasicWeaknesses[signatureId] = true\n end\n end\n for _, weaknessId in ipairs(EVOLVED_WEAKNESSES) do\n excludedNonBasicWeaknesses[weaknessId] = true\n end\nend\n\nfunction createButtons()\n createHelpButton()\n createInvestigatorButtons()\n createLevelZeroButtons()\n createUpgradedButtons()\n createWeaknessButtons()\n createOtherButtons()\n createCycleButtons()\n createClearButton()\n -- Create investigator mode buttons last so the indexes are set when we need to update them\n createInvestigatorModeButtons()\nend\n\nfunction createHelpButton()\n self.createButton({\n function_owner = self,\n click_function = \"toggleHelp\",\n position = Vector(0.845, 0.1, -0.855),\n rotation = Vector(0, 0, 0),\n height = 180,\n width = 180,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n })\nend\n\nfunction createInvestigatorButtons()\n local invButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = INVESTIGATOR_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n invButtonParams.click_function = \"spawnInvestigators\" .. class\n invButtonParams.position = buttonPos\n self.createButton(invButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(invButtonParams.click_function, function(_, _, _) spawnInvestigatorGroup(class) end)\n end\nend\n\nfunction createLevelZeroButtons()\n local l0ButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = LEVEL_ZERO_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n l0ButtonParams.click_function = \"spawnBasic\" .. class\n l0ButtonParams.position = buttonPos\n self.createButton(l0ButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(l0ButtonParams.click_function, function(_, _, _) spawnClassCards(class, false) end)\n end\nend\n\nfunction createUpgradedButtons()\n local upgradedButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = UPGRADED_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n upgradedButtonParams.click_function = \"spawnUpgraded\" .. class\n upgradedButtonParams.position = buttonPos\n self.createButton(upgradedButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(upgradedButtonParams.click_function, function(_, _, _) spawnClassCards(class, true) end)\n end\nend\n\nfunction createWeaknessButtons()\n local weaknessButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = WEAKNESS_ROW_START:copy()\n weaknessButtonParams.click_function = \"spawnWeaknesses\"\n weaknessButtonParams.tooltip = \"All Weaknesses\"\n weaknessButtonParams.position = buttonPos\n self.createButton(weaknessButtonParams)\n buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET\n weaknessButtonParams.click_function = \"spawnRandomWeakness\"\n weaknessButtonParams.tooltip = \"Random Basic Weakness\"\n weaknessButtonParams.position = buttonPos\n self.createButton(weaknessButtonParams)\nend\n\nfunction createOtherButtons()\n local otherButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = OTHER_ROW_START:copy()\n otherButtonParams.click_function = \"spawnBonded\"\n otherButtonParams.tooltip = \"Bonded Cards\"\n otherButtonParams.position = buttonPos\n self.createButton(otherButtonParams)\n buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET\n otherButtonParams.click_function = \"spawnUpgradeSheets\"\n otherButtonParams.tooltip = \"Customization Upgrade Sheets\"\n otherButtonParams.position = buttonPos\n self.createButton(otherButtonParams)\nend\n\nfunction createCycleButtons()\n local cycleButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CYCLE_BUTTON_SIZE,\n width = CYCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = CYCLE_BUTTON_START:copy()\n local rowCount = 0\n local colCount = 0\n for _, cycle in ipairs(CYCLE_LIST) do\n cycleButtonParams.click_function = \"spawnCycle\" .. cycle\n cycleButtonParams.position = buttonPos\n cycleButtonParams.tooltip = cycle\n self.createButton(cycleButtonParams)\n self.setVar(cycleButtonParams.click_function, function(_, _, _) spawnCycle(cycle) end)\n colCount = colCount + 1\n -- If we've reached the end of a row, shift down and back to the first column\n if colCount \u003e= CYCLE_COLUMN_COUNT then\n buttonPos = CYCLE_BUTTON_START:copy()\n rowCount = rowCount + 1\n colCount = 0\n buttonPos.z = buttonPos.z + CYCLE_BUTTONS_Z_OFFSET * rowCount\n if rowCount == 3 then\n -- Account for two centered buttons on the final row\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET / 2\n --[[ Account for centered button on the final row\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET\n ]]\n end\n else\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET\n end\n end\nend\n\nfunction createClearButton()\n self.createButton({\n function_owner = self,\n click_function = \"deleteAll\",\n position = Vector(0, 0.1, 0.852),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 750,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n })\nend\n\nfunction createInvestigatorModeButtons()\n local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS\n\n self.createButton({\n function_owner = self,\n click_function = \"setCardsOnlyMode\",\n position = Vector(0.251, 0.1, -0.322),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 760,\n scale = Vector(0.25, 1, 0.25),\n color = starterMode and TRANSPARENT or STARTER_DECK_MODE_SELECTED_COLOR\n })\n self.createButton({\n function_owner = self,\n click_function = \"setStarterDeckMode\",\n position = Vector(0.66, 0.1, -0.322),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 760,\n scale = Vector(0.25, 1, 0.25),\n color = starterMode and STARTER_DECK_MODE_SELECTED_COLOR or TRANSPARENT\n })\n local checkX = starterMode and 0.52 or 0.11\n self.createButton({\n function_owner = self,\n label = \"✓\",\n click_function = \"doNothing\",\n position = Vector(checkX, 0.11, -0.317),\n rotation = Vector(0, 0, 0),\n height = 0,\n width = 0,\n scale = Vector(0.3, 1, 0.3),\n font_color = { 0, 0, 0 },\n color = { 1, 1, 1 }\n })\nend\n\nfunction toggleHelp(_, playerColor, _)\n if helpVisibleToPlayers[playerColor] then\n helpVisibleToPlayers[playerColor] = nil\n else\n helpVisibleToPlayers[playerColor] = true\n end\n updateHelpVisibility()\nend\n\nfunction updateHelpVisibility()\n local visibility = \"\"\n for player, _ in pairs(helpVisibleToPlayers) do\n if string.len(visibility) \u003e 0 then\n visibility = visibility .. \"|\" .. player\n else\n visibility = player\n end\n end\n self.UI.setAttribute(\"helpText\", \"visibility\", visibility)\n self.UI.setAttribute(\"helpPanel\", \"visibility\", visibility)\n self.UI.setAttribute(\"helpPanel\", \"active\", string.len(visibility) \u003e 0)\nend\n\nfunction setStarterDeckMode()\n starterDeckMode = STARTER_DECK_MODE_STARTERS\n updateStarterModeButtons()\nend\n\nfunction setCardsOnlyMode()\n starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY\n updateStarterModeButtons()\nend\n\nfunction updateStarterModeButtons()\n local buttonCount = #self.getButtons()\n -- Buttons are 0-indexed, so the last three are -1, -2, and -3 from the size\n self.removeButton(buttonCount - 1)\n self.removeButton(buttonCount - 2)\n self.removeButton(buttonCount - 3)\n createInvestigatorModeButtons()\nend\n\n-- Clears the table and updates positions based on scale. Should be called before ANY card\n-- placement\nfunction prepareToPlaceCards()\n deleteAll()\n scalePositions()\nend\n\n-- Updates the positions based on the current object scale to ensure the relative layout functions\n-- properly at different scales.\nfunction scalePositions()\n -- Assume scaling is consistent in X and Z dimensions\n local scale = 1 / self.getScale().x\n startPositions = { }\n for key, pos in pairs(START_POSITIONS) do\n -- Because a scaled object means a different global size, using global distance for Z results in\n -- the cards being closer or farther depending on the scale. Leave the Z values and only scale\n -- X and Y\n startPositions[key] = Vector(pos)\n startPositions[key].x = startPositions[key].x * scale\n startPositions[key].y = startPositions[key].y * scale\n end\n cardRowOffset = CARD_ROW_OFFSET * scale\n cardGroupOffset = CARD_GROUP_OFFSET * scale\n investigatorPositionShiftRow = Vector(INVESTIGATOR_POSITION_SHIFT_ROW):scale(scale)\n investigatorPositionShiftCol = Vector(INVESTIGATOR_POSITION_SHIFT_COL):scale(scale)\n investigatorCardOffset = Vector(INVESTIGATOR_CARD_OFFSET):scale(scale)\n investigatorSignatureOffset = Vector(INVESTIGATOR_SIGNATURE_OFFSET):scale(scale)\nend\n\n-- Deletes all cards currently placed on the table\nfunction deleteAll()\n spawnBag.recall(true)\nend\n\n-- Spawn an investigator group, based on the current UI setting for either investigators or starter\n-- decks.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnInvestigatorGroup(groupName)\n local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS\n prepareToPlaceCards()\n Wait.frames(function()\n if starterMode then\n spawnStarters(groupName)\n else\n spawnInvestigators(groupName)\n end\n end, 2)\nend\n\n-- Spawn cards for all investigators in the given group. This creates piles for all defined\n-- investigator cards and minicards as well as the signature cards.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnInvestigators(groupName)\n if INVESTIGATOR_GROUPS[groupName] == nil then\n printToAll(\"No \" .. groupName .. \" data yet\")\n return\n end\n\n local col = 1\n local row = 1\n local investigatorCount = #INVESTIGATOR_GROUPS[groupName]\n local position = getInvestigatorRowStartPos(investigatorCount, row)\n\n for i, investigatorName in ipairs(INVESTIGATOR_GROUPS[groupName]) do\n for _, spawnSpec in ipairs(buildInvestigatorSpawnSpec(\n investigatorName, INVESTIGATORS[investigatorName], position, false)) do\n spawnBag.spawn(spawnSpec)\n end\n position:add(investigatorPositionShiftCol)\n col = col + 1\n if col \u003e INVESTIGATOR_MAX_COLS then\n col = 1\n row = row + 1\n position = getInvestigatorRowStartPos(investigatorCount, row)\n end\n end\nend\n\nfunction getInvestigatorRowStartPos(investigatorCount, row)\n local rowStart = Vector(startPositions.investigator)\n rowStart:add(Vector(\n investigatorPositionShiftRow.x * (row - 1),\n investigatorPositionShiftRow.y * (row - 1),\n investigatorPositionShiftRow.z * (row - 1)))\n local investigatorsInRow =\n math.min(investigatorCount - INVESTIGATOR_MAX_COLS * (row - 1), INVESTIGATOR_MAX_COLS)\n rowStart:add(Vector(\n investigatorPositionShiftCol.x * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2,\n investigatorPositionShiftCol.y * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2,\n investigatorPositionShiftCol.z * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2))\n\n return rowStart\nend\n\n-- Creates the spawn spec for the investigator's signature cards.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\n---@param investigatorData Table. Spawn definition for the investigator, retrieved from\n--- INVESTIGATORS\n---@param position Vector. Where to spawn the minicard; investigagor cards will be placed below\nfunction buildInvestigatorSpawnSpec(investigatorName, investigatorData, position)\n local sigPos = Vector(position):add(investigatorSignatureOffset)\n local spawns = buildCommonSpawnSpec(investigatorName, investigatorData, position)\n table.insert(spawns, {\n name = investigatorName..\"signatures\",\n cards = investigatorData.signatures,\n globalPos = self.positionToWorld(sigPos),\n rotation = FACE_UP_ROTATION,\n })\n\n return spawns\nend\n\n-- Builds the spawn specs for minicards and investigator cards. These are common enough to be\n-- shared, and will only differ in whether they spawn the full stack of possible investigator and\n-- minicards, or only the first of each.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\n---@param investigatorData Table. Spawn definition for the investigator, retrieved from\n--- INVESTIGATORS\n---@param position Vector. Where to spawn the minicard; investigagor cards will be placed below\n---@param oneCardOnly Boolean. If true, will spawn only the first card in the investigator card\n--- and minicard lists. Otherwise, spawn them all in a deck\nfunction buildCommonSpawnSpec(investigatorName, investigatorData, position, oneCardOnly)\n local cardPos = Vector(position):add(investigatorCardOffset)\n return {\n {\n name = investigatorName..\"minicards\",\n cards = oneCardOnly and { investigatorData.minicards[1] } or investigatorData.minicards,\n globalPos = self.positionToWorld(position),\n rotation = FACE_UP_ROTATION,\n },\n {\n name = investigatorName..\"cards\",\n cards = oneCardOnly and { investigatorData.cards[1] } or investigatorData.cards,\n globalPos = self.positionToWorld(cardPos),\n rotation = FACE_UP_ROTATION,\n },\n }\nend\n\n-- Spawns all starter decks (single minicard and investigator card, plus the starter deck) for\n-- investigators in the given group.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnStarters(groupName)\n local col = 1\n local row = 1\n local investigatorCount = #INVESTIGATOR_GROUPS[groupName]\n local position = getInvestigatorRowStartPos(investigatorCount, row)\n for _, investigatorName in ipairs(INVESTIGATOR_GROUPS[groupName]) do\n spawnStarterDeck(investigatorName, INVESTIGATORS[investigatorName], position)\n position:add(investigatorPositionShiftCol)\n col = col + 1\n if col \u003e INVESTIGATOR_MAX_COLS then\n col = 1\n row = row + 1\n position = getInvestigatorRowStartPos(investigatorCount, row)\n end\n end\nend\n\n-- Spawns the defined starter deck for the given investigator's.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\nfunction spawnStarterDeck(investigatorName, investigatorData, position)\n for _, spawnSpec in ipairs(\n buildCommonSpawnSpec(investigatorName, INVESTIGATORS[investigatorName], position, true)) do\n spawnBag.spawn(spawnSpec)\n end\n local deckPos = Vector(position):add(investigatorSignatureOffset)\n arkhamDb.getDecklist(\"None\", investigatorData.starterDeck, true, false, false, function(slots)\n local cardIdList = { }\n for id, count in pairs(slots) do\n for i = 1, count do\n table.insert(cardIdList, id)\n end\n end\n spawnBag.spawn({\n name = investigatorName..\"starter\",\n cards = cardIdList,\n globalPos = self.positionToWorld(deckPos),\n rotation = FACE_DOWN_ROTATION\n })\n end)\nend\n-- Clears the currently placed cards, then places cards for the given class and level spread\n---@param cardClass String. Class to place (\"Guardian\", \"Seeker\", etc)\n---@param isUpgraded Boolean. If true, spawn the Level 1-5 cards. Otherwise, Level 0.\nfunction spawnClassCards(cardClass, isUpgraded)\n prepareToPlaceCards()\n Wait.frames(function() placeClassCards(cardClass, isUpgraded) end, 2)\nend\n\n-- Spawn the class cards.\n---@param cardClass String. Class to place (\"Guardian\", \"Seeker\", etc)\n---@param isUpgraded Boolean. If true, spawn the Level 1-5 cards. Otherwise, Level 0.\nfunction placeClassCards(cardClass, isUpgraded)\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local cardIdList = allCardsBagApi.getCardsByClassAndLevel(cardClass, isUpgraded)\n\n local skillList = { }\n local eventList = { }\n local assetList = { }\n for _, cardId in ipairs(cardIdList) do\n local cardMetadata = allCardsBagApi.getCardById(cardId).metadata\n if (cardMetadata.type == \"Skill\") then\n table.insert(skillList, cardId)\n elseif (cardMetadata.type == \"Event\") then\n table.insert(eventList, cardId)\n elseif (cardMetadata.type == \"Asset\") then\n table.insert(assetList, cardId)\n end\n end\n local groupPos = Vector(startPositions.classCards)\n if #skillList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = skillList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#skillList / 20) * cardRowOffset + cardGroupOffset\n end\n if #eventList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. \"event\" .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = eventList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#eventList / 20) * cardRowOffset + cardGroupOffset\n end\n if #assetList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. \"asset\" .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = assetList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n end\nend\n\n-- Spawns the investigator sets and all cards for the given cycle\n---@param cycle String Name of a cycle, should match the standard used in card metadata\nfunction spawnCycle(cycle)\n prepareToPlaceCards()\n spawnInvestigators(cycle)\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local cycleCardList = allCardsBagApi.getCardsByCycle(cycle)\n local copiedList = { }\n for i, id in ipairs(cycleCardList) do\n copiedList[i] = id\n end\n spawnBag.spawn({\n name = \"cycle\"..cycle,\n cards = copiedList,\n globalPos = self.positionToWorld(startPositions.cycle),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnBonded()\n prepareToPlaceCards()\n spawnBag.spawn({\n name = \"bonded\",\n cards = BONDED_CARD_LIST,\n globalPos = self.positionToWorld(startPositions.classCards),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnUpgradeSheets()\n prepareToPlaceCards()\n spawnBag.spawn({\n name = \"upgradeSheets\",\n cards = UPGRADE_SHEET_LIST,\n globalPos = self.positionToWorld(startPositions.classCards),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n spawnBag.spawn({\n name = \"servitor\",\n cards = { \"09080-m\" },\n globalPos = self.positionToWorld(startPositions.summonedServitor),\n rotation = FACE_UP_ROTATION,\n })\nend\n\n-- Clears the current cards, and places all basic weaknesses on the table.\nfunction spawnWeaknesses()\n prepareToPlaceCards()\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local weaknessIdList = allCardsBagApi.getUniqueWeaknesses()\n local basicWeaknessList = { }\n local otherWeaknessList = { }\n for i, id in ipairs(weaknessIdList) do\n local cardMetadata = allCardsBagApi.getCardById(id).metadata\n if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount \u003e 0 then\n table.insert(basicWeaknessList, id)\n elseif excludedNonBasicWeaknesses[id] == nil then\n table.insert(otherWeaknessList, id)\n end\n end\n local groupPos = Vector(startPositions.classCards)\n spawnBag.spawn({\n name = \"basicWeaknesses\",\n cards = basicWeaknessList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#basicWeaknessList / 20) * cardRowOffset + cardGroupOffset\n spawnBag.spawn({\n name = \"evolvedWeaknesses\",\n cards = EVOLVED_WEAKNESSES,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#EVOLVED_WEAKNESSES / 20) * cardRowOffset + cardGroupOffset\n spawnBag.spawn({\n name = \"otherWeaknesses\",\n cards = otherWeaknessList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnRandomWeakness()\n prepareToPlaceCards()\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n if (weaknessId == nil) then\n broadcastToAll(\"All basic weaknesses are in play!\", {0.9, 0.2, 0.2})\n return\n end\n spawnBag.spawn({\n name = \"randomWeakness\",\n cards = { weaknessId },\n globalPos = self.positionToWorld(startPositions.randomWeakness),\n rotation = FACE_UP_ROTATION,\n })\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardPanelData\", function(require, _LOADED, __bundle_register, __bundle_modules)\nBONDED_CARD_LIST = {\n\t\"05314\", -- Soothing Melody\n\t\"06277\", -- Wish Eater\n\t\"06019\", -- Bloodlust\n\t\"06022\", -- Pendant of the Queen\n\t\"05317\", -- Blood-rite\n\t\"06113\", -- Essence of the Dream\n\t\"06028\", -- Stars Are Right\n\t\"06025\", -- Guardian of the Crystallizer\n\t\"06283\", -- Unbound Beast\n\t\"06032\", -- Zeal\n\t\"06031\", -- Hope\n\t\"06033\", -- Augur\n\t\"06331\", -- Dream Parasite\n\t\"06015a\", -- Dream-Gate\n\t\"10045\" -- Uncanny Growth\n}\n\nUPGRADE_SHEET_LIST = {\n\t\"09040-c\", -- Alchemical Distillation\n\t\"09023-c\", -- Custom Modifications\n\t\"09059-c\", -- Damning Testimony\n\t\"09041-c\", -- Emperical Hypothesis\n\t\"09060-c\", -- Friends in Low Places\n\t\"09101-c\", -- Grizzled\n\t\"09061-c\", -- Honed Instinct\n\t\"09021-c\", -- Hunter's Armor\n\t\"09119-c\", -- Hyperphysical Shotcaster\n\t\"09079-c\", -- Living Ink\n\t\"09100-c\", -- Makeshift Trap\n\t\"09099-c\", -- Pocket Multi Tool\n\t\"09081-c\", -- Power Word\n\t\"09081-t-c\", -- Power Word (Taboo)\n\t\"09022-c\", -- Runic Axe\n\t\"09022-t-c\", -- Runic Axe (Taboo)\n\t\"09080-c\", -- Summoned Servitor\n\t\"09042-c\", -- Raven's Quill\n}\n\nEVOLVED_WEAKNESSES = {\n\t\"04039\",\n\t\"04041\",\n\t\"04042\",\n\t\"53014\",\n\t\"53015\",\n}\n\n------------------ START INVESTIGATOR DATA DEFINITION ------------------\nINVESTIGATOR_GROUPS = {\n [\"Guardian\"] = {\n \"Roland Banks\",\n \t\"Zoey Samaras\",\n \t\"Mark Harrigan\",\n \t\"Leo Anderson\",\n \t\"Carolyn Fern\",\n \t\"Tommy Muldoon\",\n \t\"Nathaniel Cho\",\n \t\"Sister Mary\",\n \t\"Daniela Reyes\",\n \t\"Carson Sinclair\",\n\t\t\"Wilson Richards\"\n },\n [\"Seeker\"] = {\n \"Daisy Walker\",\n \t\"Rex Murphy\",\n \t\"Minh Thi Phan\",\n \t\"Ursula Downs\",\n \t\"Joe Diamond\",\n \t\"Mandy Thompson\",\n \t\"Harvey Walters\",\n \t\"Amanda Sharpe\",\n \t\"Norman Withers\",\n \t\"Vincent Lee\"\n },\n [\"Rogue\"] = {\n \t\"\\\"Skids\\\" O'Toole\",\n \t\"Jenny Barnes\",\n \t\"Sefina Rousseau\",\n \t\"Finn Edwards\",\n \t\"Preston Fairmont\",\n \t\"Tony Morgan\",\n \t\"Winifred Habbamock\",\n \t\"Trish Scarborough\",\n \t\"Monterey Jack\",\n \t\"Kymani Jones\",\n\t\t\"Alessandra Zorzi\"\n },\n [\"Mystic\"] = {\n \t\"Agnes Baker\",\n \t\"Jim Culver\",\n \t\"Akachi Onyele\",\n \t\"Father Mateo\",\n \t\"Diana Stanley\",\n \t\"Marie Lambeau\",\n \t\"Luke Robinson\",\n \t\"Jacqueline Fine\",\n \t\"Dexter Drake\",\n \t\"Lily Chen\",\n \t\"Amina Zidane\",\n \t\"Gloria Goldberg\"\n },\n [\"Survivor\"] = {\n \t\"Wendy Adams\",\n \t\"\\\"Ashcan\\\" Pete\",\n \t\"William Yorick\",\n \t\"Calvin Wright\",\n \t\"Rita Young\",\n \t\"Patrice Hathaway\",\n \t\"Stella Clark\",\n \t\"Silas Marsh\",\n \t\"Bob Jenkins\",\n \t\"Darrell Simmons\"\n },\n [\"Neutral\"] = {\n \t\"Lola Hayes\",\n \t\"Charlie Kane\",\n \t\"Subject 5U-21\"\n },\n [\"Core\"] = {\n \"Roland Banks\",\n \"Daisy Walker\",\n \"\\\"Skids\\\" O'Toole\",\n \"Agnes Baker\",\n \"Wendy Adams\"\n },\n [\"The Dunwich Legacy\"] = {\n \t\"Zoey Samaras\",\n \t\"Rex Murphy\",\n \t\"Jenny Barnes\",\n \t\"Jim Culver\",\n \t\"\\\"Ashcan\\\" Pete\"\n },\n [\"The Path to Carcosa\"] = {\n \t\"Mark Harrigan\",\n \t\"Minh Thi Phan\",\n \t\"Sefina Rousseau\",\n \t\"Akachi Onyele\",\n \t\"William Yorick\",\n \t\"Lola Hayes\"\n },\n [\"The Forgotten Age\"] = {\n \t\"Leo Anderson\",\n \t\"Ursula Downs\",\n \t\"Finn Edwards\",\n \t\"Father Mateo\",\n \t\"Calvin Wright\"\n },\n [\"The Circle Undone\"] = {\n \t\"Carolyn Fern\",\n \t\"Joe Diamond\",\n \t\"Preston Fairmont\",\n \t\"Diana Stanley\",\n \t\"Rita Young\",\n \t\"Marie Lambeau\"\n },\n [\"The Dream-Eaters\"] = {\n \t\"Tommy Muldoon\",\n \t\"Mandy Thompson\",\n \t\"Tony Morgan\",\n \t\"Luke Robinson\",\n \t\"Patrice Hathaway\"\n },\n [\"Investigator Packs\"] = {\n \t\"Nathaniel Cho\",\n \t\"Harvey Walters\",\n \t\"Winifred Habbamock\",\n \t\"Jacqueline Fine\",\n \t\"Stella Clark\",\n \t\"Gloria Goldberg\"\n },\n [\"The Innsmouth Conspiracy\"] = {\n \t\"Sister Mary\",\n \t\"Amanda Sharpe\",\n \t\"Trish Scarborough\",\n \t\"Dexter Drake\",\n \t\"Silas Marsh\"\n },\n [\"Edge of the Earth\"] = {\n \t\"Daniela Reyes\",\n \t\"Norman Withers\",\n \t\"Monterey Jack\",\n \t\"Lily Chen\",\n \t\"Bob Jenkins\"\n },\n [\"The Scarlet Keys\"] = {\n \t\"Carson Sinclair\",\n \t\"Vincent Lee\",\n \t\"Kymani Jones\",\n \t\"Amina Zidane\",\n \t\"Darrell Simmons\",\n \t\"Charlie Kane\"\n },\n\t[\"The Feast of Hemlock Vale\"] = {\n\t\t\"Alessandra Zorzi\",\n\t\t\"Wilson Richards\"\n\t}\n}\n\nINVESTIGATORS = {}\n--Core--\nINVESTIGATORS[\"Roland Banks\"] = {\n\tcards = { \"01001\", \"01001-p\", \"01001-pf\", \"01001-pb\" },\n\tminicards = { \"01001-m\" },\n\tsignatures = { \"01006\", \"01007\", \"90030\", \"90031\", \"90025\", \"90026\", \"90027\", \"90028\", \"90029\", \"98005\", \"98006\" },\n\tstarterDeck = \"2624931\"\n}\nINVESTIGATORS[\"Daisy Walker\"] = {\n\tcards = { \"01002\", \"01002-p\", \"01002-pf\", \"01002-pb\" },\n\tminicards = { \"01002-m\" },\n\tsignatures = { \"01008\", \"01009\", \"90002\", \"90003\" },\n\tstarterDeck = \"2624938\"\n}\nINVESTIGATORS[\"\\\"Skids\\\" O'Toole\"] = {\n\tcards = { \"01003\", \"01003-p\", \"01003-pf\", \"01003-pb\" },\n\tminicards = { \"01003-m\" },\n\tsignatures = { \"01010\", \"01011\", \"90009\", \"90010\" },\n\tstarterDeck = \"2624940\"\n}\nINVESTIGATORS[\"Agnes Baker\"] = {\n\tcards = { \"01004\", \"01004-p\", \"01004-pf\", \"01004-pb\" },\n\tminicards = { \"01004-m\" },\n\tsignatures = { \"01012\", \"01013\", \"90018\", \"90019\" },\n\tstarterDeck = \"2624944\"\n}\nINVESTIGATORS[\"Wendy Adams\"] = {\n\tcards = { \"01005\", \"01005-p\", \"01005-pf\", \"01005-pb\" },\n\tminicards = { \"01005-m\" },\n\tsignatures = { \"01014\", \"01015\", \"01515\", \"90039\", \"90040\", \"90038\" },\n\tstarterDeck = \"2624949\"\n}\n--Dunwich--\nINVESTIGATORS[\"Zoey Samaras\"] = {\n\tcards = { \"02001\", \"02001-p\", \"02001-pf\", \"02001-pb\" },\n\tminicards = { \"02001-m\" },\n\tsignatures = { \"02006\", \"02007\", \"90060\", \"90061\" },\n\tstarterDeck = \"2624950\"\n}\nINVESTIGATORS[\"Rex Murphy\"] = {\n\tcards = { \"02002\", \"02002-t\" },\n\tminicards = { \"02002-m\" },\n\tsignatures = { \"02008\", \"02009\" },\n\tstarterDeck = \"2624958\"\n}\nINVESTIGATORS[\"Jenny Barnes\"] = {\n\tcards = { \"02003\" },\n\tminicards = { \"02003-m\" },\n\tsignatures = { \"02010\", \"02011\", \"98002\", \"98003\" },\n\tstarterDeck = \"2624961\"\n}\nINVESTIGATORS[\"Jim Culver\"] = {\n\tcards = { \"02004\", \"02004-p\", \"02004-pf\", \"02004-pb\" },\n\tminicards = { \"02004-m\" },\n\tsignatures = { \"02012\", \"02013\", \"90050\", \"90051\", \"90052\", \"90053\" },\n\tstarterDeck = \"2624965\"\n}\nINVESTIGATORS[\"\\\"Ashcan\\\" Pete\"] = {\n\tcards = { \"02005\", \"02005-p\", \"02005-pf\", \"02005-pb\" },\n\tminicards = { \"02005-m\" },\n\tsignatures = { \"02014\", \"02015\", \"90047\", \"90048\" },\n\tstarterDeck = \"2624969\"\n}\n--Carcosa--\nINVESTIGATORS[\"Mark Harrigan\"] = {\n\tcards = { \"03001\" },\n\tminicards = { \"03001-m\" },\n\tsignatures = { \"03007\", \"03008\", \"03009\" },\n\tstarterDeck = \"2624975\"\n}\nINVESTIGATORS[\"Minh Thi Phan\"] = {\n\tcards = { \"03002\" },\n\tminicards = { \"03002-m\" },\n\tsignatures = { \"03010\", \"03011\" },\n\tstarterDeck = \"2624979\"\n}\nINVESTIGATORS[\"Sefina Rousseau\"] = {\n\tcards = { \"03003\" },\n\tminicards = { \"03003-m\" },\n\tsignatures = { \"03012\", \"03012\", \"03012\", \"03013\" },\n\tstarterDeck = \"2624981\"\n}\nINVESTIGATORS[\"Akachi Onyele\"] = {\n\tcards = { \"03004\" },\n\tminicards = { \"03004-m\" },\n\tsignatures = { \"03014\", \"03015\" },\n\tstarterDeck = \"2624984\"\n}\nINVESTIGATORS[\"William Yorick\"] = {\n\tcards = { \"03005\" },\n\tminicards = { \"03005-m\" },\n\tsignatures = { \"03016\", \"03017\" },\n\tstarterDeck = \"2624988\"\n}\nINVESTIGATORS[\"Lola Hayes\"] = {\n\tcards = { \"03006\", \"03006-t\" },\n\tminicards = { \"03006-m\" },\n\tsignatures = { \"03018\", \"03018\", \"03019\", \"03019\", \"03019-t\", \"03019-t\" },\n\tstarterDeck = \"2624990\"\n}\n--Forgotten--\nINVESTIGATORS[\"Leo Anderson\"] = {\n\tcards = { \"04001\" },\n\tminicards = { \"04001-m\" },\n\tsignatures = { \"04006\", \"04007\" },\n\tstarterDeck = \"2624994\"\n}\nINVESTIGATORS[\"Ursula Downs\"] = {\n\tcards = { \"04002\" },\n\tminicards = { \"04002-m\" },\n\tsignatures = { \"04008\", \"04009\" },\n\tstarterDeck = \"2625000\"\n}\nINVESTIGATORS[\"Finn Edwards\"] = {\n\tcards = { \"04003\" },\n\tminicards = { \"04003-m\" },\n\tsignatures = { \"04010\", \"04011\", \"04012\" },\n\tstarterDeck = \"2625003\"\n}\nINVESTIGATORS[\"Father Mateo\"] = {\n\tcards = { \"04004\" },\n\tminicards = { \"04004-m\" },\n\tsignatures = { \"04013\", \"04014\" },\n\tstarterDeck = \"2625005\"\n}\nINVESTIGATORS[\"Calvin Wright\"] = {\n\tcards = { \"04005\" },\n\tminicards = { \"04005-m\" },\n\tsignatures = { \"04015\", \"04016\" },\n\tstarterDeck = \"2625007\"\n}\n--Circle--\nINVESTIGATORS[\"Carolyn Fern\"] = {\n\tcards = { \"05001\" },\n\tminicards = { \"05001-m\" },\n\tsignatures = { \"05007\", \"05008\", \"98011\", \"98012\" },\n\tstarterDeck = \"2626342\"\n}\nINVESTIGATORS[\"Joe Diamond\"] = {\n\tcards = { \"05002\" },\n\tminicards = { \"05002-m\" },\n\tsignatures = { \"05009\", \"05010\" },\n\tstarterDeck = \"2626347\"\n}\nINVESTIGATORS[\"Preston Fairmont\"] = {\n\tcards = { \"05003\" },\n\tminicards = { \"05003-m\" },\n\tsignatures = { \"05011\", \"05012\" },\n\tstarterDeck = \"2626365\"\n}\nINVESTIGATORS[\"Diana Stanley\"] = {\n\tcards = { \"05004\" },\n\tminicards = { \"05004-m\" },\n\tsignatures = { \"05013\", \"05014\", \"05015\" },\n\tstarterDeck = \"2626385\"\n}\nINVESTIGATORS[\"Rita Young\"] = {\n\tcards = { \"05005\" },\n\tminicards = { \"05005-m\" },\n\tsignatures = { \"05016\", \"05017\" },\n\tstarterDeck = \"2626387\"\n}\nINVESTIGATORS[\"Marie Lambeau\"] = {\n\tcards = { \"05006\" },\n\tminicards = { \"05006-m\" },\n\tsignatures = { \"05018\", \"05019\" },\n\tstarterDeck = \"2626395\"\n}\n--Dream--\nINVESTIGATORS[\"Tommy Muldoon\"] = {\n\tcards = { \"06001\" },\n\tminicards = { \"06001-m\" },\n\tsignatures = { \"06006\", \"06007\" },\n\tstarterDeck = \"2626402\"\n}\nINVESTIGATORS[\"Mandy Thompson\"] = {\n\tcards = { \"06002\", \"06002-t\" },\n\tminicards = { \"06002-m\" },\n\tsignatures = { \"06008\", \"06008\", \"06008\", \"06009\" },\n\tstarterDeck = \"2626410\"\n}\nINVESTIGATORS[\"Tony Morgan\"] = {\n\tcards = { \"06003\" },\n\tminicards = { \"06003-m\" },\n\tsignatures = { \"06010\", \"06011\", \"06011\", \"06012\" },\n\tstarterDeck = \"2626446\"\n}\nINVESTIGATORS[\"Luke Robinson\"] = {\n\tcards = { \"06004\" },\n\tminicards = { \"06004-m\" },\n\tsignatures = { \"06013\", \"06014\", \"06015\" },\n\tstarterDeck = \"2626452\"\n}\nINVESTIGATORS[\"Patrice Hathaway\"] = {\n\tcards = { \"06005\" },\n\tminicards = { \"06005-m\" },\n\tsignatures = { \"06016\", \"06017\" },\n\tstarterDeck = \"2626461\"\n}\n--Starter--\nINVESTIGATORS[\"Nathaniel Cho\"] = {\n\tcards = { \"60101\" },\n\tminicards = { \"60101-m\" },\n\tsignatures = { \"60102\", \"60103\" },\n\tstarterDeck = \"2643925\"\n}\nINVESTIGATORS[\"Harvey Walters\"] = {\n\tcards = { \"60201\" },\n\tminicards = { \"60201-m\" },\n\tsignatures = { \"60202\", \"60203\" },\n\tstarterDeck = \"2643928\"\n}\nINVESTIGATORS[\"Winifred Habbamock\"] = {\n\tcards = { \"60301\" },\n\tminicards = { \"60301-m\" },\n\tsignatures = { \"60302\", \"60303\" },\n\tstarterDeck = \"2643931\"\n}\nINVESTIGATORS[\"Jacqueline Fine\"] = {\n\tcards = { \"60401\" },\n\tminicards = { \"60401-m\" },\n\tsignatures = { \"60402\", \"60403\" },\n\tstarterDeck = \"2643932\"\n}\nINVESTIGATORS[\"Stella Clark\"] = {\n\tcards = { \"60501\" },\n\tminicards = { \"60501-m\" },\n\tsignatures = { \"60502\", \"60502\", \"60502\", \"60503\" },\n\tstarterDeck = \"2643934\"\n}\n--Innsmouth--\nINVESTIGATORS[\"Sister Mary\"] = {\n\tcards = { \"07001\" },\n\tminicards = { \"07001-m\" },\n\tsignatures = { \"07006\", \"07007\" },\n\tstarterDeck = \"2626464\"\n}\nINVESTIGATORS[\"Amanda Sharpe\"] = {\n\tcards = { \"07002\" },\n\tminicards = { \"07002-m\" },\n\tsignatures = { \"07008\", \"07009\" },\n\tstarterDeck = \"2626469\"\n}\nINVESTIGATORS[\"Trish Scarborough\"] = {\n\tcards = { \"07003\", \"07003-t\" },\n\tminicards = { \"07003-m\" },\n\tsignatures = { \"07010\", \"07011\" },\n\tstarterDeck = \"2626479\"\n}\nINVESTIGATORS[\"Dexter Drake\"] = {\n\tcards = { \"07004\" },\n\tminicards = { \"07004-m\" },\n\tsignatures = { \"07012\", \"07013\", \"98017\", \"98018\" },\n\tstarterDeck = \"2626672\"\n}\nINVESTIGATORS[\"Silas Marsh\"] = {\n\tcards = { \"07005\" },\n\tminicards = { \"07005-m\" },\n\tsignatures = { \"07014\", \"07015\", \"07016\", \"98014\", \"98015\" },\n\tstarterDeck = \"2626685\"\n}\n--Edge--\nINVESTIGATORS[\"Daniela Reyes\"] = {\n\tcards = { \"08001\" },\n\tminicards = { \"08001-m\" },\n\tsignatures = { \"08002\", \"08003\" },\n\tstarterDeck = \"2634588\"\n}\nINVESTIGATORS[\"Norman Withers\"] = {\n\tcards = { \"08004\" },\n\tminicards = { \"08004-m\" },\n\tsignatures = { \"08005\", \"08006\", \"98008\", \"98009\" },\n\tstarterDeck = \"2634603\"\n}\nINVESTIGATORS[\"Monterey Jack\"] = {\n\tcards = { \"08007\" },\n\tminicards = { \"08007-m\" },\n\tsignatures = { \"08008\", \"08009\" },\n\tstarterDeck = \"2634652\"\n}\nINVESTIGATORS[\"Lily Chen\"] = {\n\tcards = { \"08010\" },\n\tminicards = { \"08010-m\" },\n\tsignatures = { \"08011a\", \"08012a\", \"08013a\", \"08014a\", \"08015\", \"08015\", \"08015\", \"08015\" },\n\tstarterDeck = \"2634658\"\n}\nINVESTIGATORS[\"Bob Jenkins\"] = {\n\tcards = { \"08016\" },\n\tminicards = { \"08016-m\" },\n\tsignatures = { \"08017\", \"08018\" },\n\tstarterDeck = \"2634643\"\n}\n--Scarlet--\nINVESTIGATORS[\"Carson Sinclair\"] = {\n\tcards = { \"09001\" },\n\tminicards = { \"09001-m\" },\n\tsignatures = { \"09002\", \"09002\", \"09003\" },\n\tstarterDeck = \"2634667\"\n}\nINVESTIGATORS[\"Vincent Lee\"] = {\n\tcards = { \"09004\" },\n\tminicards = { \"09004-m\" },\n\tsignatures = { \"09005\", \"09006\", \"09006\", \"09006\", \"09006\", \"09007\" },\n\tstarterDeck = \"2634675\"\n}\nINVESTIGATORS[\"Kymani Jones\"] = {\n\tcards = { \"09008\" },\n\tminicards = { \"09008-m\" },\n\tsignatures = { \"09009\", \"09010\" },\n\tstarterDeck = \"2634701\"\n}\nINVESTIGATORS[\"Amina Zidane\"] = {\n\tcards = { \"09011\" },\n\tminicards = { \"09011-m\" },\n\tsignatures = { \"09012\", \"09013\", \"09014\" },\n\tstarterDeck = \"2634697\"\n}\nINVESTIGATORS[\"Darrell Simmons\"] = {\n\tcards = { \"09015\" },\n\tminicards = { \"09015-m\" },\n\tsignatures = { \"09016\", \"09017\" },\n\tstarterDeck = \"2634757\"\n}\nINVESTIGATORS[\"Charlie Kane\"] = {\n\tcards = { \"09018\" },\n\tminicards = { \"09018-m\" },\n\tsignatures = { \"09019\", \"09020\" },\n\tstarterDeck = \"2634706\"\n}\n--Hemlock Vale--\nINVESTIGATORS[\"Alessandra Zorzi\"] = {\n\tcards = { \"10009\" },\n\tminicards = { \"10009-m\" },\n\tsignatures = { \"10010\", \"10010\", \"10010\", \"10011\" },\n\tstarterDeck = \"2643931\" --winifred deck as placeholder\n}\nINVESTIGATORS[\"Wilson Richards\"] = {\n\tcards = { \"10001\" },\n\tminicards = { \"10001-m\" },\n\tsignatures = { \"10002\", \"10003\" },\n\tstarterDeck = \"2634667\" --carson deck as placeholder\n}\n--PnP--\nINVESTIGATORS[\"Subject 5U-21\"] = {\n\tcards = { \"89001\" },\n\tminicards = { \"89001-m\" },\n\tsignatures = { \"89002\", \"89003\", \"89003\", \"89003\", \"89004\", \"89004\", \"89004\", \"89005\" },\n\tstarterDeck = \"2624990\" -- Lola's deck id until Suzi is on ArkhamDB\n}\n--Promo--\nINVESTIGATORS[\"Gloria Goldberg\"] = {\n\tcards = { \"98019\" },\n\tminicards = { \"98019-m\" },\n\tsignatures = { \"98020\", \"98021\" },\n\tstarterDeck = \"2636199\"\n}\n------------------ END INVESTIGATOR DATA DEFINITION ------------------\nend)\n__bundle_register(\"playercards/SpawnBag\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardSpawner\")\n\n-- Allows spawning of defined lists of cards which will be created from the template in the All\n-- Player Cards bag. SpawnBag.spawn will create objects based on a table definition, while\n-- SpawnBag.recall will clean them all up. Recall will be limited to a small area around the\n-- spawned objects. Objects moved out of this area will not be cleaned up.\n--\n-- SpawnSpec: Spawning requires a spawn specification with the following structure:\n-- {\n-- name: Name of this spawn content, used for internal tracking. Multiple specs can be spawned,\n-- but each requires a separate name\n-- cards: A list of card IDs to be spawned\n-- globalPos: Where the spawned objects should be placed, in global coordinates. This should be\n-- a valid Vector with x, y, and z defined, e.g. { x = 5, y = 1, z = 15 }\n-- rotation: Rotation for the spawned objects. X=180 should be used for face down items. As with\n-- globalPos, this should be a valid Vector with x, y, and z defined\n-- spread: Optional Boolean. If present and true, cards will be spawned next to each other in a\n-- spread moving to the right. globalPos will define the location of the first card, each\n-- after that will be moved a predefined distance\n-- spreadCols: Optional integer. If spread is true, specifies the maximum columns cards will be\n-- laid out in before starting a new row. If spread is true but spreadCols is not set, all\n-- cards will be in a single row (however long that may be)\n-- }\n-- See BondedBag.ttslua for an example\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\n local SpawnBag = { }\n local internal = { }\n\n -- To assist debugging, will draw a box around the recall zone when it's set up\n local SHOW_RECALL_ZONE = false\n\n -- Distance to expand the recall zone around any added object.\n local RECALL_BUFFER_X = 0.9\n local RECALL_BUFFER_Z = 0.5\n\n -- In order to mimic the behavior of the previous memory buttons we use a temporary bag when\n -- recalling objects. This bag is tiny and transparent, and will be placed at the same location as\n -- this object. Once all placed cards are recalled bag to this bag, it will be destroyed\n local RECALL_BAG = {\n Name = \"Bag\",\n Transform = {\n scaleX = 0.01,\n scaleY = 0.01,\n scaleZ = 0.01,\n },\n ColorDiffuse = {\n r = 0,\n g = 0,\n b = 0,\n a = 0,\n },\n Locked = true,\n Grid = true,\n Snap = false,\n Tooltip = false,\n }\n\n -- Tracks what has been placed by this \"bag\" so they can be recalled\n local placedSpecs = { }\n local placedObjectGuids = { }\n local recallZone = nil\n\n -- Loads a table of saved state, extracted during the parent object's onLoad\n SpawnBag.loadFromSave = function(saveTable)\n placedSpecs = saveTable.placed\n placedObjectGuids = saveTable.placedObjects\n recallZone = saveTable.recall\n end\n\n -- Generates a table of save state that can be included in the parent object's onSave\n SpawnBag.getStateForSave = function()\n return {\n placed = placedSpecs,\n placedObjects = placedObjectGuids,\n recall = recallZone,\n }\n end\n\n -- Places the given spawnSpec on the table. See SpawnBag.ttslua header for spawnSpec table data and\n -- examples\n SpawnBag.spawn = function(spawnSpec)\n -- Limit to one placement at a time\n if (placedSpecs[spawnSpec.name]) then\n return\n end\n if (spawnSpec == nil) then\n -- TODO: error here\n return\n end\n local cardsToSpawn = { }\n local cardList = spawnSpec.cards\n for _, cardId in ipairs(cardList) do\n local cardData = allCardsBagApi.getCardById(cardId)\n if (cardData ~= nil) then\n table.insert(cardsToSpawn, cardData)\n else\n -- TODO: error here\n end\n end\n if (spawnSpec.spread) then\n Spawner.spawnCardSpread(cardsToSpawn, spawnSpec.globalPos, spawnSpec.spreadCols or 9999, spawnSpec.rotation, false, internal.recordPlacedObject)\n else\n -- TTS decks come out in reverse order of the cards, reverse the list so the input order stays\n -- This only applies for decks; spreads are spawned by us in the order given\n if spawnSpec.rotation.z != 180 then\n cardsToSpawn = internal.reverseList(cardsToSpawn)\n end\n Spawner.spawnCards(cardsToSpawn, spawnSpec.globalPos, spawnSpec.rotation, false, internal.recordPlacedObject)\n end\n placedSpecs[spawnSpec.name] = true\n end\n\n -- Recalls all spawned objects to the bag, and clears the placedObjectGuids list\n ---@param fast Boolean. If true, cards will be deleted directly without faking the bag recall.\n SpawnBag.recall = function(fast)\n if fast then\n internal.deleteSpawned()\n else\n internal.recallSpawned()\n end\n\n -- We've recalled everything we can, some cards may have been moved out of the\n -- card area. Just reset at this point.\n placedSpecs = { }\n placedObjectGuids = { }\n recallZone = nil\n end\n\n -- Deleted all spawned cards.\n internal.deleteSpawned = function()\n for guid, _ in pairs(placedObjectGuids) do\n local obj = getObjectFromGUID(guid)\n if (obj ~= nil) then\n if (internal.isInRecallZone(obj)) then\n obj.destruct()\n end\n placedObjectGuids[guid] = nil\n end\n end\n end\n\n -- Recalls spawned cards with a fake bag that replicates the memory bag recall style.\n internal.recallSpawned = function()\n local trash = spawnObjectData({data = RECALL_BAG, position = self.getPosition()})\n for guid, _ in pairs(placedObjectGuids) do\n local obj = getObjectFromGUID(guid)\n if (obj ~= nil) then\n if (internal.isInRecallZone(obj)) then\n trash.putObject(obj)\n end\n placedObjectGuids[guid] = nil\n end\n end\n\n trash.destruct()\n end\n\n\n -- Callback for when an object has been spawned. Tracks the object for later recall and updates the\n -- recall zone.\n internal.recordPlacedObject = function(spawned)\n placedObjectGuids[spawned.getGUID()] = true\n internal.expandRecallZone(spawned)\n end\n\n -- Expands the current recall zone based on the position of the given object. The recall zone will\n -- be maintained as the bounding box of the extreme object positions, plus a small amount of buffer\n internal.expandRecallZone = function(spawnedCard)\n local pos = spawnedCard.getPosition()\n if (recallZone == nil) then\n -- First card out of the bag, initialize surrounding that\n recallZone = { }\n recallZone.upperLeft = { x = pos.x + RECALL_BUFFER_X, z = pos.z + RECALL_BUFFER_Z }\n recallZone.lowerRight = { x = pos.x - RECALL_BUFFER_X, z = pos.z - RECALL_BUFFER_Z }\n return\n else\n if (pos.x \u003e recallZone.upperLeft.x) then\n recallZone.upperLeft.x = pos.x + RECALL_BUFFER_X\n end\n if (pos.x \u003c recallZone.lowerRight.x) then\n recallZone.lowerRight.x = pos.x - RECALL_BUFFER_X\n end\n if (pos.z \u003e recallZone.upperLeft.z) then\n recallZone.upperLeft.z = pos.z + RECALL_BUFFER_Z\n end\n if (pos.z \u003c recallZone.lowerRight.z) then\n recallZone.lowerRight.z = pos.z - RECALL_BUFFER_Z\n end\n end\n if (SHOW_RECALL_ZONE) then\n local y = 1.5\n local thick = 0.05\n Global.setVectorLines({\n {\n points = { {recallZone.upperLeft.x,y,recallZone.upperLeft.z}, {recallZone.upperLeft.x,y,recallZone.lowerRight.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.upperLeft.x,y,recallZone.lowerRight.z}, {recallZone.lowerRight.x,y,recallZone.lowerRight.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.lowerRight.x,y,recallZone.lowerRight.z}, {recallZone.lowerRight.x,y,recallZone.upperLeft.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.lowerRight.x,y,recallZone.upperLeft.z}, {recallZone.upperLeft.x,y,recallZone.upperLeft.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n })\n end\n end\n\n -- Checks to see if the given object is in the current recall zone. If there isn't a recall zone,\n -- will return true so that everything can be easily cleaned up.\n internal.isInRecallZone = function(obj)\n if (recallZone == nil) then\n return true\n end\n local pos = obj.getPosition()\n return (pos.x \u003c recallZone.upperLeft.x and pos.x \u003e recallZone.lowerRight.x\n and pos.z \u003c recallZone.upperLeft.z and pos.z \u003e recallZone.lowerRight.z)\n end\n\n internal.reverseList = function(list)\n local reversed = { }\n for i = 1, #list do\n reversed[i] = list[#list - i + 1]\n end\n\n return reversed\n end\n\n return SpawnBag\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param card: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"playercards/SpawnBag\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardSpawner\")\n\n-- Allows spawning of defined lists of cards which will be created from the template in the All\n-- Player Cards bag. SpawnBag.spawn will create objects based on a table definition, while\n-- SpawnBag.recall will clean them all up. Recall will be limited to a small area around the\n-- spawned objects. Objects moved out of this area will not be cleaned up.\n--\n-- SpawnSpec: Spawning requires a spawn specification with the following structure:\n-- {\n-- name: Name of this spawn content, used for internal tracking. Multiple specs can be spawned,\n-- but each requires a separate name\n-- cards: A list of card IDs to be spawned\n-- globalPos: Where the spawned objects should be placed, in global coordinates. This should be\n-- a valid Vector with x, y, and z defined, e.g. { x = 5, y = 1, z = 15 }\n-- rotation: Rotation for the spawned objects. X=180 should be used for face down items. As with\n-- globalPos, this should be a valid Vector with x, y, and z defined\n-- spread: Optional Boolean. If present and true, cards will be spawned next to each other in a\n-- spread moving to the right. globalPos will define the location of the first card, each\n-- after that will be moved a predefined distance\n-- spreadCols: Optional integer. If spread is true, specifies the maximum columns cards will be\n-- laid out in before starting a new row. If spread is true but spreadCols is not set, all\n-- cards will be in a single row (however long that may be)\n-- }\n-- See BondedBag.ttslua for an example\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n\n local SpawnBag = { }\n local internal = { }\n\n -- To assist debugging, will draw a box around the recall zone when it's set up\n local SHOW_RECALL_ZONE = false\n\n -- Distance to expand the recall zone around any added object.\n local RECALL_BUFFER_X = 0.9\n local RECALL_BUFFER_Z = 0.5\n\n -- In order to mimic the behavior of the previous memory buttons we use a temporary bag when\n -- recalling objects. This bag is tiny and transparent, and will be placed at the same location as\n -- this object. Once all placed cards are recalled bag to this bag, it will be destroyed\n local RECALL_BAG = {\n Name = \"Bag\",\n Transform = {\n scaleX = 0.01,\n scaleY = 0.01,\n scaleZ = 0.01,\n },\n ColorDiffuse = {\n r = 0,\n g = 0,\n b = 0,\n a = 0,\n },\n Locked = true,\n Grid = true,\n Snap = false,\n Tooltip = false,\n }\n\n -- Tracks what has been placed by this \"bag\" so they can be recalled\n local placedSpecs = { }\n local placedObjectGuids = { }\n local recallZone = nil\n\n -- Loads a table of saved state, extracted during the parent object's onLoad\n SpawnBag.loadFromSave = function(saveTable)\n placedSpecs = saveTable.placed\n placedObjectGuids = saveTable.placedObjects\n recallZone = saveTable.recall\n end\n\n -- Generates a table of save state that can be included in the parent object's onSave\n SpawnBag.getStateForSave = function()\n return {\n placed = placedSpecs,\n placedObjects = placedObjectGuids,\n recall = recallZone,\n }\n end\n\n -- Places the given spawnSpec on the table. See SpawnBag.ttslua header for spawnSpec table data and\n -- examples\n SpawnBag.spawn = function(spawnSpec)\n -- Limit to one placement at a time\n if (placedSpecs[spawnSpec.name]) then\n return\n end\n if (spawnSpec == nil) then\n -- TODO: error here\n return\n end\n local cardsToSpawn = { }\n local cardList = spawnSpec.cards\n for _, cardId in ipairs(cardList) do\n local cardData = allCardsBagApi.getCardById(cardId)\n if (cardData ~= nil) then\n table.insert(cardsToSpawn, cardData)\n else\n -- TODO: error here\n end\n end\n if (spawnSpec.spread) then\n Spawner.spawnCardSpread(cardsToSpawn, spawnSpec.globalPos, spawnSpec.spreadCols or 9999, spawnSpec.rotation, false, internal.recordPlacedObject)\n else\n -- TTS decks come out in reverse order of the cards, reverse the list so the input order stays\n -- This only applies for decks; spreads are spawned by us in the order given\n if spawnSpec.rotation.z ~= 180 then\n cardsToSpawn = internal.reverseList(cardsToSpawn)\n end\n Spawner.spawnCards(cardsToSpawn, spawnSpec.globalPos, spawnSpec.rotation, false, internal.recordPlacedObject)\n end\n placedSpecs[spawnSpec.name] = true\n end\n\n -- Recalls all spawned objects to the bag, and clears the placedObjectGuids list\n ---@param fast Boolean. If true, cards will be deleted directly without faking the bag recall.\n SpawnBag.recall = function(fast)\n if fast then\n internal.deleteSpawned()\n else\n internal.recallSpawned()\n end\n\n -- We've recalled everything we can, some cards may have been moved out of the\n -- card area. Just reset at this point.\n placedSpecs = { }\n placedObjectGuids = { }\n recallZone = nil\n end\n\n -- Deleted all spawned cards.\n internal.deleteSpawned = function()\n for guid, _ in pairs(placedObjectGuids) do\n local obj = getObjectFromGUID(guid)\n if (obj ~= nil) then\n if (internal.isInRecallZone(obj)) then\n obj.destruct()\n end\n placedObjectGuids[guid] = nil\n end\n end\n end\n\n -- Recalls spawned cards with a fake bag that replicates the memory bag recall style.\n internal.recallSpawned = function()\n local trash = spawnObjectData({data = RECALL_BAG, position = self.getPosition()})\n for guid, _ in pairs(placedObjectGuids) do\n local obj = getObjectFromGUID(guid)\n if (obj ~= nil) then\n if (internal.isInRecallZone(obj)) then\n trash.putObject(obj)\n end\n placedObjectGuids[guid] = nil\n end\n end\n\n trash.destruct()\n end\n\n\n -- Callback for when an object has been spawned. Tracks the object for later recall and updates the\n -- recall zone.\n internal.recordPlacedObject = function(spawned)\n placedObjectGuids[spawned.getGUID()] = true\n internal.expandRecallZone(spawned)\n end\n\n -- Expands the current recall zone based on the position of the given object. The recall zone will\n -- be maintained as the bounding box of the extreme object positions, plus a small amount of buffer\n internal.expandRecallZone = function(spawnedCard)\n local pos = spawnedCard.getPosition()\n if (recallZone == nil) then\n -- First card out of the bag, initialize surrounding that\n recallZone = { }\n recallZone.upperLeft = { x = pos.x + RECALL_BUFFER_X, z = pos.z + RECALL_BUFFER_Z }\n recallZone.lowerRight = { x = pos.x - RECALL_BUFFER_X, z = pos.z - RECALL_BUFFER_Z }\n return\n else\n if (pos.x \u003e recallZone.upperLeft.x) then\n recallZone.upperLeft.x = pos.x + RECALL_BUFFER_X\n end\n if (pos.x \u003c recallZone.lowerRight.x) then\n recallZone.lowerRight.x = pos.x - RECALL_BUFFER_X\n end\n if (pos.z \u003e recallZone.upperLeft.z) then\n recallZone.upperLeft.z = pos.z + RECALL_BUFFER_Z\n end\n if (pos.z \u003c recallZone.lowerRight.z) then\n recallZone.lowerRight.z = pos.z - RECALL_BUFFER_Z\n end\n end\n if (SHOW_RECALL_ZONE) then\n local y = 1.5\n local thick = 0.05\n Global.setVectorLines({\n {\n points = { {recallZone.upperLeft.x,y,recallZone.upperLeft.z}, {recallZone.upperLeft.x,y,recallZone.lowerRight.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.upperLeft.x,y,recallZone.lowerRight.z}, {recallZone.lowerRight.x,y,recallZone.lowerRight.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.lowerRight.x,y,recallZone.lowerRight.z}, {recallZone.lowerRight.x,y,recallZone.upperLeft.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n {\n points = { {recallZone.lowerRight.x,y,recallZone.upperLeft.z}, {recallZone.upperLeft.x,y,recallZone.upperLeft.z} },\n color = {1,0,0},\n thickness = thick,\n rotation = {0,0,0},\n },\n })\n end\n end\n\n -- Checks to see if the given object is in the current recall zone. If there isn't a recall zone,\n -- will return true so that everything can be easily cleaned up.\n internal.isInRecallZone = function(obj)\n if (recallZone == nil) then\n return true\n end\n local pos = obj.getPosition()\n return (pos.x \u003c recallZone.upperLeft.x and pos.x \u003e recallZone.lowerRight.x\n and pos.z \u003c recallZone.upperLeft.z and pos.z \u003e recallZone.lowerRight.z)\n end\n\n internal.reverseList = function(list)\n local reversed = { }\n for i = 1, #list do\n reversed[i] = list[#list - i + 1]\n end\n\n return reversed\n end\n\n return SpawnBag\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardPanel\")\nend)\n__bundle_register(\"playercards/PlayerCardPanel\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"playercards/PlayerCardPanelData\")\n\nlocal allCardsBagApi = require(\"playercards/AllCardsBagApi\")\nlocal arkhamDb = require(\"arkhamdb/ArkhamDb\")\nlocal spawnBag = require(\"playercards/SpawnBag\")\n\n-- Size and position information for the three rows of class buttons\nlocal CIRCLE_BUTTON_SIZE = 250\nlocal CLASS_BUTTONS_X_OFFSET = 0.1325\nlocal INVESTIGATOR_ROW_START = Vector(0.125, 0.1, -0.447)\nlocal LEVEL_ZERO_ROW_START = Vector(0.125, 0.1, -0.007)\nlocal UPGRADED_ROW_START = Vector(0.125, 0.1, 0.333)\n\n-- Size and position information for the two blocks of other buttons\nlocal MISC_BUTTONS_X_OFFSET = 0.155\nlocal WEAKNESS_ROW_START = Vector(0.157, 0.1, 0.666)\nlocal OTHER_ROW_START = Vector(0.605, 0.1, 0.666)\n\n-- Size and position information for the Cycle (box) buttons\nlocal CYCLE_BUTTON_SIZE = 468\nlocal CYCLE_BUTTON_START = Vector(-0.716, 0.1, -0.39)\nlocal CYCLE_COLUMN_COUNT = 3\nlocal CYCLE_BUTTONS_X_OFFSET = 0.267\nlocal CYCLE_BUTTONS_Z_OFFSET = 0.2665\n\nlocal STARTER_DECK_MODE_SELECTED_COLOR = { 0.2, 0.2, 0.2, 0.8 }\nlocal TRANSPARENT = { 0, 0, 0, 0 }\nlocal STARTER_DECK_MODE_STARTERS = \"starters\"\nlocal STARTER_DECK_MODE_CARDS_ONLY = \"cards\"\n\nlocal FACE_UP_ROTATION = { x = 0, y = 270, z = 0}\nlocal FACE_DOWN_ROTATION = { x = 0, y = 270, z = 180}\n\n-- ---------- IMPORTANT ----------\n-- Coordinates defined below are in global dimensions relative to the panel - DO NOT USE THESE\n-- DIRECTLY. Call scalePositions() before use, and reference the variables below\n\n-- Layout width for a single card, in global coordinate space\nlocal CARD_WIDTH = 2.3\n\n-- Coordinates to begin laying out cards. These vary based on the cards that are being placed by\n-- considering the width of the cards, number of cards, and desired spread intervals.\n-- IMPORTANT! Because of the mix of global card sizes and relative-to-scale positions, the X and Y\n-- coordinates on these provide global disances while the Z is local.\nlocal START_POSITIONS = {\n classCards = Vector(CARD_WIDTH * 9.5, 2, 1.4),\n investigator = Vector(6 * 2.5, 2, 1.3),\n cycle = Vector(CARD_WIDTH * 9.5, 2, 2.4),\n other = Vector(CARD_WIDTH * 9.5, 2, 1.4),\n randomWeakness = Vector(0, 2, 1.4),\n -- Because the card spread is handled by the SpawnBag, we don't know (programatically) where this\n -- should be placed. If more customizable cards are added it will need to be moved.\n summonedServitor = Vector(CARD_WIDTH * -7.5, 2, 1.7),\n}\n\n-- Shifts to move rows of cards, and groups of rows, as different groupings are laid out\nlocal CARD_ROW_OFFSET = 3.7\nlocal CARD_GROUP_OFFSET = 2\n\n-- Position offsets for investigator decks in investigator mode, defines the spacing for how the\n-- rows and columns are laid out\nlocal INVESTIGATOR_POSITION_SHIFT_ROW = Vector(0, 0, 11)\nlocal INVESTIGATOR_POSITION_SHIFT_COL = Vector(-6, 0, 0)\nlocal INVESTIGATOR_MAX_COLS = 6\n\n-- Positions relative to the minicard to place other stacks. Both signature card piles and starter\n-- decks use SIGNATURE_OFFSET\nlocal INVESTIGATOR_CARD_OFFSET = Vector(0, 0, 2.55)\nlocal INVESTIGATOR_SIGNATURE_OFFSET = Vector(0, 0, 5.75)\n\n-- USE THESE! Positions and offset shifts accounting for the scale of the panel\nlocal startPositions\nlocal cardRowOffset\nlocal cardGroupOffset\nlocal investigatorPositionShiftRow\nlocal investigatorPositionShiftCol\nlocal investigatorCardOffset\nlocal investigatorSignatureOffset\n\nlocal CLASS_LIST = { \"Guardian\", \"Seeker\", \"Rogue\", \"Mystic\", \"Survivor\", \"Neutral\" }\nlocal CYCLE_LIST = {\n \"Core\",\n \"The Dunwich Legacy\",\n \"The Path to Carcosa\",\n \"The Forgotten Age\",\n \"The Circle Undone\",\n \"The Dream-Eaters\",\n \"The Innsmouth Conspiracy\",\n \"Edge of the Earth\",\n \"The Scarlet Keys\",\n \"The Feast of Hemlock Vale\",\n \"Investigator Packs\"\n}\n\nlocal excludedNonBasicWeaknesses\n\nlocal starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY\nlocal helpVisibleToPlayers = { }\n\nfunction onSave()\n local saveState = {\n spawnBagState = spawnBag.getStateForSave(),\n }\n return JSON.encode(saveState)\nend\n\nfunction onLoad(savedData)\n arkhamDb.initialize()\n if (savedData ~= nil) then\n local saveState = JSON.decode(savedData) or { }\n if (saveState.spawnBagState ~= nil) then\n spawnBag.loadFromSave(saveState.spawnBagState)\n end\n end\n buildExcludedWeaknessList()\n createButtons()\nend\n\n-- Build a list of non-basic weaknesses which should be excluded from the last weakness set,\n-- including all signature cards and evolved weaknesses.\nfunction buildExcludedWeaknessList()\n excludedNonBasicWeaknesses = { }\n for _, investigator in pairs(INVESTIGATORS) do\n for _, signatureId in ipairs(investigator.signatures) do\n excludedNonBasicWeaknesses[signatureId] = true\n end\n end\n for _, weaknessId in ipairs(EVOLVED_WEAKNESSES) do\n excludedNonBasicWeaknesses[weaknessId] = true\n end\nend\n\nfunction createButtons()\n createHelpButton()\n createInvestigatorButtons()\n createLevelZeroButtons()\n createUpgradedButtons()\n createWeaknessButtons()\n createOtherButtons()\n createCycleButtons()\n createClearButton()\n -- Create investigator mode buttons last so the indexes are set when we need to update them\n createInvestigatorModeButtons()\nend\n\nfunction createHelpButton()\n self.createButton({\n function_owner = self,\n click_function = \"toggleHelp\",\n position = Vector(0.845, 0.1, -0.855),\n rotation = Vector(0, 0, 0),\n height = 180,\n width = 180,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n })\nend\n\nfunction createInvestigatorButtons()\n local invButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = INVESTIGATOR_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n invButtonParams.click_function = \"spawnInvestigators\" .. class\n invButtonParams.position = buttonPos\n self.createButton(invButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(invButtonParams.click_function, function(_, _, _) spawnInvestigatorGroup(class) end)\n end\nend\n\nfunction createLevelZeroButtons()\n local l0ButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = LEVEL_ZERO_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n l0ButtonParams.click_function = \"spawnBasic\" .. class\n l0ButtonParams.position = buttonPos\n self.createButton(l0ButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(l0ButtonParams.click_function, function(_, _, _) spawnClassCards(class, false) end)\n end\nend\n\nfunction createUpgradedButtons()\n local upgradedButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = UPGRADED_ROW_START:copy()\n for _, class in ipairs(CLASS_LIST) do\n upgradedButtonParams.click_function = \"spawnUpgraded\" .. class\n upgradedButtonParams.position = buttonPos\n self.createButton(upgradedButtonParams)\n buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET\n self.setVar(upgradedButtonParams.click_function, function(_, _, _) spawnClassCards(class, true) end)\n end\nend\n\nfunction createWeaknessButtons()\n local weaknessButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = WEAKNESS_ROW_START:copy()\n weaknessButtonParams.click_function = \"spawnWeaknesses\"\n weaknessButtonParams.tooltip = \"All Weaknesses\"\n weaknessButtonParams.position = buttonPos\n self.createButton(weaknessButtonParams)\n buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET\n weaknessButtonParams.click_function = \"spawnRandomWeakness\"\n weaknessButtonParams.tooltip = \"Random Basic Weakness\"\n weaknessButtonParams.position = buttonPos\n self.createButton(weaknessButtonParams)\nend\n\nfunction createOtherButtons()\n local otherButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CIRCLE_BUTTON_SIZE,\n width = CIRCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = OTHER_ROW_START:copy()\n otherButtonParams.click_function = \"spawnBonded\"\n otherButtonParams.tooltip = \"Bonded Cards\"\n otherButtonParams.position = buttonPos\n self.createButton(otherButtonParams)\n buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET\n otherButtonParams.click_function = \"spawnUpgradeSheets\"\n otherButtonParams.tooltip = \"Customization Upgrade Sheets\"\n otherButtonParams.position = buttonPos\n self.createButton(otherButtonParams)\nend\n\nfunction createCycleButtons()\n local cycleButtonParams = {\n function_owner = self,\n rotation = Vector(0, 0, 0),\n height = CYCLE_BUTTON_SIZE,\n width = CYCLE_BUTTON_SIZE,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n }\n local buttonPos = CYCLE_BUTTON_START:copy()\n local rowCount = 0\n local colCount = 0\n for _, cycle in ipairs(CYCLE_LIST) do\n cycleButtonParams.click_function = \"spawnCycle\" .. cycle\n cycleButtonParams.position = buttonPos\n cycleButtonParams.tooltip = cycle\n self.createButton(cycleButtonParams)\n self.setVar(cycleButtonParams.click_function, function(_, _, _) spawnCycle(cycle) end)\n colCount = colCount + 1\n -- If we've reached the end of a row, shift down and back to the first column\n if colCount \u003e= CYCLE_COLUMN_COUNT then\n buttonPos = CYCLE_BUTTON_START:copy()\n rowCount = rowCount + 1\n colCount = 0\n buttonPos.z = buttonPos.z + CYCLE_BUTTONS_Z_OFFSET * rowCount\n if rowCount == 3 then\n -- Account for two centered buttons on the final row\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET / 2\n --[[ Account for centered button on the final row\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET\n ]]\n end\n else\n buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET\n end\n end\nend\n\nfunction createClearButton()\n self.createButton({\n function_owner = self,\n click_function = \"deleteAll\",\n position = Vector(0, 0.1, 0.852),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 750,\n scale = Vector(0.25, 1, 0.25),\n color = TRANSPARENT,\n })\nend\n\nfunction createInvestigatorModeButtons()\n local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS\n\n self.createButton({\n function_owner = self,\n click_function = \"setCardsOnlyMode\",\n position = Vector(0.251, 0.1, -0.322),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 760,\n scale = Vector(0.25, 1, 0.25),\n color = starterMode and TRANSPARENT or STARTER_DECK_MODE_SELECTED_COLOR\n })\n self.createButton({\n function_owner = self,\n click_function = \"setStarterDeckMode\",\n position = Vector(0.66, 0.1, -0.322),\n rotation = Vector(0, 0, 0),\n height = 170,\n width = 760,\n scale = Vector(0.25, 1, 0.25),\n color = starterMode and STARTER_DECK_MODE_SELECTED_COLOR or TRANSPARENT\n })\n local checkX = starterMode and 0.52 or 0.11\n self.createButton({\n function_owner = self,\n label = \"✓\",\n click_function = \"doNothing\",\n position = Vector(checkX, 0.11, -0.317),\n rotation = Vector(0, 0, 0),\n height = 0,\n width = 0,\n scale = Vector(0.3, 1, 0.3),\n font_color = { 0, 0, 0 },\n color = { 1, 1, 1 }\n })\nend\n\nfunction toggleHelp(_, playerColor, _)\n if helpVisibleToPlayers[playerColor] then\n helpVisibleToPlayers[playerColor] = nil\n else\n helpVisibleToPlayers[playerColor] = true\n end\n updateHelpVisibility()\nend\n\nfunction updateHelpVisibility()\n local visibility = \"\"\n for player, _ in pairs(helpVisibleToPlayers) do\n if string.len(visibility) \u003e 0 then\n visibility = visibility .. \"|\" .. player\n else\n visibility = player\n end\n end\n self.UI.setAttribute(\"helpText\", \"visibility\", visibility)\n self.UI.setAttribute(\"helpPanel\", \"visibility\", visibility)\n self.UI.setAttribute(\"helpPanel\", \"active\", string.len(visibility) \u003e 0)\nend\n\nfunction setStarterDeckMode()\n starterDeckMode = STARTER_DECK_MODE_STARTERS\n updateStarterModeButtons()\nend\n\nfunction setCardsOnlyMode()\n starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY\n updateStarterModeButtons()\nend\n\nfunction updateStarterModeButtons()\n local buttonCount = #self.getButtons()\n -- Buttons are 0-indexed, so the last three are -1, -2, and -3 from the size\n self.removeButton(buttonCount - 1)\n self.removeButton(buttonCount - 2)\n self.removeButton(buttonCount - 3)\n createInvestigatorModeButtons()\nend\n\n-- Clears the table and updates positions based on scale. Should be called before ANY card\n-- placement\nfunction prepareToPlaceCards()\n deleteAll()\n scalePositions()\nend\n\n-- Updates the positions based on the current object scale to ensure the relative layout functions\n-- properly at different scales.\nfunction scalePositions()\n -- Assume scaling is consistent in X and Z dimensions\n local scale = 1 / self.getScale().x\n startPositions = { }\n for key, pos in pairs(START_POSITIONS) do\n -- Because a scaled object means a different global size, using global distance for Z results in\n -- the cards being closer or farther depending on the scale. Leave the Z values and only scale\n -- X and Y\n startPositions[key] = Vector(pos)\n startPositions[key].x = startPositions[key].x * scale\n startPositions[key].y = startPositions[key].y * scale\n end\n cardRowOffset = CARD_ROW_OFFSET * scale\n cardGroupOffset = CARD_GROUP_OFFSET * scale\n investigatorPositionShiftRow = Vector(INVESTIGATOR_POSITION_SHIFT_ROW):scale(scale)\n investigatorPositionShiftCol = Vector(INVESTIGATOR_POSITION_SHIFT_COL):scale(scale)\n investigatorCardOffset = Vector(INVESTIGATOR_CARD_OFFSET):scale(scale)\n investigatorSignatureOffset = Vector(INVESTIGATOR_SIGNATURE_OFFSET):scale(scale)\nend\n\n-- Deletes all cards currently placed on the table\nfunction deleteAll()\n spawnBag.recall(true)\nend\n\n-- Spawn an investigator group, based on the current UI setting for either investigators or starter\n-- decks.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnInvestigatorGroup(groupName)\n local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS\n prepareToPlaceCards()\n Wait.frames(function()\n if starterMode then\n spawnStarters(groupName)\n else\n spawnInvestigators(groupName)\n end\n end, 2)\nend\n\n-- Spawn cards for all investigators in the given group. This creates piles for all defined\n-- investigator cards and minicards as well as the signature cards.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnInvestigators(groupName)\n if INVESTIGATOR_GROUPS[groupName] == nil then\n printToAll(\"No \" .. groupName .. \" data yet\")\n return\n end\n\n local col = 1\n local row = 1\n local investigatorCount = #INVESTIGATOR_GROUPS[groupName]\n local position = getInvestigatorRowStartPos(investigatorCount, row)\n\n for i, investigatorName in ipairs(INVESTIGATOR_GROUPS[groupName]) do\n for _, spawnSpec in ipairs(buildInvestigatorSpawnSpec(investigatorName, INVESTIGATORS[investigatorName], position)) do\n spawnBag.spawn(spawnSpec)\n end\n position:add(investigatorPositionShiftCol)\n col = col + 1\n if col \u003e INVESTIGATOR_MAX_COLS then\n col = 1\n row = row + 1\n position = getInvestigatorRowStartPos(investigatorCount, row)\n end\n end\nend\n\nfunction getInvestigatorRowStartPos(investigatorCount, row)\n local rowStart = Vector(startPositions.investigator)\n rowStart:add(Vector(\n investigatorPositionShiftRow.x * (row - 1),\n investigatorPositionShiftRow.y * (row - 1),\n investigatorPositionShiftRow.z * (row - 1)))\n local investigatorsInRow =\n math.min(investigatorCount - INVESTIGATOR_MAX_COLS * (row - 1), INVESTIGATOR_MAX_COLS)\n rowStart:add(Vector(\n investigatorPositionShiftCol.x * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2,\n investigatorPositionShiftCol.y * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2,\n investigatorPositionShiftCol.z * (INVESTIGATOR_MAX_COLS - investigatorsInRow) / 2))\n\n return rowStart\nend\n\n-- Creates the spawn spec for the investigator's signature cards.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\n---@param investigatorData Table. Spawn definition for the investigator, retrieved from\n--- INVESTIGATORS\n---@param position Vector. Where to spawn the minicard; investigagor cards will be placed below\nfunction buildInvestigatorSpawnSpec(investigatorName, investigatorData, position)\n local sigPos = Vector(position):add(investigatorSignatureOffset)\n local spawns = buildCommonSpawnSpec(investigatorName, investigatorData, position)\n table.insert(spawns, {\n name = investigatorName..\"signatures\",\n cards = investigatorData.signatures,\n globalPos = self.positionToWorld(sigPos),\n rotation = FACE_UP_ROTATION,\n })\n\n return spawns\nend\n\n-- Builds the spawn specs for minicards and investigator cards. These are common enough to be\n-- shared, and will only differ in whether they spawn the full stack of possible investigator and\n-- minicards, or only the first of each.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\n---@param investigatorData Table. Spawn definition for the investigator, retrieved from\n--- INVESTIGATORS\n---@param position Vector. Where to spawn the minicard; investigagor cards will be placed below\n---@param oneCardOnly Boolean. If true, will spawn only the first card in the investigator card\n--- and minicard lists. Otherwise, spawn them all in a deck\nfunction buildCommonSpawnSpec(investigatorName, investigatorData, position, oneCardOnly)\n local cardPos = Vector(position):add(investigatorCardOffset)\n return {\n {\n name = investigatorName..\"minicards\",\n cards = oneCardOnly and { investigatorData.minicards[1] } or investigatorData.minicards,\n globalPos = self.positionToWorld(position),\n rotation = FACE_UP_ROTATION,\n },\n {\n name = investigatorName..\"cards\",\n cards = oneCardOnly and { investigatorData.cards[1] } or investigatorData.cards,\n globalPos = self.positionToWorld(cardPos),\n rotation = FACE_UP_ROTATION,\n },\n }\nend\n\n-- Spawns all starter decks (single minicard and investigator card, plus the starter deck) for\n-- investigators in the given group.\n---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData\nfunction spawnStarters(groupName)\n local col = 1\n local row = 1\n local investigatorCount = #INVESTIGATOR_GROUPS[groupName]\n local position = getInvestigatorRowStartPos(investigatorCount, row)\n for _, investigatorName in ipairs(INVESTIGATOR_GROUPS[groupName]) do\n spawnStarterDeck(investigatorName, INVESTIGATORS[investigatorName], position)\n position:add(investigatorPositionShiftCol)\n col = col + 1\n if col \u003e INVESTIGATOR_MAX_COLS then\n col = 1\n row = row + 1\n position = getInvestigatorRowStartPos(investigatorCount, row)\n end\n end\nend\n\n-- Spawns the defined starter deck for the given investigator's.\n---@param investigatorName String. Name of the investigator, matching a key in\n--- InvestigatorPanelData\nfunction spawnStarterDeck(investigatorName, investigatorData, position)\n for _, spawnSpec in ipairs(\n buildCommonSpawnSpec(investigatorName, INVESTIGATORS[investigatorName], position, true)) do\n spawnBag.spawn(spawnSpec)\n end\n local deckPos = Vector(position):add(investigatorSignatureOffset)\n arkhamDb.getDecklist(\"None\", investigatorData.starterDeck, true, false, false, function(slots)\n local cardIdList = { }\n for id, count in pairs(slots) do\n for i = 1, count do\n table.insert(cardIdList, id)\n end\n end\n spawnBag.spawn({\n name = investigatorName..\"starter\",\n cards = cardIdList,\n globalPos = self.positionToWorld(deckPos),\n rotation = FACE_DOWN_ROTATION\n })\n end)\nend\n-- Clears the currently placed cards, then places cards for the given class and level spread\n---@param cardClass String. Class to place (\"Guardian\", \"Seeker\", etc)\n---@param isUpgraded Boolean. If true, spawn the Level 1-5 cards. Otherwise, Level 0.\nfunction spawnClassCards(cardClass, isUpgraded)\n prepareToPlaceCards()\n Wait.frames(function() placeClassCards(cardClass, isUpgraded) end, 2)\nend\n\n-- Spawn the class cards.\n---@param cardClass String. Class to place (\"Guardian\", \"Seeker\", etc)\n---@param isUpgraded Boolean. If true, spawn the Level 1-5 cards. Otherwise, Level 0.\nfunction placeClassCards(cardClass, isUpgraded)\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local cardIdList = allCardsBagApi.getCardsByClassAndLevel(cardClass, isUpgraded)\n\n local skillList = { }\n local eventList = { }\n local assetList = { }\n for _, cardId in ipairs(cardIdList) do\n local cardMetadata = allCardsBagApi.getCardById(cardId).metadata\n if (cardMetadata.type == \"Skill\") then\n table.insert(skillList, cardId)\n elseif (cardMetadata.type == \"Event\") then\n table.insert(eventList, cardId)\n elseif (cardMetadata.type == \"Asset\") then\n table.insert(assetList, cardId)\n end\n end\n local groupPos = Vector(startPositions.classCards)\n if #skillList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = skillList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#skillList / 20) * cardRowOffset + cardGroupOffset\n end\n if #eventList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. \"event\" .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = eventList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#eventList / 20) * cardRowOffset + cardGroupOffset\n end\n if #assetList \u003e 0 then\n spawnBag.spawn({\n name = cardClass .. \"asset\" .. (isUpgraded and \"upgraded\" or \"basic\"),\n cards = assetList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n end\nend\n\n-- Spawns the investigator sets and all cards for the given cycle\n---@param cycle String Name of a cycle, should match the standard used in card metadata\nfunction spawnCycle(cycle)\n prepareToPlaceCards()\n spawnInvestigators(cycle)\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local cycleCardList = allCardsBagApi.getCardsByCycle(cycle)\n local copiedList = { }\n for i, id in ipairs(cycleCardList) do\n copiedList[i] = id\n end\n spawnBag.spawn({\n name = \"cycle\"..cycle,\n cards = copiedList,\n globalPos = self.positionToWorld(startPositions.cycle),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnBonded()\n prepareToPlaceCards()\n spawnBag.spawn({\n name = \"bonded\",\n cards = BONDED_CARD_LIST,\n globalPos = self.positionToWorld(startPositions.classCards),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnUpgradeSheets()\n prepareToPlaceCards()\n spawnBag.spawn({\n name = \"upgradeSheets\",\n cards = UPGRADE_SHEET_LIST,\n globalPos = self.positionToWorld(startPositions.classCards),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n spawnBag.spawn({\n name = \"servitor\",\n cards = { \"09080-m\" },\n globalPos = self.positionToWorld(startPositions.summonedServitor),\n rotation = FACE_UP_ROTATION,\n })\nend\n\n-- Clears the current cards, and places all basic weaknesses on the table.\nfunction spawnWeaknesses()\n prepareToPlaceCards()\n local indexReady = allCardsBagApi.isIndexReady()\n if (not indexReady) then\n broadcastToAll(\"Still loading player cards, please try again in a few seconds\", {0.9, 0.2, 0.2})\n return\n end\n local weaknessIdList = allCardsBagApi.getUniqueWeaknesses()\n local basicWeaknessList = { }\n local otherWeaknessList = { }\n for i, id in ipairs(weaknessIdList) do\n local cardMetadata = allCardsBagApi.getCardById(id).metadata\n if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount \u003e 0 then\n table.insert(basicWeaknessList, id)\n elseif excludedNonBasicWeaknesses[id] == nil then\n table.insert(otherWeaknessList, id)\n end\n end\n local groupPos = Vector(startPositions.classCards)\n spawnBag.spawn({\n name = \"basicWeaknesses\",\n cards = basicWeaknessList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#basicWeaknessList / 20) * cardRowOffset + cardGroupOffset\n spawnBag.spawn({\n name = \"evolvedWeaknesses\",\n cards = EVOLVED_WEAKNESSES,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\n groupPos.z = groupPos.z + math.ceil(#EVOLVED_WEAKNESSES / 20) * cardRowOffset + cardGroupOffset\n spawnBag.spawn({\n name = \"otherWeaknesses\",\n cards = otherWeaknessList,\n globalPos = self.positionToWorld(groupPos),\n rotation = FACE_UP_ROTATION,\n spread = true,\n spreadCols = 20\n })\nend\n\nfunction spawnRandomWeakness()\n prepareToPlaceCards()\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n if (weaknessId == nil) then\n broadcastToAll(\"All basic weaknesses are in play!\", {0.9, 0.2, 0.2})\n return\n end\n spawnBag.spawn({\n name = \"randomWeakness\",\n cards = { weaknessId },\n globalPos = self.positionToWorld(startPositions.randomWeakness),\n rotation = FACE_UP_ROTATION,\n })\nend\nend)\n__bundle_register(\"arkhamdb/ArkhamDb\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local allCardsBagApi = require(\"playercards/AllCardsBagApi\")\n local playAreaApi = require(\"core/PlayAreaApi\")\n \n local ArkhamDb = { }\n local internal = { }\n\n local RANDOM_WEAKNESS_ID = \"01000\"\n\n local tabooList = { }\n --Forward declaration\n ---@type Request\n local Request = {}\n local configuration\n\n -- Sets up the ArkhamDb interface. Should be called from the parent object on load.\n ArkhamDb.initialize = function()\n configuration = internal.getConfiguration()\n Request.start({ configuration.api_uri, configuration.taboo }, function(status)\n local json = JSON.decode(internal.fixUtf16String(status.text))\n for _, taboo in pairs(json) do\n ---@type \u003cstring, boolean\u003e\n local cards = {}\n\n for _, card in pairs(JSON.decode(taboo.cards)) do\n cards[card.code] = true\n end\n\n tabooList[taboo.id] = {\n date = taboo.date_start,\n cards = cards\n }\n end\n return true, nil\n end)\n end\n\n -- Start the deck build process for the given player color and deck ID. This\n -- will retrieve the deck from ArkhamDB, and pass to a callback for processing.\n ---@param playerColor String. Color name of the player mat to place this deck on (e.g. \"Red\").\n ---@param deckId String. ArkhamDB deck id to be loaded\n ---@param isPrivate Boolean. Whether this deck is published or private on ArkhamDB\n ---@param loadNewest Boolean. Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean. Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function. Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n ArkhamDb.getDecklist = function(\n playerColor,\n deckId,\n isPrivate,\n loadNewest,\n loadInvestigators,\n callback)\n -- Get a simple card to see if the bag indexes are complete. If not, abort\n -- the deck load. The called method will handle player notification.\n local checkCard = allCardsBagApi.getCardById(\"01001\")\n if (checkCard ~= nil and checkCard.data == nil) then\n return\n end\n\n local deckUri = { configuration.api_uri,\n isPrivate and configuration.private_deck or configuration.public_deck, deckId }\n\n local deck = Request.start(deckUri, function(status)\n if string.find(status.text, \"\u003c!DOCTYPE html\u003e\") then\n internal.maybePrint(\"Private deck ID \" .. deckId .. \" is not shared\", playerColor)\n return false, table.concat({ \"Private deck \", deckId, \" is not shared\" })\n end\n local json = JSON.decode(status.text)\n\n if not json then\n internal.maybePrint(\"Deck ID \" .. deckId .. \" not found\", playerColor)\n return false, \"Deck not found!\"\n end\n\n return true, json\n end)\n\n deck:with(internal.onDeckResult, playerColor, loadNewest, loadInvestigators, callback)\n end\n\n -- Logs that a card could not be loaded in the mod by printing it to the console in the given\n -- color of the player owning the deck. Attempts to look up the name on ArkhamDB for clarity,\n -- but prints the card ID if the name cannot be retrieved.\n ---@param cardId String. ArkhamDB ID of the card that could not be found\n ---@param playerColor String. Color of the player's deck that had the problem\n ArkhamDb.logCardNotFound = function(cardId, playerColor)\n local request = Request.start({\n configuration.api_uri,\n configuration.cards,\n cardId\n },\n function(result)\n local adbCardInfo = JSON.decode(internal.fixUtf16String(result.text))\n local cardName = adbCardInfo.real_name\n if (cardName ~= nil) then\n if (adbCardInfo.xp ~= nil and adbCardInfo.xp \u003e 0) then\n cardName = cardName .. \" (\" .. adbCardInfo.xp .. \")\"\n end\n internal.maybePrint(\"Card not found: \" .. cardName .. \", ArkhamDB ID \" .. cardId, playerColor)\n else\n internal.maybePrint(\"Card not found in ArkhamDB, ID \" .. cardId, playerColor)\n end\n end)\n end\n\n -- Callback when the deck information is received from ArkhamDB. Parses the\n -- response then applies standard transformations to the deck such as adding\n -- random weaknesses and checking for taboos. Once the deck is processed,\n -- passes to loadCards to actually spawn the defined deck.\n ---@param deck ArkhamImportDeck\n ---@param playerColor String Color name of the player mat to place this deck on (e.g. \"Red\")\n ---@param loadNewest Boolean Whether the newest version of this deck should be loaded\n ---@param loadInvestigators Boolean Whether investigator cards should be loaded as part of this\n --- deck\n ---@param callback Function Callback which will be sent the results of this load. Parameters\n --- to the callback will be:\n --- slots Table. A map of card ID to count in the deck\n --- investigatorCode String. ID of the investigator in this deck\n --- bondedList A table of cardID keys to meaningless values. Card IDs in this list were\n --- added from a parent bonded card.\n --- customizations Table. The decoded table of customization upgrades in this deck\n --- playerColor String. Color this deck is being loaded for\n internal.onDeckResult = function(deck, playerColor, loadNewest, loadInvestigators, callback)\n -- Load the next deck in the upgrade path if the option is enabled\n if (loadNewest and deck.next_deck ~= nil and deck.next_deck ~= \"\") then\n buildDeck(playerColor, deck.next_deck)\n return\n end\n\n internal.maybePrint(table.concat({ \"Found decklist: \", deck.name }), playerColor)\n\n -- Initialize deck slot table and perform common transformations. The order of these should not\n -- be changed, as later steps may act on cards added in each. For example, a random weakness or\n -- investigator may have bonded cards or taboo entries, and should be present\n local slots = deck.slots\n internal.maybeDrawRandomWeakness(slots, playerColor)\n local loadAltInvestigator = \"normal\"\n if loadInvestigators then\n loadAltInvestigator = internal.addInvestigatorCards(deck, slots)\n end\n \n internal.maybeModifyDeckFromDescription(slots, deck.description_md)\n internal.maybeAddSummonedServitor(slots)\n internal.maybeAddOnTheMend(slots, playerColor)\n internal.maybeAddRealityAcidReference(slots)\n local bondList = internal.extractBondedCards(slots)\n internal.checkTaboos(deck.taboo_id, slots, playerColor)\n internal.maybeAddUpgradeSheets(slots)\n\n -- get upgrades for customizable cards\n local customizations = {}\n if deck.meta then\n customizations = JSON.decode(deck.meta)\n end\n\n callback(slots, deck.investigator_code, bondList, customizations, playerColor, loadAltInvestigator)\n end\n\n -- Checks to see if the slot list includes the random weakness ID. If it does,\n -- removes it from the deck and replaces it with the ID of a random basic weakness provided by the\n -- all cards bag\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n --- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast\n --- if a weakness is added.\n internal.maybeDrawRandomWeakness = function(slots, playerColor)\n local randomWeaknessAmount = slots[RANDOM_WEAKNESS_ID] or 0\n slots[RANDOM_WEAKNESS_ID] = nil\n\n if randomWeaknessAmount ~= 0 then\n for i=1, randomWeaknessAmount do\n local weaknessId = allCardsBagApi.getRandomWeaknessId()\n slots[weaknessId] = (slots[weaknessId] or 0) + 1\n end\n internal.maybePrint(\"Added \" .. randomWeaknessAmount .. \" random basic weakness(es) to deck\", playerColor)\n end\n end\n\n -- Adds both the investigator (XXXXX) and minicard (XXXXX-m) slots with one copy each\n ---@param deck Table The processed ArkhamDB deck response\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the\n --- number of those cards which will be spawned\n ---@return string: Contains the name of the art that should be loaded (\"normal\", \"promo\" or \"revised\")\n internal.addInvestigatorCards = function(deck, slots)\n local investigatorId = deck.investigator_code\n slots[investigatorId .. \"-m\"] = 1\n local deckMeta = JSON.decode(deck.meta)\n -- handling alternative investigator art and parallel investigators\n local loadAltInvestigator = \"normal\"\n if deckMeta ~= nil then\n local altFrontId = tonumber(deckMeta.alternate_front) or 0\n local altBackId = tonumber(deckMeta.alternate_back) or 0\n local altArt = { front = \"normal\", back = \"normal\" }\n\n -- translating front ID\n if altFrontId \u003e 90000 and altFrontId \u003c 90100 then\n altArt.front = \"parallel\"\n elseif altFrontId \u003e 01500 and altFrontId \u003c 01506 then\n altArt.front = \"revised\"\n elseif altFrontId \u003e 98000 then\n altArt.front = \"promo\"\n end\n\n -- translating back ID\n if altBackId \u003e 90000 and altBackId \u003c 90100 then\n altArt.back = \"parallel\"\n elseif altBackId \u003e 01500 and altBackId \u003c 01506 then\n altArt.back = \"revised\"\n elseif altBackId \u003e 98000 then\n altArt.back = \"promo\"\n end\n\n -- updating investigatorID based on alt investigator selection\n -- precedence: parallel \u003e promo \u003e revised\n if altArt.front == \"parallel\" then\n if altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-p\"\n else\n investigatorId = investigatorId .. \"-pf\"\n end\n elseif altArt.back == \"parallel\" then\n investigatorId = investigatorId .. \"-pb\"\n elseif altArt.front == \"promo\" or altArt.back == \"promo\" then\n loadAltInvestigator = \"promo\"\n elseif altArt.front == \"revised\" or altArt.back == \"revised\" then\n loadAltInvestigator = \"revised\"\n end\n end\n slots[investigatorId] = 1\n deck.investigator_code = investigatorId\n return loadAltInvestigator\n end\n\n -- Process the card list looking for the customizable cards, and add their upgrade sheets if needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddUpgradeSheets = function(slots)\n for cardId, _ in pairs(slots) do\n -- upgrade sheets for customizable cards\n local upgradesheet = allCardsBagApi.getCardById(cardId .. \"-c\")\n if upgradesheet ~= nil then\n slots[cardId .. \"-c\"] = 1\n end\n end\n end\n\n -- Process the card list looking for the Summoned Servitor, and add its minicard to the list if\n -- needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddSummonedServitor = function(slots)\n if slots[\"09080\"] ~= nil then\n slots[\"09080-m\"] = 1\n end\n end\n\n -- On the Mend should have 1-per-investigator copies set aside, but ArkhamDB always sends 1. Update\n -- the count based on the investigator count\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast if an error occurs\n internal.maybeAddOnTheMend = function(slots, playerColor)\n if slots[\"09006\"] ~= nil then\n local investigatorCount = playAreaApi.getInvestigatorCount()\n if investigatorCount ~= nil then\n slots[\"09006\"] = investigatorCount\n else\n internal.maybePrint(\"Something went wrong with the load, adding 4 copies of On the Mend\", playerColor)\n slots[\"09006\"] = 4\n end\n end\n end\n\n -- Process the card list looking for Reality Acid and adds the reference sheet when needed\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n -- of those cards which will be spawned\n internal.maybeAddRealityAcidReference = function(slots)\n if slots[\"89004\"] ~= nil then\n slots[\"89005\"] = 1\n end\n end\n\n -- Processes the deck description from ArkhamDB and modifies the slot list accordingly\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number\n ---@param description String The deck desription from ArkhamDB\n internal.maybeModifyDeckFromDescription = function(slots, description)\n -- check for import instructions\n local pos = string.find(description, \"++SCED import instructions++\")\n if not pos then return end\n\n -- remove everything before instructions (including newline)\n local tempStr = string.sub(description, pos + 30)\n \n -- parse each line in instructions\n for line in tempStr:gmatch(\"([^\\n]+)\") do\n -- remove dashes at the start\n line = line:gsub(\"%- \", \"\")\n\n -- remove spaces\n line = line:gsub(\"%s\", \"\")\n\n -- get instructor\n local instructor = \"\"\n for word in line:gmatch(\"%a+:\") do\n instructor = word\n break\n end\n\n if instructor == \"\" or (instructor ~= \"add:\" and instructor ~= \"remove:\") then return end\n\n -- remove instructor from line\n line = line:gsub(instructor, \"\")\n\n -- evaluate instructions\n local cardIds = {}\n for str in line:gmatch(\"([^,]+)\") do\n if instructor == \"add:\" then\n slots[str] = (slots[str] or 0) + 1\n elseif instructor == \"remove:\" then\n if slots[str] == nil then break end\n slots[str] = math.max(slots[str] - 1, 0)\n end\n end\n end\n end\n\n -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list.\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.extractBondedCards = function(slots)\n -- Create a list of bonded cards first so we don't modify slots while iterating\n local bondedCards = { }\n local bondedList = { }\n for cardId, cardCount in pairs(slots) do\n local card = allCardsBagApi.getCardById(cardId)\n if (card ~= nil and card.metadata.bonded ~= nil) then\n for _, bond in ipairs(card.metadata.bonded) do\n -- add a bonded card for each copy of the parent card (except for Pendant of the Queen)\n if bond.id == \"06022\" then\n bondedCards[bond.id] = bond.count\n else\n bondedCards[bond.id] = bond.count * cardCount\n end\n -- We need to know which cards are bonded to determine their position, remember them\n bondedList[bond.id] = true\n -- Also adding taboo versions of bonded cards to the list\n bondedList[bond.id .. \"-t\"] = true\n end\n end\n end\n -- Add any bonded cards to the main slots list\n for bondedId, bondedCount in pairs(bondedCards) do\n slots[bondedId] = bondedCount\n end\n\n return bondedList\n end\n\n -- Check the deck for cards on its taboo list. If they're found, replace the entry in the slot with the Taboo id (i.e. \"XXXX\" becomes \"XXXX-t\")\n ---@param tabooId String The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used\n ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned\n internal.checkTaboos = function(tabooId, slots, playerColor)\n if tabooId then\n for cardId, _ in pairs(tabooList[tabooId].cards) do\n if slots[cardId] ~= nil then\n -- Make sure there's a taboo version of the card before we replace it\n -- SCED only maintains the most recent taboo cards. If a deck is using\n -- an older taboo list it's possible the card isn't a taboo any more\n local tabooCard = allCardsBagApi.getCardById(cardId .. \"-t\")\n if tabooCard == nil then\n local basicCard = allCardsBagApi.getCardById(cardId)\n internal.maybePrint(\"Taboo version for \" .. basicCard.data.Nickname .. \" is not available. Using standard version\", playerColor)\n else\n slots[cardId .. \"-t\"] = slots[cardId]\n slots[cardId] = nil\n end\n end\n end\n end\n end\n\n internal.maybePrint = function(message, playerColor)\n if playerColor ~= \"None\" then\n printToAll(message, playerColor)\n end\n end\n\n -- Gets the ArkhamDB config info from the configuration object.\n ---@return Table. Configuration data\n internal.getConfiguration = function()\n local configuration = getObjectsWithTag(\"import_configuration_provider\")[1]:getTable(\"configuration\")\n printPriority = configuration.priority\n return configuration\n end\n\n internal.fixUtf16String = function(str)\n return str:gsub(\"\\\\u(%w%w%w%w)\", function(match)\n return string.char(tonumber(match, 16))\n end)\n end\n\n ---@type Request\n Request = {\n is_done = false,\n is_successful = false\n }\n\n -- Creates a new instance of a Request. Should not be directly called. Instead use Request.start and Request.deferred.\n ---@param uri string\n ---@param configure fun(request: Request, status: WebRequestStatus)\n ---@return Request\n function Request:new(uri, configure)\n local this = {}\n\n setmetatable(this, self)\n self.__index = self\n\n if type(uri) == \"table\" then\n uri = table.concat(uri, \"/\")\n end\n\n this.uri = uri\n\n WebRequest.get(uri, function(status)\n configure(this, status)\n end)\n\n return this\n end\n\n -- Creates a new request. on_success should set the request's is_done, is_successful, and content variables.\n -- Deferred should be used when you don't want to set is_done immediately (such as if you want to wait for another request to finish)\n ---@param uri string\n ---@param on_success fun(request: Request, status: WebRequestStatus, vararg any)\n ---@param on_error fun(status: WebRequestStatus)|nil\n ---@vararg any[]\n ---@return Request\n function Request.deferred(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request:new(uri, function(request, status)\n if (status.is_done) then\n if (status.is_error) then\n request.error_message = on_error and on_error(status, table.unpack(parameters)) or status.error\n request.is_successful = false\n request.is_done = true\n else\n on_success(request, status)\n end\n end\n end)\n end\n\n -- Creates a new request. on_success should return weather the resultant data is as expected, and the processed content of the request.\n ---@param uri string\n ---@param on_success fun(status: WebRequestStatus, vararg any): boolean, any\n ---@param on_error nil|fun(status: WebRequestStatus, vararg any): string\n ---@vararg any[]\n ---@return Request\n function Request.start(uri, on_success, on_error, ...)\n local parameters = table.pack(...)\n return Request.deferred(uri, function(request, status)\n local result, message = on_success(status, table.unpack(parameters))\n if not result then request.error_message = message else request.content = message end\n request.is_successful = result\n request.is_done = true\n end, on_error, table.unpack(parameters))\n end\n\n ---@param requests Request[]\n ---@param on_success fun(content: any[], vararg any[])\n ---@param on_error fun(requests: Request[], vararg any[])|nil\n ---@vararg any\n function Request.with_all(requests, on_success, on_error, ...)\n local parameters = table.pack(...)\n\n Wait.condition(function()\n ---@type any[]\n local results = {}\n\n ---@type Request[]\n local errors = {}\n\n for _, request in ipairs(requests) do\n if request.is_successful then\n table.insert(results, request.content)\n else\n table.insert(errors, request)\n end\n end\n\n if (#errors \u003c= 0) then\n on_success(results, table.unpack(parameters))\n elseif on_error == nil then\n for _, request in ipairs(errors) do\n internal.maybePrint(table.concat({ \"[ERROR]\", request.uri, \":\", request.error_message }))\n end\n else\n on_error(requests, table.unpack(parameters))\n end\n end, function()\n for _, request in ipairs(requests) do\n if not request.is_done then return false end\n end\n return true\n end)\n end\n\n ---@param callback fun(content: any, vararg any)\n function Request:with(callback, ...)\n local arguments = table.pack(...)\n Wait.condition(function()\n if self.is_successful then\n callback(self.content, table.unpack(arguments))\n end\n end, function() return self.is_done\n end)\n end\n\n return ArkhamDb\nend\nend)\n__bundle_register(\"playercards/AllCardsBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local AllCardsBagApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getAllCardsBag()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AllCardsBag\")\n end\n\n -- Returns a specific card from the bag, based on ArkhamDB ID\n ---@param id table String ID of the card to retrieve\n ---@return table table\n -- If the indexes are still being constructed, an empty table is\n -- returned. Otherwise, a single table with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardById = function(id)\n return getAllCardsBag().call(\"getCardById\", {id = id})\n end\n\n -- Gets a random basic weakness from the bag. Once a given ID has been returned\n -- it will be removed from the list and cannot be selected again until a reload\n -- occurs or the indexes are rebuilt, which will refresh the list to include all\n -- weaknesses.\n ---@return id String ID of the selected weakness.\n AllCardsBagApi.getRandomWeaknessId = function()\n return getAllCardsBag().call(\"getRandomWeaknessId\")\n end\n\n AllCardsBagApi.isIndexReady = function()\n return getAllCardsBag().call(\"isIndexReady\")\n end\n\n -- Called by Hotfix bags when they load. If we are still loading indexes, then\n -- the all cards and hotfix bags are being loaded together, and we can ignore\n -- this call as the hotfix will be included in the initial indexing. If it is\n -- called once indexing is complete it means the hotfix bag has been added\n -- later, and we should rebuild the index to integrate the hotfix bag.\n AllCardsBagApi.rebuildIndexForHotfix = function()\n return getAllCardsBag().call(\"rebuildIndexForHotfix\")\n end\n\n -- Searches the bag for cards which match the given name and returns a list. Note that this is\n -- an O(n) search without index support. It may be slow.\n ---@param name String or string fragment to search for names\n ---@param exact Boolean Whether the name match should be exact\n AllCardsBagApi.getCardsByName = function(name, exact)\n return getAllCardsBag().call(\"getCardsByName\", {name = name, exact = exact})\n end\n\n AllCardsBagApi.isBagPresent = function()\n return getAllCardsBag() and true\n end\n\n -- Returns a list of cards from the bag matching a class and level (0 or upgraded)\n ---@param class String class to retrieve (\"Guardian\", \"Seeker\", etc)\n ---@param upgraded Boolean true for upgraded cards (Level 1-5), false for Level 0\n ---@return: If the indexes are still being constructed, returns an empty table.\n -- Otherwise, a list of tables, each with the following fields\n -- cardData: TTS object data, suitable for spawning the card\n -- cardMetadata: Table of parsed metadata\n AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded)\n return getAllCardsBag().call(\"getCardsByClassAndLevel\", {class = class, upgraded = upgraded})\n end\n\n AllCardsBagApi.getCardsByCycle = function(cycle)\n return getAllCardsBag().call(\"getCardsByCycle\", cycle)\n end\n\n AllCardsBagApi.getUniqueWeaknesses = function()\n return getAllCardsBag().call(\"getUniqueWeaknesses\")\n end\n\n return AllCardsBagApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardPanelData\", function(require, _LOADED, __bundle_register, __bundle_modules)\nBONDED_CARD_LIST = {\n\t\"05314\", -- Soothing Melody\n\t\"06277\", -- Wish Eater\n\t\"06019\", -- Bloodlust\n\t\"06022\", -- Pendant of the Queen\n\t\"05317\", -- Blood-rite\n\t\"06113\", -- Essence of the Dream\n\t\"06028\", -- Stars Are Right\n\t\"06025\", -- Guardian of the Crystallizer\n\t\"06283\", -- Unbound Beast\n\t\"06032\", -- Zeal\n\t\"06031\", -- Hope\n\t\"06033\", -- Augur\n\t\"06331\", -- Dream Parasite\n\t\"06015a\", -- Dream-Gate\n\t\"10006\",\t\t-- Aetheric Current (Yuggoth)\n\t\"10007\",\t\t-- Aetheric Current (Yoth)\n\t\"10045\" -- Uncanny Growth\n}\n\nUPGRADE_SHEET_LIST = {\n\t\"09040-c\", -- Alchemical Distillation\n\t\"09023-c\", -- Custom Modifications\n\t\"09059-c\", -- Damning Testimony\n\t\"09041-c\", -- Emperical Hypothesis\n\t\"09060-c\", -- Friends in Low Places\n\t\"09101-c\", -- Grizzled\n\t\"09061-c\", -- Honed Instinct\n\t\"09021-c\", -- Hunter's Armor\n\t\"09119-c\", -- Hyperphysical Shotcaster\n\t\"09079-c\", -- Living Ink\n\t\"09100-c\", -- Makeshift Trap\n\t\"09099-c\", -- Pocket Multi Tool\n\t\"09081-c\", -- Power Word\n\t\"09081-t-c\", -- Power Word (Taboo)\n\t\"09022-c\", -- Runic Axe\n\t\"09022-t-c\", -- Runic Axe (Taboo)\n\t\"09080-c\", -- Summoned Servitor\n\t\"09042-c\", -- Raven's Quill\n}\n\nEVOLVED_WEAKNESSES = {\n\t\"04039\",\n\t\"04041\",\n\t\"04042\",\n\t\"53014\",\n\t\"53015\",\n}\n\n------------------ START INVESTIGATOR DATA DEFINITION ------------------\nINVESTIGATOR_GROUPS = {\n [\"Guardian\"] = {\n \"Roland Banks\",\n \t\"Zoey Samaras\",\n \t\"Mark Harrigan\",\n \t\"Leo Anderson\",\n \t\"Carolyn Fern\",\n \t\"Tommy Muldoon\",\n \t\"Nathaniel Cho\",\n \t\"Sister Mary\",\n \t\"Daniela Reyes\",\n \t\"Carson Sinclair\",\n\t\t\"Wilson Richards\"\n },\n [\"Seeker\"] = {\n \"Daisy Walker\",\n \t\"Rex Murphy\",\n \t\"Minh Thi Phan\",\n \t\"Ursula Downs\",\n \t\"Joe Diamond\",\n \t\"Mandy Thompson\",\n \t\"Harvey Walters\",\n \t\"Amanda Sharpe\",\n \t\"Norman Withers\",\n \t\"Vincent Lee\",\n\t\t\"Kate Winthrop\"\n },\n [\"Rogue\"] = {\n \t\"\\\"Skids\\\" O'Toole\",\n \t\"Jenny Barnes\",\n \t\"Sefina Rousseau\",\n \t\"Finn Edwards\",\n \t\"Preston Fairmont\",\n \t\"Tony Morgan\",\n \t\"Winifred Habbamock\",\n \t\"Trish Scarborough\",\n \t\"Monterey Jack\",\n \t\"Kymani Jones\",\n\t\t\"Alessandra Zorzi\"\n },\n [\"Mystic\"] = {\n \t\"Agnes Baker\",\n \t\"Jim Culver\",\n \t\"Akachi Onyele\",\n \t\"Father Mateo\",\n \t\"Diana Stanley\",\n \t\"Marie Lambeau\",\n \t\"Luke Robinson\",\n \t\"Jacqueline Fine\",\n \t\"Dexter Drake\",\n \t\"Lily Chen\",\n \t\"Amina Zidane\",\n \t\"Gloria Goldberg\",\n\t\t\"Kōhaku Narukami\"\n },\n [\"Survivor\"] = {\n \t\"Wendy Adams\",\n \t\"\\\"Ashcan\\\" Pete\",\n \t\"William Yorick\",\n \t\"Calvin Wright\",\n \t\"Rita Young\",\n \t\"Patrice Hathaway\",\n \t\"Stella Clark\",\n \t\"Silas Marsh\",\n \t\"Bob Jenkins\",\n \t\"Darrell Simmons\",\n\t\t\"Hank Samson\"\n },\n [\"Neutral\"] = {\n \t\"Lola Hayes\",\n \t\"Charlie Kane\",\n \t\"Subject 5U-21\"\n },\n [\"Core\"] = {\n \"Roland Banks\",\n \"Daisy Walker\",\n \"\\\"Skids\\\" O'Toole\",\n \"Agnes Baker\",\n \"Wendy Adams\"\n },\n [\"The Dunwich Legacy\"] = {\n \t\"Zoey Samaras\",\n \t\"Rex Murphy\",\n \t\"Jenny Barnes\",\n \t\"Jim Culver\",\n \t\"\\\"Ashcan\\\" Pete\"\n },\n [\"The Path to Carcosa\"] = {\n \t\"Mark Harrigan\",\n \t\"Minh Thi Phan\",\n \t\"Sefina Rousseau\",\n \t\"Akachi Onyele\",\n \t\"William Yorick\",\n \t\"Lola Hayes\"\n },\n [\"The Forgotten Age\"] = {\n \t\"Leo Anderson\",\n \t\"Ursula Downs\",\n \t\"Finn Edwards\",\n \t\"Father Mateo\",\n \t\"Calvin Wright\"\n },\n [\"The Circle Undone\"] = {\n \t\"Carolyn Fern\",\n \t\"Joe Diamond\",\n \t\"Preston Fairmont\",\n \t\"Diana Stanley\",\n \t\"Rita Young\",\n \t\"Marie Lambeau\"\n },\n [\"The Dream-Eaters\"] = {\n \t\"Tommy Muldoon\",\n \t\"Mandy Thompson\",\n \t\"Tony Morgan\",\n \t\"Luke Robinson\",\n \t\"Patrice Hathaway\"\n },\n [\"Investigator Packs\"] = {\n \t\"Nathaniel Cho\",\n \t\"Harvey Walters\",\n \t\"Winifred Habbamock\",\n \t\"Jacqueline Fine\",\n \t\"Stella Clark\",\n \t\"Gloria Goldberg\"\n },\n [\"The Innsmouth Conspiracy\"] = {\n \t\"Sister Mary\",\n \t\"Amanda Sharpe\",\n \t\"Trish Scarborough\",\n \t\"Dexter Drake\",\n \t\"Silas Marsh\"\n },\n [\"Edge of the Earth\"] = {\n \t\"Daniela Reyes\",\n \t\"Norman Withers\",\n \t\"Monterey Jack\",\n \t\"Lily Chen\",\n \t\"Bob Jenkins\"\n },\n [\"The Scarlet Keys\"] = {\n \t\"Carson Sinclair\",\n \t\"Vincent Lee\",\n \t\"Kymani Jones\",\n \t\"Amina Zidane\",\n \t\"Darrell Simmons\",\n \t\"Charlie Kane\"\n },\n\t[\"The Feast of Hemlock Vale\"] = {\n\t\t\"Wilson Richards\",\n\t\t\"Kate Winthrop\",\n\t\t\"Alessandra Zorzi\",\n\t\t\"Kōhaku Narukami\",\n\t\t\"Hank Samson\"\n\t}\n}\n\nINVESTIGATORS = {}\n-- Core Box\nINVESTIGATORS[\"Roland Banks\"] = {\n\tcards = { \"01001\", \"01001-p\", \"01001-pf\", \"01001-pb\" },\n\tminicards = { \"01001-m\" },\n\tsignatures = { \"01006\", \"01007\", \"90030\", \"90031\", \"90025\", \"90026\", \"90027\", \"90028\", \"90029\", \"98005\", \"98006\" },\n\tstarterDeck = \"2624931\"\n}\nINVESTIGATORS[\"Daisy Walker\"] = {\n\tcards = { \"01002\", \"01002-p\", \"01002-pf\", \"01002-pb\" },\n\tminicards = { \"01002-m\" },\n\tsignatures = { \"01008\", \"01009\", \"90002\", \"90003\" },\n\tstarterDeck = \"2624938\"\n}\nINVESTIGATORS[\"\\\"Skids\\\" O'Toole\"] = {\n\tcards = { \"01003\", \"01003-p\", \"01003-pf\", \"01003-pb\" },\n\tminicards = { \"01003-m\" },\n\tsignatures = { \"01010\", \"01011\", \"90009\", \"90010\" },\n\tstarterDeck = \"2624940\"\n}\nINVESTIGATORS[\"Agnes Baker\"] = {\n\tcards = { \"01004\", \"01004-p\", \"01004-pf\", \"01004-pb\" },\n\tminicards = { \"01004-m\" },\n\tsignatures = { \"01012\", \"01013\", \"90018\", \"90019\" },\n\tstarterDeck = \"2624944\"\n}\nINVESTIGATORS[\"Wendy Adams\"] = {\n\tcards = { \"01005\", \"01005-p\", \"01005-pf\", \"01005-pb\" },\n\tminicards = { \"01005-m\" },\n\tsignatures = { \"01014\", \"01015\", \"01515\", \"90039\", \"90040\", \"90038\" },\n\tstarterDeck = \"2624949\"\n}\n-- The Dunwich Legacy\nINVESTIGATORS[\"Zoey Samaras\"] = {\n\tcards = { \"02001\", \"02001-p\", \"02001-pf\", \"02001-pb\" },\n\tminicards = { \"02001-m\" },\n\tsignatures = { \"02006\", \"02007\", \"90060\", \"90061\" },\n\tstarterDeck = \"2624950\"\n}\nINVESTIGATORS[\"Rex Murphy\"] = {\n\tcards = { \"02002\", \"02002-t\" },\n\tminicards = { \"02002-m\" },\n\tsignatures = { \"02008\", \"02009\" },\n\tstarterDeck = \"2624958\"\n}\nINVESTIGATORS[\"Jenny Barnes\"] = {\n\tcards = { \"02003\" },\n\tminicards = { \"02003-m\" },\n\tsignatures = { \"02010\", \"02011\", \"98002\", \"98003\" },\n\tstarterDeck = \"2624961\"\n}\nINVESTIGATORS[\"Jim Culver\"] = {\n\tcards = { \"02004\", \"02004-p\", \"02004-pf\", \"02004-pb\" },\n\tminicards = { \"02004-m\" },\n\tsignatures = { \"02012\", \"02013\", \"90050\", \"90051\", \"90052\", \"90053\" },\n\tstarterDeck = \"2624965\"\n}\nINVESTIGATORS[\"\\\"Ashcan\\\" Pete\"] = {\n\tcards = { \"02005\", \"02005-p\", \"02005-pf\", \"02005-pb\" },\n\tminicards = { \"02005-m\" },\n\tsignatures = { \"02014\", \"02015\", \"90047\", \"90048\" },\n\tstarterDeck = \"2624969\"\n}\n-- The Path to Carcosa\nINVESTIGATORS[\"Mark Harrigan\"] = {\n\tcards = { \"03001\" },\n\tminicards = { \"03001-m\" },\n\tsignatures = { \"03007\", \"03008\", \"03009\" },\n\tstarterDeck = \"2624975\"\n}\nINVESTIGATORS[\"Minh Thi Phan\"] = {\n\tcards = { \"03002\" },\n\tminicards = { \"03002-m\" },\n\tsignatures = { \"03010\", \"03011\" },\n\tstarterDeck = \"2624979\"\n}\nINVESTIGATORS[\"Sefina Rousseau\"] = {\n\tcards = { \"03003\" },\n\tminicards = { \"03003-m\" },\n\tsignatures = { \"03012\", \"03012\", \"03012\", \"03013\" },\n\tstarterDeck = \"2624981\"\n}\nINVESTIGATORS[\"Akachi Onyele\"] = {\n\tcards = { \"03004\" },\n\tminicards = { \"03004-m\" },\n\tsignatures = { \"03014\", \"03015\" },\n\tstarterDeck = \"2624984\"\n}\nINVESTIGATORS[\"William Yorick\"] = {\n\tcards = { \"03005\" },\n\tminicards = { \"03005-m\" },\n\tsignatures = { \"03016\", \"03017\" },\n\tstarterDeck = \"2624988\"\n}\nINVESTIGATORS[\"Lola Hayes\"] = {\n\tcards = { \"03006\", \"03006-t\" },\n\tminicards = { \"03006-m\" },\n\tsignatures = { \"03018\", \"03018\", \"03019\", \"03019\", \"03019-t\", \"03019-t\" },\n\tstarterDeck = \"2624990\"\n}\n-- The Forgotten Age\nINVESTIGATORS[\"Leo Anderson\"] = {\n\tcards = { \"04001\" },\n\tminicards = { \"04001-m\" },\n\tsignatures = { \"04006\", \"04007\" },\n\tstarterDeck = \"2624994\"\n}\nINVESTIGATORS[\"Ursula Downs\"] = {\n\tcards = { \"04002\" },\n\tminicards = { \"04002-m\" },\n\tsignatures = { \"04008\", \"04009\" },\n\tstarterDeck = \"2625000\"\n}\nINVESTIGATORS[\"Finn Edwards\"] = {\n\tcards = { \"04003\" },\n\tminicards = { \"04003-m\" },\n\tsignatures = { \"04010\", \"04011\", \"04012\" },\n\tstarterDeck = \"2625003\"\n}\nINVESTIGATORS[\"Father Mateo\"] = {\n\tcards = { \"04004\" },\n\tminicards = { \"04004-m\" },\n\tsignatures = { \"04013\", \"04014\" },\n\tstarterDeck = \"2625005\"\n}\nINVESTIGATORS[\"Calvin Wright\"] = {\n\tcards = { \"04005\" },\n\tminicards = { \"04005-m\" },\n\tsignatures = { \"04015\", \"04016\" },\n\tstarterDeck = \"2625007\"\n}\n-- The Circle Undone\nINVESTIGATORS[\"Carolyn Fern\"] = {\n\tcards = { \"05001\" },\n\tminicards = { \"05001-m\" },\n\tsignatures = { \"05007\", \"05008\", \"98011\", \"98012\" },\n\tstarterDeck = \"2626342\"\n}\nINVESTIGATORS[\"Joe Diamond\"] = {\n\tcards = { \"05002\" },\n\tminicards = { \"05002-m\" },\n\tsignatures = { \"05009\", \"05010\" },\n\tstarterDeck = \"2626347\"\n}\nINVESTIGATORS[\"Preston Fairmont\"] = {\n\tcards = { \"05003\" },\n\tminicards = { \"05003-m\" },\n\tsignatures = { \"05011\", \"05012\" },\n\tstarterDeck = \"2626365\"\n}\nINVESTIGATORS[\"Diana Stanley\"] = {\n\tcards = { \"05004\" },\n\tminicards = { \"05004-m\" },\n\tsignatures = { \"05013\", \"05014\", \"05015\" },\n\tstarterDeck = \"2626385\"\n}\nINVESTIGATORS[\"Rita Young\"] = {\n\tcards = { \"05005\" },\n\tminicards = { \"05005-m\" },\n\tsignatures = { \"05016\", \"05017\" },\n\tstarterDeck = \"2626387\"\n}\nINVESTIGATORS[\"Marie Lambeau\"] = {\n\tcards = { \"05006\" },\n\tminicards = { \"05006-m\" },\n\tsignatures = { \"05018\", \"05019\" },\n\tstarterDeck = \"2626395\"\n}\n-- The Dream-Eaters\nINVESTIGATORS[\"Tommy Muldoon\"] = {\n\tcards = { \"06001\" },\n\tminicards = { \"06001-m\" },\n\tsignatures = { \"06006\", \"06007\" },\n\tstarterDeck = \"2626402\"\n}\nINVESTIGATORS[\"Mandy Thompson\"] = {\n\tcards = { \"06002\", \"06002-t\" },\n\tminicards = { \"06002-m\" },\n\tsignatures = { \"06008\", \"06008\", \"06008\", \"06009\" },\n\tstarterDeck = \"2626410\"\n}\nINVESTIGATORS[\"Tony Morgan\"] = {\n\tcards = { \"06003\" },\n\tminicards = { \"06003-m\" },\n\tsignatures = { \"06010\", \"06011\", \"06011\", \"06012\" },\n\tstarterDeck = \"2626446\"\n}\nINVESTIGATORS[\"Luke Robinson\"] = {\n\tcards = { \"06004\" },\n\tminicards = { \"06004-m\" },\n\tsignatures = { \"06013\", \"06014\", \"06015\" },\n\tstarterDeck = \"2626452\"\n}\nINVESTIGATORS[\"Patrice Hathaway\"] = {\n\tcards = { \"06005\" },\n\tminicards = { \"06005-m\" },\n\tsignatures = { \"06016\", \"06017\" },\n\tstarterDeck = \"2626461\"\n}\n-- Starter Decks\nINVESTIGATORS[\"Nathaniel Cho\"] = {\n\tcards = { \"60101\" },\n\tminicards = { \"60101-m\" },\n\tsignatures = { \"60102\", \"60103\" },\n\tstarterDeck = \"2643925\"\n}\nINVESTIGATORS[\"Harvey Walters\"] = {\n\tcards = { \"60201\" },\n\tminicards = { \"60201-m\" },\n\tsignatures = { \"60202\", \"60203\" },\n\tstarterDeck = \"2643928\"\n}\nINVESTIGATORS[\"Winifred Habbamock\"] = {\n\tcards = { \"60301\" },\n\tminicards = { \"60301-m\" },\n\tsignatures = { \"60302\", \"60303\" },\n\tstarterDeck = \"2643931\"\n}\nINVESTIGATORS[\"Jacqueline Fine\"] = {\n\tcards = { \"60401\" },\n\tminicards = { \"60401-m\" },\n\tsignatures = { \"60402\", \"60403\" },\n\tstarterDeck = \"2643932\"\n}\nINVESTIGATORS[\"Stella Clark\"] = {\n\tcards = { \"60501\" },\n\tminicards = { \"60501-m\" },\n\tsignatures = { \"60502\", \"60502\", \"60502\", \"60503\" },\n\tstarterDeck = \"2643934\"\n}\n-- The Innsmouth Conspiracy\nINVESTIGATORS[\"Sister Mary\"] = {\n\tcards = { \"07001\" },\n\tminicards = { \"07001-m\" },\n\tsignatures = { \"07006\", \"07007\" },\n\tstarterDeck = \"2626464\"\n}\nINVESTIGATORS[\"Amanda Sharpe\"] = {\n\tcards = { \"07002\" },\n\tminicards = { \"07002-m\" },\n\tsignatures = { \"07008\", \"07009\" },\n\tstarterDeck = \"2626469\"\n}\nINVESTIGATORS[\"Trish Scarborough\"] = {\n\tcards = { \"07003\", \"07003-t\" },\n\tminicards = { \"07003-m\" },\n\tsignatures = { \"07010\", \"07011\" },\n\tstarterDeck = \"2626479\"\n}\nINVESTIGATORS[\"Dexter Drake\"] = {\n\tcards = { \"07004\" },\n\tminicards = { \"07004-m\" },\n\tsignatures = { \"07012\", \"07013\", \"98017\", \"98018\" },\n\tstarterDeck = \"2626672\"\n}\nINVESTIGATORS[\"Silas Marsh\"] = {\n\tcards = { \"07005\" },\n\tminicards = { \"07005-m\" },\n\tsignatures = { \"07014\", \"07015\", \"07016\", \"98014\", \"98015\" },\n\tstarterDeck = \"2626685\"\n}\n-- Edge of the Earth\nINVESTIGATORS[\"Daniela Reyes\"] = {\n\tcards = { \"08001\" },\n\tminicards = { \"08001-m\" },\n\tsignatures = { \"08002\", \"08003\" },\n\tstarterDeck = \"2634588\"\n}\nINVESTIGATORS[\"Norman Withers\"] = {\n\tcards = { \"08004\" },\n\tminicards = { \"08004-m\" },\n\tsignatures = { \"08005\", \"08006\", \"98008\", \"98009\" },\n\tstarterDeck = \"2634603\"\n}\nINVESTIGATORS[\"Monterey Jack\"] = {\n\tcards = { \"08007\", \"08007-p\", \"08007-pf\", \"08007-pb\" },\n\tminicards = { \"08007-m\" },\n\tsignatures = { \"08008\", \"08009\", \"90063\", \"90064\" },\n\tstarterDeck = \"2634652\"\n}\nINVESTIGATORS[\"Lily Chen\"] = {\n\tcards = { \"08010\" },\n\tminicards = { \"08010-m\" },\n\tsignatures = { \"08011a\", \"08012a\", \"08013a\", \"08014a\", \"08015\", \"08015\", \"08015\", \"08015\" },\n\tstarterDeck = \"2634658\"\n}\nINVESTIGATORS[\"Bob Jenkins\"] = {\n\tcards = { \"08016\" },\n\tminicards = { \"08016-m\" },\n\tsignatures = { \"08017\", \"08018\" },\n\tstarterDeck = \"2634643\"\n}\n-- The Scarlet Keys\nINVESTIGATORS[\"Carson Sinclair\"] = {\n\tcards = { \"09001\" },\n\tminicards = { \"09001-m\" },\n\tsignatures = { \"09002\", \"09002\", \"09003\" },\n\tstarterDeck = \"2634667\"\n}\nINVESTIGATORS[\"Vincent Lee\"] = {\n\tcards = { \"09004\" },\n\tminicards = { \"09004-m\" },\n\tsignatures = { \"09005\", \"09006\", \"09006\", \"09006\", \"09006\", \"09007\" },\n\tstarterDeck = \"2634675\"\n}\nINVESTIGATORS[\"Kymani Jones\"] = {\n\tcards = { \"09008\" },\n\tminicards = { \"09008-m\" },\n\tsignatures = { \"09009\", \"09010\" },\n\tstarterDeck = \"2634701\"\n}\nINVESTIGATORS[\"Amina Zidane\"] = {\n\tcards = { \"09011\" },\n\tminicards = { \"09011-m\" },\n\tsignatures = { \"09012\", \"09013\", \"09014\" },\n\tstarterDeck = \"2634697\"\n}\nINVESTIGATORS[\"Darrell Simmons\"] = {\n\tcards = { \"09015\" },\n\tminicards = { \"09015-m\" },\n\tsignatures = { \"09016\", \"09017\" },\n\tstarterDeck = \"2634757\"\n}\nINVESTIGATORS[\"Charlie Kane\"] = {\n\tcards = { \"09018\" },\n\tminicards = { \"09018-m\" },\n\tsignatures = { \"09019\", \"09020\" },\n\tstarterDeck = \"2634706\"\n}\n-- The Feast of Hemlock Vale\nINVESTIGATORS[\"Wilson Richards\"] = {\n\tcards = { \"10001\" },\n\tminicards = { \"10001-m\" },\n\tsignatures = { \"10002\", \"10003\" },\n\tstarterDeck = \"2634667\" --carson deck as placeholder\n}\nINVESTIGATORS[\"Kate Winthrop\"] = {\n\tcards = { \"10004\" },\n\tminicards = { \"10004-m\" },\n\tsignatures = { \"10005\", \"10006\", \"10007\", \"10008\" },\n\tstarterDeck = \"2643928\" --harvey deck as placeholder\n}\nINVESTIGATORS[\"Alessandra Zorzi\"] = {\n\tcards = { \"10009\" },\n\tminicards = { \"10009-m\" },\n\tsignatures = { \"10010\", \"10010\", \"10010\", \"10011\" },\n\tstarterDeck = \"2643931\" --winifred deck as placeholder\n}\nINVESTIGATORS[\"Kōhaku Narukami\"] = {\n\tcards = { \"10012\" },\n\tminicards = { \"10012-m\" },\n\tsignatures = { \"10013\", \"10014\" },\n\tstarterDeck = \"2636199\" --gloria deck as placeholder\n}\nINVESTIGATORS[\"Hank Samson\"] = {\n\tcards = { \"10015\", \"10015-b1\", \"10015-b2\" },\n\tminicards = { \"10015-m\" },\n\tsignatures = { \"10017\", \"10018\"},\n\tstarterDeck = \"2643934\" --stella deck as placeholder\n}\n-- PnP content\nINVESTIGATORS[\"Subject 5U-21\"] = {\n\tcards = { \"89001\" },\n\tminicards = { \"89001-m\" },\n\tsignatures = { \"89002\", \"89003\", \"89003\", \"89003\", \"89004\", \"89004\", \"89004\", \"89005\" },\n\tstarterDeck = \"2624990\" -- Lola's deck id until Suzi is on ArkhamDB\n}\n-- Promo content\nINVESTIGATORS[\"Gloria Goldberg\"] = {\n\tcards = { \"98019\" },\n\tminicards = { \"98019-m\" },\n\tsignatures = { \"98020\", \"98021\" },\n\tstarterDeck = \"2636199\"\n}\n------------------ END INVESTIGATOR DATA DEFINITION ------------------\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playercards/PlayerCardSpawner\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- Amount to shift for the next card (zShift) or next row of cards (xShift)\n-- Note that the table rotation is weird, and the X axis is vertical while the\n-- Z axis is horizontal\nlocal SPREAD_Z_SHIFT = -2.3\nlocal SPREAD_X_SHIFT = -3.66\n\nSpawner = { }\n\n-- Spawns a list of cards at the given position/rotation. This will separate cards by size -\n-- investigator, standard, and mini, spawning them in that order with larger cards on bottom. If\n-- there are different types, the provided callback will be called once for each type as it spawns\n-- either a card or deck.\n-- @param cardList: A list of Player Card data structures (data/metadata)\n-- @param pos Position table where the cards should be spawned (global)\n-- @param rot Rotation table for the orientation of the spawned cards (global)\n-- @param sort Boolean, true if this list of cards should be sorted before spawning\n-- @param callback Function, callback to be called after the card/deck spawns.\nSpawner.spawnCards = function(cardList, pos, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local miniCards = { }\n local standardCards = { }\n local investigatorCards = { }\n\n for _, card in ipairs(cardList) do\n if (card.metadata.type == \"Investigator\") then\n table.insert(investigatorCards, card)\n elseif (card.metadata.type == \"Minicard\") then\n table.insert(miniCards, card)\n else\n table.insert(standardCards, card)\n end\n end\n -- Spawn each of the three types individually. Each Y position shift accounts for the thickness\n -- of the spawned deck\n local position = { x = pos.x, y = pos.y, z = pos.z }\n Spawner.spawn(investigatorCards, position, { rot.x, rot.y - 90, rot.z }, callback)\n\n position.y = position.y + (#investigatorCards + #standardCards) * 0.07\n Spawner.spawn(standardCards, position, rot, callback)\n\n position.y = position.y + (#standardCards + #miniCards) * 0.07\n Spawner.spawn(miniCards, position, rot, callback)\nend\n\nSpawner.spawnCardSpread = function(cardList, startPos, maxCols, rot, sort, callback)\n if (sort) then\n table.sort(cardList, Spawner.cardComparator)\n end\n\n local position = { x = startPos.x, y = startPos.y, z = startPos.z }\n -- Special handle the first row if we have less than a full single row, but only if there's a\n -- reasonable max column count. Single-row spreads will send a large value for maxCols\n if maxCols \u003c 100 and #cardList \u003c maxCols then\n position.z = startPos.z + ((maxCols - #cardList) / 2 * SPREAD_Z_SHIFT)\n end\n local cardsInRow = 0\n local rows = 0\n for _, card in ipairs(cardList) do\n Spawner.spawn({ card }, position, rot, callback)\n position.z = position.z + SPREAD_Z_SHIFT\n cardsInRow = cardsInRow + 1\n if cardsInRow \u003e= maxCols then\n rows = rows + 1\n local cardsForRow = #cardList - rows * maxCols\n if cardsForRow \u003e maxCols then\n cardsForRow = maxCols\n end\n position.z = startPos.z + ((maxCols - cardsForRow) / 2 * SPREAD_Z_SHIFT)\n position.x = position.x + SPREAD_X_SHIFT\n cardsInRow = 0\n end\n end\nend\n\n-- Spawn a specific list of cards. This method is for internal use and should not be called\n-- directly, use spawnCards instead.\n---@param cardList: A list of Player Card data structures (data/metadata)\n---@param pos table Position where the cards should be spawned (global)\n---@param rot table Rotation for the orientation of the spawned cards (global)\n---@param callback function callback to be called after the card/deck spawns.\nSpawner.spawn = function(cardList, pos, rot, callback)\n if (#cardList == 0) then\n return\n end\n -- Spawn a single card directly\n if (#cardList == 1) then\n spawnObjectData({\n data = cardList[1].data,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\n return\n end\n -- For multiple cards, construct a deck and spawn that\n local deck = Spawner.buildDeckDataTemplate()\n -- Decks won't inherently scale to the cards in them. The card list being spawned should be all\n -- the same type/size by this point, so use the first card to set the size\n deck.Transform = {\n scaleX = cardList[1].data.Transform.scaleX,\n scaleY = 1,\n scaleZ = cardList[1].data.Transform.scaleZ,\n }\n local sidewaysDeck = true\n for _, spawnCard in ipairs(cardList) do\n Spawner.addCardToDeck(deck, spawnCard.data)\n -- set sidewaysDeck to false if any card is not a sideways card\n sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)\n end\n -- set the alt view angle for sideway decks\n if sidewaysDeck then\n deck.AltLookAngle = { x = 0, y = 180, z = 90 }\n end\n spawnObjectData({\n data = deck,\n position = pos,\n rotation = rot,\n callback_function = callback,\n })\nend\n\n-- Inserts a card into the given deck. This does three things:\n-- 1. Add the card's data to ContainedObjects\n-- 2. Add the card's ID (the TTS CardID, not the Arkham ID) to the deck's\n-- ID list. Note that the deck's ID list is \"DeckIDs\" even though it\n-- contains a list of card Ids\n-- 3. Extract the card's CustomDeck table and add it to the deck. The deck's\n-- \"CustomDeck\" field is a list of all CustomDecks used by cards within the\n-- deck, keyed by the DeckID and referencing the custom deck table\n---@param deck: TTS deck data structure to add to\n---@param cardData: Data for the card to be inserted\nSpawner.addCardToDeck = function(deck, cardData)\n for customDeckId, customDeckData in pairs(cardData.CustomDeck) do\n if (deck.CustomDeck[customDeckId] == nil) then\n -- CustomDeck not added to deck yet, add it\n deck.CustomDeck[customDeckId] = customDeckData\n elseif (deck.CustomDeck[customDeckId].FaceURL == customDeckData.FaceURL) then\n -- CustomDeck for this card matches the current one for the deck, do nothing\n else\n -- CustomDeck data conflict\n local newDeckId = nil\n for deckId, customDeck in pairs(deck.CustomDeck) do\n if (customDeckData.FaceURL == customDeck.FaceURL) then\n newDeckId = deckId\n end\n end\n if (newDeckId == nil) then\n -- No non-conflicting custom deck for this card, add a new one\n newDeckId = Spawner.findNextAvailableId(deck.CustomDeck, \"1000\")\n deck.CustomDeck[newDeckId] = customDeckData\n end\n -- Update the card with the new CustomDeck info\n cardData.CardID = newDeckId..string.sub(cardData.CardID, 5)\n cardData.CustomDeck[customDeckId] = nil\n cardData.CustomDeck[newDeckId] = customDeckData\n break\n end\n end\n table.insert(deck.ContainedObjects, cardData)\n table.insert(deck.DeckIDs, cardData.CardID)\nend\n\n-- Create an empty deck data table which can have cards added to it. This\n-- creates a new table on each call without using metatables or previous\n-- definitions because we can't be sure that TTS doesn't modify the structure\n---@return: Table containing the minimal TTS deck data structure\nSpawner.buildDeckDataTemplate = function()\n local deck = {}\n deck.Name = \"Deck\"\n\n -- Card data. DeckIDs and CustomDeck entries will be built from the cards\n deck.ContainedObjects = {}\n deck.DeckIDs = {}\n deck.CustomDeck = {}\n\n -- Transform is required, Position and Rotation will be overridden by the spawn call so can be omitted here\n deck.Transform = {\n scaleX = 1,\n scaleY = 1,\n scaleZ = 1,\n }\n\n return deck\nend\n\n-- Returns the first ID which does not exist in the given table, starting at startId and increasing\n-- @param objectTable Table keyed by strings which are numbers\n-- @param startId First possible ID.\n-- @return String ID \u003e= startId\nSpawner.findNextAvailableId = function(objectTable, startId)\n local id = startId\n while (objectTable[id] ~= nil) do\n id = tostring(tonumber(id) + 1)\n end\n\n return id\nend\n\n-- Get the PBCN (Permanent/Bonded/Customizable/Normal) value from the given metadata.\n---@return: 1 for Permanent, 2 for Bonded or 4 for Normal. The actual values are\n-- irrelevant as they provide only grouping and the order between them doesn't matter.\nSpawner.getpbcn = function(metadata)\n if metadata.permanent then\n return 1\n elseif metadata.bonded_to ~= nil then\n return 2\n else -- Normal card\n return 3\n end\nend\n\n-- Comparison function used to sort the cards in a deck. Groups bonded or\n-- permanent cards first, then sorts within theose types by name/subname.\n-- Normal cards will sort in standard alphabetical order, while\n-- permanent/bonded/customizable will be in reverse alphabetical order.\n--\n-- Since cards spawn in the order provided by this comparator, with the first\n-- cards ending up at the bottom of a pile, this ordering will spawn in reverse\n-- alphabetical order. This presents the cards in order for non-face-down\n-- areas, and presents them in order when Searching the face-down deck.\nSpawner.cardComparator = function(card1, card2)\n local pbcn1 = Spawner.getpbcn(card1.metadata)\n local pbcn2 = Spawner.getpbcn(card2.metadata)\n if pbcn1 ~= pbcn2 then\n return pbcn1 \u003e pbcn2\n end\n if pbcn1 == 3 then\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003c card2.data.Nickname\n end\n return card1.data.Description \u003c card2.data.Description\n else\n if card1.data.Nickname ~= card2.data.Nickname then\n return card1.data.Nickname \u003e card2.data.Nickname\n end\n return card1.data.Description \u003e card2.data.Description\n end\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"spawnBagState\":{\"placed\":[],\"placedObjects\":[]}}", "MeasureMovement": false, "Name": "Custom_Tile", @@ -194599,7 +196722,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/VictoryDisplay\")\nend)\n__bundle_register(\"core/VictoryDisplay\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\n\nlocal pendingCall = false\nlocal messageSent = {}\nlocal missingData = {}\nlocal countedVP = {}\n\nlocal highlightMissing = false\nlocal highlightCounted = false\n\n-- button creation when loading the game\nfunction onLoad()\n -- index 0: VP - \"Display\"\n local buttonParameters = {}\n buttonParameters.label = \"0\"\n buttonParameters.click_function = \"none\"\n buttonParameters.function_owner = self\n buttonParameters.scale = { 0.15, 0.15, 0.15 }\n buttonParameters.width = 0\n buttonParameters.height = 0\n buttonParameters.font_size = 600\n buttonParameters.font_color = { 1, 1, 1 }\n buttonParameters.position = { x = -0.72, y = 0.06, z = -0.69 }\n self.createButton(buttonParameters)\n\n -- index 1: VP - \"Play Area\"\n buttonParameters.position.x = 0.65\n self.createButton(buttonParameters)\n\n -- index 2: VP - \"Total\"\n buttonParameters.position.x = 1.69\n self.createButton(buttonParameters)\n\n -- index 3: highlighting button (missing data)\n self.createButton({\n label = \"!\",\n click_function = \"highlightMissingData\",\n tooltip = \"Enable highlighting of cards without metadata (VP on these is not counted).\",\n function_owner = self,\n scale = { 0.15, 0.15, 0.15 },\n color = { 1, 0, 0 },\n width = 700,\n height = 800,\n font_size = 700,\n font_color = { 1, 1, 1 },\n position = { x = 1.82, y = 0.06, z = -1.32 }\n })\n\n -- index 4: highlighting button (counted VP)\n self.createButton({\n label = \"?\",\n click_function = \"highlightCountedVP\",\n tooltip = \"Enable highlighting of cards with VP.\",\n function_owner = self,\n scale = { 0.15, 0.15, 0.15 },\n color = { 0, 1, 0 },\n width = 700,\n height = 800,\n font_size = 700,\n font_color = { 1, 1, 1 },\n position = { x = 1.5, y = 0.06, z = -1.32 }\n })\n\n -- update the display label once\n Wait.time(updateCount, 1)\nend\n\n---------------------------------------------------------\n-- events with descriptions\n---------------------------------------------------------\n\n-- dropping an object on the victory display\nfunction onCollisionEnter()\n startUpdate()\nend\n\n-- removing an object from the victory display\nfunction onCollisionExit()\n startUpdate()\nend\n\n-- picking a clue or location up\nfunction onObjectPickUp(_, obj)\n maybeUpdate(obj)\nend\n\n-- dropping a clue or location\nfunction onObjectDrop(_, obj)\n maybeUpdate(obj, 1)\nend\n\n-- flipping a clue/doom or location\nfunction onObjectRotate(obj, _, flip, _, _, oldFlip)\n if flip == oldFlip then return end\n maybeUpdate(obj, 1, true)\nend\n\n-- destroying a clue or location\nfunction onObjectDestroy(obj)\n maybeUpdate(obj)\nend\n\n---------------------------------------------------------\n-- main functionality\n---------------------------------------------------------\n\nfunction maybeUpdate(obj, delay, flipped)\n -- stop if there is already an update call running\n if pendingCall then return end\n\n -- stop if obj is nil (by e.g. dropping a clue onto another and making a stack)\n if obj == nil then return end\n\n -- only continue for clues / doom tokens or locations\n if obj.hasTag(\"Location\") then\n elseif obj.memo == \"clueDoom\" then\n -- only continue if the clue side is up or a doom token is being flipped\n if obj.is_face_down == true and flipped ~= true then return end\n else\n return\n end\n\n -- only continue if the obj in in the play area\n if not playAreaApi.isInPlayArea(obj) then return end\n\n startUpdate(delay)\nend\n\n-- starts an update\nfunction startUpdate(delay)\n -- stop if there is already an update call running\n if pendingCall then return end\n pendingCall = true\n delay = tonumber(delay) or 0\n Wait.time(updateCount, delay + 0.2)\nend\n\n-- counts the VP in the victory display and request the VP count from the play area\nfunction updateCount()\n missingData = {}\n countedVP = {}\n local victoryPoints = {}\n victoryPoints.display = 0\n victoryPoints.playArea = playAreaApi.countVP()\n\n -- count cards in victory display\n for _, v in ipairs(searchOnObj(self)) do\n local obj = v.hit_object\n\n -- check metadata for VP\n if obj.tag == \"Card\" then\n local VP = getCardVP(obj, JSON.decode(obj.getGMNotes()))\n victoryPoints.display = victoryPoints.display + VP\n if VP \u003e 0 then\n table.insert(countedVP, obj)\n end\n\n -- handling for stacked cards\n elseif obj.tag == \"Deck\" then\n local VP = 0\n for _, deepObj in ipairs(obj.getObjects()) do\n local deepVP = getCardVP(obj, JSON.decode(deepObj.gm_notes))\n victoryPoints.display = victoryPoints.display + deepVP\n if deepVP \u003e 0 then\n VP = VP + 1\n end\n end\n if VP \u003e 0 then\n table.insert(countedVP, obj)\n end\n end\n end\n\n -- update the buttons that are used as labels\n self.editButton({ index = 0, label = victoryPoints.display })\n self.editButton({ index = 1, label = victoryPoints.playArea })\n self.editButton({ index = 2, label = victoryPoints.display + victoryPoints.playArea })\n\n -- allow new update calls\n pendingCall = false\nend\n\n-- gets the VP count from the notes\nfunction getCardVP(obj, notes)\n local cardVP\n if notes ~= nil then\n -- enemy, treachery etc.\n cardVP = tonumber(notes.victory)\n\n -- location\n if not cardVP then\n -- check the correct side of the location\n if not obj.is_face_down and notes.locationFront ~= nil then\n cardVP = tonumber(notes.locationFront.victory)\n elseif notes.locationBack ~= nil then\n cardVP = tonumber(notes.locationBack.victory)\n end\n end\n if (cardVP or 0) \u003e 0 then\n table.insert(countedVP, obj)\n end\n else\n table.insert(missingData, obj)\n end\n return cardVP or 0\nend\n\n-- toggles the highlight for objects with missing metadata\nfunction highlightMissingData()\n self.editButton({\n index = 3,\n tooltip = (highlightMissing and \"Enable\" or \"Disable\") .. \" highlighting of cards without metadata (VP on these is not counted).\"\n })\n for _, obj in pairs(missingData) do\n if obj ~= nil then\n if highlightMissing then\n obj.highlightOff(\"Red\")\n else\n obj.highlightOn(\"Red\")\n end\n end\n end\n playAreaApi.highlightMissingData(highlightMissing)\n highlightMissing = not highlightMissing\nend\n\n-- toggles the highlight for objects that were counted\nfunction highlightCountedVP()\n self.editButton({\n index = 4,\n tooltip = (highlightCounted and \"Enable\" or \"Disable\") .. \" highlighting of cards with VP.\"\n })\n for _, obj in pairs(countedVP) do\n if obj ~= nil then\n if highlightCounted then\n obj.highlightOff(\"Green\")\n else\n obj.highlightOn(\"Green\")\n end\n end\n end\n playAreaApi.highlightCountedVP(highlightCounted)\n highlightCounted = not highlightCounted\nend\n\n-- places the provided card in the first empty spot\nfunction placeCard(card)\n local trash = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n \n -- check snap point states\n local snaps = self.getSnapPoints()\n table.sort(snaps, function(a, b) return a.position.x \u003e b.position.x end)\n table.sort(snaps, function(a, b) return a.position.z \u003c b.position.z end)\n\n -- get first empty slot\n local fullSlots = {}\n local positions = {}\n for i, snap in ipairs(snaps) do\n positions[i] = self.positionToWorld(snap.position)\n local hits = checkSnapPointState(positions[i])\n\n -- first hit is self, additional hits must be cards / decks\n if #hits \u003e 1 then\n fullSlots[i] = true\n end\n end\n\n -- remove tokens from the card\n for _, v in ipairs(searchOnObj(card)) do\n local obj = v.hit_object\n\n -- don't touch decks / cards\n if obj.tag == \"Deck\" or obj.tag == \"Card\" then\n -- put chaos tokens back into bag\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n elseif obj.memo ~= nil and obj.getLock() == false then\n trash.putObject(obj)\n end\n end\n \n -- place the card\n local name = card.getName() or \"Unnamed card\"\n for i = 1, 10 do\n if fullSlots[i] ~= true then\n local rot = { 0, 270, card.getRotation().z }\n card.setPositionSmooth(positions[i], false, true)\n card.setRotation(rot)\n broadcastToAll(\"Victory Display: \" .. name .. \" placed into slot \" .. i .. \".\", \"Green\")\n return\n end\n end\n\n broadcastToAll(\"Victory Display is full! \" .. name .. \" placed into slot 1.\", \"Orange\")\n card.setPositionSmooth(positions[1], false, true)\nend\n\n---------------------------------------------------------\n-- utility functions\n---------------------------------------------------------\n\n-- searches on an object\nfunction searchOnObj(obj)\n return Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0.5,\n type = 3,\n size = obj.getBounds().size,\n origin = obj.getPosition()\n })\nend\n\nfunction checkSnapPointState(pos)\n return Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0.1,\n type = 3,\n size = { 0.1, 0.1, 0.1 },\n origin = pos\n })\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/token/TokenChecker\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local CHAOS_TOKEN_NAMES = {\n [\"Elder Sign\"] = true,\n [\"+1\"] = true,\n [\"0\"] = true,\n [\"-1\"] = true,\n [\"-2\"] = true,\n [\"-3\"] = true,\n [\"-4\"] = true,\n [\"-5\"] = true,\n [\"-6\"] = true,\n [\"-7\"] = true,\n [\"-8\"] = true,\n [\"Skull\"] = true,\n [\"Cultist\"] = true,\n [\"Tablet\"] = true,\n [\"Elder Thing\"] = true,\n [\"Auto-fail\"] = true,\n [\"Bless\"] = true,\n [\"Curse\"] = true,\n [\"Frost\"] = true\n }\n\n local TokenChecker = {}\n\n -- returns true if the passed object is a chaos token (by name)\n TokenChecker.isChaosToken = function(obj)\n if CHAOS_TOKEN_NAMES[obj.getName()] then\n return true\n else\n return false\n end\n end\n\n return TokenChecker\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/VictoryDisplay\")\nend)\n__bundle_register(\"core/VictoryDisplay\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal tokenChecker = require(\"core/token/TokenChecker\")\n\nlocal pendingCall = false\nlocal missingData = {}\nlocal countedVP = {}\n\nlocal highlightMissing = false\nlocal highlightCounted = false\n\n-- button creation when loading the game\nfunction onLoad()\n -- index 0: VP - \"Display\"\n local buttonParameters = {}\n buttonParameters.label = \"0\"\n buttonParameters.click_function = \"none\"\n buttonParameters.function_owner = self\n buttonParameters.scale = { 0.15, 0.15, 0.15 }\n buttonParameters.width = 0\n buttonParameters.height = 0\n buttonParameters.font_size = 600\n buttonParameters.font_color = { 1, 1, 1 }\n buttonParameters.position = { x = -0.72, y = 0.06, z = -0.69 }\n self.createButton(buttonParameters)\n\n -- index 1: VP - \"Play Area\"\n buttonParameters.position.x = 0.65\n self.createButton(buttonParameters)\n\n -- index 2: VP - \"Total\"\n buttonParameters.position.x = 1.69\n self.createButton(buttonParameters)\n\n -- index 3: highlighting button (missing data)\n buttonParameters.label = \"!\"\n buttonParameters.click_function = \"highlightMissingData\"\n buttonParameters.tooltip = \"Enable highlighting of cards without metadata (VP on these is not counted).\"\n buttonParameters.color = { 1, 0, 0 }\n buttonParameters.width = 700\n buttonParameters.height = 800\n buttonParameters.font_size = 700\n buttonParameters.position = { x = 1.82, y = 0.06, z = -1.32 }\n self.createButton(buttonParameters)\n\n -- index 4: highlighting button (counted VP)\n buttonParameters.label = \"?\"\n buttonParameters.click_function = \"highlightCountedVP\"\n buttonParameters.tooltip = \"Enable highlighting of cards with VP.\"\n buttonParameters.color = { 0, 1, 0 }\n buttonParameters.position.x = 1.5\n self.createButton(buttonParameters)\n\n -- update the display label once\n Wait.time(updateCount, 1)\nend\n\n---------------------------------------------------------\n-- events with descriptions\n---------------------------------------------------------\n\n-- dropping an object on the victory display\nfunction onCollisionEnter()\n startUpdate()\nend\n\n-- removing an object from the victory display\nfunction onCollisionExit()\n startUpdate()\nend\n\n-- picking a clue or location up\nfunction onObjectPickUp(_, obj)\n maybeUpdate(obj)\nend\n\n-- dropping a clue or location\nfunction onObjectDrop(_, obj)\n maybeUpdate(obj, 1)\nend\n\n-- flipping a clue/doom or location\nfunction onObjectRotate(obj, _, flip, _, _, oldFlip)\n if flip == oldFlip then return end\n maybeUpdate(obj, 1, true)\nend\n\n-- destroying a clue or location\nfunction onObjectDestroy(obj)\n maybeUpdate(obj)\nend\n\n---------------------------------------------------------\n-- main functionality\n---------------------------------------------------------\n\nfunction maybeUpdate(obj, delay, flipped)\n -- stop if there is already an update call running\n if pendingCall then return end\n\n -- stop if obj is nil (by e.g. dropping a clue onto another and making a stack)\n if obj == nil then return end\n\n -- only continue for clues / doom tokens or locations\n if obj.hasTag(\"Location\") then\n elseif obj.memo == \"clueDoom\" then\n -- only continue if the clue side is up or a doom token is being flipped\n if obj.is_face_down == true and flipped ~= true then return end\n else\n return\n end\n\n -- only continue if the obj in in the play area\n if not playAreaApi.isInPlayArea(obj) then return end\n\n startUpdate(delay)\nend\n\n-- starts an update\nfunction startUpdate(delay)\n -- stop if there is already an update call running\n if pendingCall then return end\n pendingCall = true\n delay = tonumber(delay) or 0\n Wait.time(updateCount, delay + 0.2)\nend\n\n-- counts the VP in the victory display and request the VP count from the play area\nfunction updateCount()\n missingData = {}\n countedVP = {}\n local victoryPoints = {}\n victoryPoints.display = 0\n victoryPoints.playArea = playAreaApi.countVP()\n\n -- count cards in victory display\n for _, obj in ipairs(searchLib.onObject(self, \"isCardOrDeck\")) do\n -- check metadata for VP\n if obj.type == \"Card\" then\n local VP = getCardVP(obj, JSON.decode(obj.getGMNotes()))\n victoryPoints.display = victoryPoints.display + VP\n if VP \u003e 0 then\n table.insert(countedVP, obj)\n end\n\n -- handling for stacked cards\n elseif obj.type == \"Deck\" then\n local VP = 0\n for _, deepObj in ipairs(obj.getObjects()) do\n local deepVP = getCardVP(obj, JSON.decode(deepObj.gm_notes))\n victoryPoints.display = victoryPoints.display + deepVP\n if deepVP \u003e 0 then\n VP = VP + 1\n end\n end\n if VP \u003e 0 then\n table.insert(countedVP, obj)\n end\n end\n end\n\n -- update the buttons that are used as labels\n self.editButton({ index = 0, label = victoryPoints.display })\n self.editButton({ index = 1, label = victoryPoints.playArea })\n self.editButton({ index = 2, label = victoryPoints.display + victoryPoints.playArea })\n\n -- allow new update calls\n pendingCall = false\nend\n\n-- gets the VP count from the notes\nfunction getCardVP(obj, notes)\n local cardVP\n if notes ~= nil then\n -- enemy, treachery etc.\n cardVP = tonumber(notes.victory)\n\n -- location\n if not cardVP then\n -- check the correct side of the location\n if not obj.is_face_down and notes.locationFront ~= nil then\n cardVP = tonumber(notes.locationFront.victory)\n elseif notes.locationBack ~= nil then\n cardVP = tonumber(notes.locationBack.victory)\n end\n end\n if (cardVP or 0) \u003e 0 then\n table.insert(countedVP, obj)\n end\n else\n table.insert(missingData, obj)\n end\n return cardVP or 0\nend\n\n-- toggles the highlight for objects with missing metadata\nfunction highlightMissingData()\n self.editButton({\n index = 3,\n tooltip = (highlightMissing and \"Enable\" or \"Disable\") .. \" highlighting of cards without metadata (VP on these is not counted).\" })\n for _, obj in pairs(missingData) do\n if obj ~= nil then\n if highlightMissing then\n obj.highlightOff(\"Red\")\n else\n obj.highlightOn(\"Red\")\n end\n end\n end\n playAreaApi.highlightMissingData(highlightMissing)\n highlightMissing = not highlightMissing\nend\n\n-- toggles the highlight for objects that were counted\nfunction highlightCountedVP()\n self.editButton({\n index = 4,\n tooltip = (highlightCounted and \"Enable\" or \"Disable\") .. \" highlighting of cards with VP.\"\n })\n for _, obj in pairs(countedVP) do\n if obj ~= nil then\n if highlightCounted then\n obj.highlightOff(\"Green\")\n else\n obj.highlightOn(\"Green\")\n end\n end\n end\n playAreaApi.highlightCountedVP(highlightCounted)\n highlightCounted = not highlightCounted\nend\n\n-- places the provided card in the first empty spot\nfunction placeCard(card)\n local trash = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n\n -- check snap point states\n local snaps = self.getSnapPoints()\n table.sort(snaps, function(a, b) return a.position.x \u003e b.position.x end)\n table.sort(snaps, function(a, b) return a.position.z \u003c b.position.z end)\n\n -- get first empty slot\n local fullSlots = {}\n local positions = {}\n for i, snap in ipairs(snaps) do\n positions[i] = self.positionToWorld(snap.position)\n local searchResult = searchLib.atPosition(positions[i], \"isCardOrDeck\")\n fullSlots[i] = #searchResult \u003e 0\n end\n\n -- remove tokens from the card\n for _, obj in ipairs(searchLib.onObject(card)) do\n -- don't touch decks / cards\n if obj.type == \"Deck\" or obj.type == \"Card\" then\n -- put chaos tokens back into bag\n elseif tokenChecker.isChaosToken(obj) then\n local chaosBag = chaosBagApi.findChaosBag()\n chaosBag.putObject(obj)\n elseif obj.memo ~= nil and obj.getLock() == false then\n trash.putObject(obj)\n end\n end\n\n -- place the card\n local name = card.getName() or \"Unnamed card\"\n for i = 1, 10 do\n if fullSlots[i] ~= true then\n local rot = { 0, 270, card.getRotation().z }\n card.setPositionSmooth(positions[i], false, true)\n card.setRotation(rot)\n broadcastToAll(\"Victory Display: \" .. name .. \" placed into slot \" .. i .. \".\", \"Green\")\n return\n end\n end\n\n broadcastToAll(\"Victory Display is full! \" .. name .. \" placed into slot 1.\", \"Orange\")\n card.setPositionSmooth(positions[1], false, true)\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", @@ -194715,6 +196838,258 @@ "r": 1 }, "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2001%20Night%20of%20the%20Zealot.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "276907", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "Night of the Zealot", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.463, + "posY": 3.037, + "posZ": 36.845, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/01%20Night%20of%20the%20Zealot.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "56a91d", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "01 Night of the Zealot", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": 35, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/51eeefcbe1d1eded152916465d88296faf66528b/Dual%20Pages%2002%20The%20Dunwich%20Legacy.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "8df5fc", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "The Dunwich Legacy", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 67.375, + "posY": 3.038, + "posZ": 30.123, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/02%20Dunwich%20Legacy.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "38d1cd", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "02 The Dunwich Legacy", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": 29, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, { "AltLookAngle": { "x": 0, @@ -194828,9 +197203,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 65, "posY": 1.249, - "posZ": 16.04, + "posZ": 23, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -194873,12 +197248,12 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2009%20The%20Scarlet%20Keys%202%20Scenarios%20and%20Case%20Files.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2004%20The%20Forgotten%20Age.pdf?raw=true" }, "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "c6e8a0", + "GUID": "20c2ad", "Grid": true, "GridProjection": false, "Hands": false, @@ -194890,7 +197265,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "09 The Scarlet Keys: Scenarios \u0026 Case Files", + "Nickname": "The Forgotten Age", "Snap": true, "Sticky": true, "Tags": [ @@ -194898,9 +197273,9 @@ ], "Tooltip": true, "Transform": { - "posX": 66.593, + "posX": 65.567, "posY": 3.038, - "posZ": -20.295, + "posZ": 18.74, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -194927,12 +197302,12 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2009%20The%20Scarlet%20Keys%201%20Setup%20and%20Dossiers.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2004%20The%20Forgotten%20Age%20-%20Return%20to.pdf?raw=true" }, "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "abf457", + "GUID": "908cbf", "Grid": true, "GridProjection": false, "Hands": false, @@ -194944,7 +197319,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "09 The Scarlet Keys: Setup and Dossiers", + "Nickname": "The Forgotten Age (Return to)", "Snap": true, "Sticky": true, "Tags": [ @@ -194952,9 +197327,9 @@ ], "Tooltip": true, "Transform": { - "posX": 66.336, + "posX": 66.292, "posY": 3.038, - "posZ": -20.774, + "posZ": 17.746, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -194980,7 +197355,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/09%20The%20Scarlet%20Keys.jpg?raw=true", + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/04%20Forgotten%20Age.jpg?raw=true", "MaterialIndex": 3, "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", "NormalURL": "", @@ -194989,7 +197364,7 @@ "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "11d148", + "GUID": "d5cd12", "Grid": true, "GridProjection": false, "Hands": false, @@ -195003,140 +197378,14 @@ "MeasureMovement": false, "MeshIndex": -1, "Name": "Custom_Model_Bag", - "Nickname": "09 The Scarlet Keys", + "Nickname": "04 The Forgotten Age", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 65, "posY": 1.249, - "posZ": -25.96, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2006%20The%20Dream-Eaters%20-%20B%20-%20The%20Web%20of%20Dreams.pdf?raw=true" - }, - "Description": "The Dream-Eaters", - "DragSelectable": true, - "GMNotes": "", - "GUID": "ae792e", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "The Web of Dreams (Campaign B)", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 65.358, - "posY": 3.038, - "posZ": -1.704, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/06B%20Web%20of%20Dreams.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "1bac4d", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "06B The Web of Dreams", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 56.825, - "posY": 1.249, - "posZ": -7.96, + "posZ": 17, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -195314,9 +197563,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 65, "posY": 1.249, - "posZ": 4.04, + "posZ": 11, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -195334,15 +197583,94 @@ "z": 0 }, "Autoraise": true, + "Bag": { + "Order": 0 + }, "ColorDiffuse": { "b": 1, "g": 1, "r": 1 }, - "Description": "When playing with the Return to Versions of the CYOA guides you will need to use the Return to setup card avaliable above the scenario card to modify the original setup of the game.\r\n\r\nEither version can be used to play a Standard campaign. Howevever, for Return to The Forgotten Age and The Circle Undone you will need the Return to guide.", + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2006%20The%20Dream-Eaters%20-%20A%20-%20The%20Dream-Quest.pdf?raw=true" + }, + "Description": "The Dream-Eaters", + "DragSelectable": true, + "GMNotes": "", + "GUID": "47b9c1", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "The Dream Quest (Campaign A)", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.919, + "posY": 3.038, + "posZ": 4.633, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/06A%20Dream%20Quest.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "2275ed", + "GUID": "f03c2d", "Grid": true, "GridProjection": false, "Hands": false, @@ -195352,22 +197680,636 @@ "Locked": false, "LuaScript": "", "LuaScriptState": "", + "MaterialIndex": -1, "MeasureMovement": false, - "Name": "Notecard", - "Nickname": "Return to Expansions", + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "06A The Dream-Quest", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 41.825, - "posY": 1.569, - "posZ": -32.96, + "posX": 65, + "posY": 1.249, + "posZ": 5, "rotX": 0, - "rotY": 90, + "rotY": 270, "rotZ": 0, - "scaleX": 1.25, - "scaleY": 1.25, - "scaleZ": 1.25 + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2006%20The%20Dream-Eaters%20-%20B%20-%20The%20Web%20of%20Dreams.pdf?raw=true" + }, + "Description": "The Dream-Eaters", + "DragSelectable": true, + "GMNotes": "", + "GUID": "ae792e", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "The Web of Dreams (Campaign B)", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 65.358, + "posY": 3.038, + "posZ": -1.704, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/06B%20Web%20of%20Dreams.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "1bac4d", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "06B The Web of Dreams", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": -1, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2007%20The%20Innsmouth%20Conspiracy%20-%20Play%20Order.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "f42179", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "07 The Innsmouth Conspiracy - Play Order", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 65.915, + "posY": 3.038, + "posZ": -7.148, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2007%20The%20Innsmouth%20Conspiracy%20-%20Chronolognical.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "c50a3a", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "07 The Innsmouth Conspiracy - Chronological", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.932, + "posY": 3.038, + "posZ": -8.659, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/07%20Innsmouth%20Conspiracy.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "f5f3b5", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "07 The Innsmouth Conspiracy", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": -7, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2008%20Edge%20of%20the%20Earth.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "754904", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "08 Edge of the Earth", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.88, + "posY": 3.038, + "posZ": -13.447, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/08%20Edge%20of%20the%20Earth.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "e32dc3", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "08 Edge of the Earth", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": -13, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "ContainedObjects": [ + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2009%20The%20Scarlet%20Keys%202%20Scenarios%20and%20Case%20Files.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "c6e8a0", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "09 The Scarlet Keys: Scenarios \u0026 Case Files", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.593, + "posY": 3.038, + "posZ": -20.295, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2009%20The%20Scarlet%20Keys%201%20Setup%20and%20Dossiers.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "abf457", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "09 The Scarlet Keys: Setup and Dossiers", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 66.336, + "posY": 3.038, + "posZ": -20.774, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + } + ], + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "", + "Convex": true, + "CustomShader": { + "FresnelStrength": 0, + "SpecularColor": { + "b": 1, + "g": 1, + "r": 1 + }, + "SpecularIntensity": 0, + "SpecularSharpness": 2 + }, + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/09%20The%20Scarlet%20Keys.jpg?raw=true", + "MaterialIndex": 3, + "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "11d148", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "09 The Scarlet Keys", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 65, + "posY": 1.249, + "posZ": -19, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 }, "Value": 0, "XmlUI": "" @@ -195429,9 +198371,9 @@ ], "Tooltip": true, "Transform": { - "posX": 67.349, - "posY": 3.037, - "posZ": -26.971, + "posX": 66.083, + "posY": 3.036, + "posZ": -28.162, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -195485,9 +198427,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 65, "posY": 1.249, - "posZ": -31.96, + "posZ": -25, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -195530,12 +198472,336 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/51eeefcbe1d1eded152916465d88296faf66528b/Dual%20Pages%2002%20The%20Dunwich%20Legacy.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2006%20Blob.pdf?raw=true" }, "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "8df5fc", + "GUID": "6ad284", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S1 06 The Blob that Ate Everything", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 56.811, + "posY": 3.037, + "posZ": 36.984, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2005%20Murder%20Hotel.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "b13297", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S1 05 Murder at the Excelsior Hotel", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 57.922, + "posY": 3.038, + "posZ": 37.362, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2004%20Guardians%20of%20the%20Abyss.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "6611a9", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S1 04 Guardians of the Abyss", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 59.32, + "posY": 3.037, + "posZ": 38.128, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2003%20Labyrinths.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "d014ce", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S1 03 The Labyrinths of Lunacy", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 58.243, + "posY": 3.038, + "posZ": 35.677, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2002%20Carnivale.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "538f32", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S01 02 Carinvale of Horrors", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 58.336, + "posY": 3.038, + "posZ": 37.612, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2001%20Rougarou.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "39bf7c", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "S1 01 Curse of the Rougarou", + "Snap": true, + "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore" + ], + "Tooltip": true, + "Transform": { + "posX": 59.496, + "posY": 3.036, + "posZ": 38.605, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1.76, + "scaleY": 1, + "scaleZ": 1.76 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%20Stand-Alones.pdf?raw=true" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "00a430", "Grid": true, "GridProjection": false, "Hands": false, @@ -195547,7 +198813,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "The Dunwich Legacy", + "Nickname": "S1 Stand-Alone Scenarios 2016-2020", "Snap": true, "Sticky": true, "Tags": [ @@ -195555,9 +198821,9 @@ ], "Tooltip": true, "Transform": { - "posX": 67.375, + "posX": 57.747, "posY": 3.038, - "posZ": 30.123, + "posZ": 37.913, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -195583,7 +198849,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/02%20Dunwich%20Legacy.jpg?raw=true", + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/S1%202016-2020.jpg?raw=true", "MaterialIndex": 3, "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", "NormalURL": "", @@ -195592,7 +198858,7 @@ "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "38d1cd", + "GUID": "e227ad", "Grid": true, "GridProjection": false, "Hands": false, @@ -195606,140 +198872,14 @@ "MeasureMovement": false, "MeshIndex": -1, "Name": "Custom_Model_Bag", - "Nickname": "02 The Dunwich Legacy", + "Nickname": "S1 Stand-Alones 2016-2020", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 56.5, "posY": 1.249, - "posZ": 22.04, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20C1%20Dark%20Matter.pdf?raw=true" - }, - "Description": "Designed by Axolotl", - "DragSelectable": true, - "GMNotes": "", - "GUID": "602e48", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "C1 Dark Matter", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 47.575, - "posY": 3.038, - "posZ": 36.067, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/C1%20Dark%20Matter.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "Designed by Axolotl", - "DragSelectable": true, - "GMNotes": "", - "GUID": "3a08d9", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "C1 Dark Matter", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 39.825, - "posY": 1.249, - "posZ": 28.04, + "posZ": 35, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -196025,135 +199165,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 48.325, + "posX": 56.5, "posY": 1.249, - "posZ": 22.04, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2001%20Night%20of%20the%20Zealot.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "276907", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "Night of the Zealot", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 66.463, - "posY": 3.037, - "posZ": 36.845, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/01%20Night%20of%20the%20Zealot.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "56a91d", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "01 Night of the Zealot", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 56.825, - "posY": 1.249, - "posZ": 28.04, + "posZ": 29, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -196655,234 +199669,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 48.325, + "posX": 56.5, "posY": 1.249, - "posZ": 4.04, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "Description": "To Update to the latest version of my campaign guides and their respective covers. On windows go to...\nC:\\Users\\[USERNAME]\\Documents\\My Games\\Tabletop Simulator\\Mods\nAnd search for ANTIMARKOVNIKOV.\nDelete all files find with that in the filename and reload the MOD.", - "DragSelectable": true, - "GMNotes": "", - "GUID": "a1b358", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Notecard", - "Nickname": "Updating to New Versions", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 35.825, - "posY": 1.569, - "posZ": -32.96, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 1.25, - "scaleY": 1.25, - "scaleZ": 1.25 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2004%20The%20Forgotten%20Age.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "20c2ad", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "The Forgotten Age", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 65.567, - "posY": 3.038, - "posZ": 18.74, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2004%20The%20Forgotten%20Age%20-%20Return%20to.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "908cbf", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "The Forgotten Age (Return to)", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 66.292, - "posY": 3.038, - "posZ": 17.746, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/04%20Forgotten%20Age.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "d5cd12", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "04 The Forgotten Age", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 56.825, - "posY": 1.249, - "posZ": 10.04, + "posZ": 11, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -196925,12 +199714,12 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2006%20Blob.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20P2%2002%20Relics%20of%20the%20Past.pdf?raw=true" }, - "Description": "", + "Description": "Monteray Jack", "DragSelectable": true, "GMNotes": "", - "GUID": "6ad284", + "GUID": "8950c7", "Grid": true, "GridProjection": false, "Hands": false, @@ -196942,7 +199731,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "S1 06 The Blob that Ate Everything", + "Nickname": "P2 02 Relics of the Past", "Snap": true, "Sticky": true, "Tags": [ @@ -196950,63 +199739,9 @@ ], "Tooltip": true, "Transform": { - "posX": 56.811, - "posY": 3.037, - "posZ": 36.984, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2005%20Murder%20Hotel.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b13297", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "S1 05 Murder at the Excelsior Hotel", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 57.922, + "posX": 55.589, "posY": 3.038, - "posZ": 37.362, + "posZ": 3.219, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -197033,12 +199768,12 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2004%20Guardians%20of%20the%20Abyss.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20P2%2001%20Laid%20to%20Rest.pdf?raw=true" }, - "Description": "", + "Description": "Jim Culver", "DragSelectable": true, "GMNotes": "", - "GUID": "6611a9", + "GUID": "8994ea", "Grid": true, "GridProjection": false, "Hands": false, @@ -197050,7 +199785,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "S1 04 Guardians of the Abyss", + "Nickname": "P2 01 Laid to Rest", "Snap": true, "Sticky": true, "Tags": [ @@ -197058,225 +199793,9 @@ ], "Tooltip": true, "Transform": { - "posX": 59.32, - "posY": 3.037, - "posZ": 38.128, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2003%20Labyrinths.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "d014ce", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "S1 03 The Labyrinths of Lunacy", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 58.243, + "posX": 56.648, "posY": 3.038, - "posZ": 35.677, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2002%20Carnivale.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "538f32", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "S01 02 Carinvale of Horrors", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 58.336, - "posY": 3.038, - "posZ": 37.612, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%2001%20Rougarou.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "39bf7c", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "S1 01 Curse of the Rougarou", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 59.496, - "posY": 3.036, - "posZ": 38.605, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20S1%20Stand-Alones.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "00a430", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "S1 Stand-Alone Scenarios 2016-2020", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 57.747, - "posY": 3.038, - "posZ": 37.913, + "posZ": 3.995, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -197302,7 +199821,7 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/S1%202016-2020.jpg?raw=true", + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/P2%20Challenge%20Scenarios.jpg?raw=true", "MaterialIndex": 3, "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", "NormalURL": "", @@ -197311,7 +199830,7 @@ "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "e227ad", + "GUID": "dcf492", "Grid": true, "GridProjection": false, "Hands": false, @@ -197325,14 +199844,14 @@ "MeasureMovement": false, "MeshIndex": -1, "Name": "Custom_Model_Bag", - "Nickname": "S1 Stand-Alones 2016-2020", + "Nickname": "P1 Challenge Scenarios", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 48.325, + "posX": 56.5, "posY": 1.249, - "posZ": 28.04, + "posZ": 5, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -197375,12 +199894,12 @@ "PDFPage": 0, "PDFPageOffset": 0, "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2008%20Edge%20of%20the%20Earth.pdf?raw=true" + "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%20C1%20Dark%20Matter.pdf?raw=true" }, - "Description": "", + "Description": "Designed by Axolotl", "DragSelectable": true, "GMNotes": "", - "GUID": "754904", + "GUID": "602e48", "Grid": true, "GridProjection": false, "Hands": false, @@ -197392,7 +199911,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_PDF", - "Nickname": "08 Edge of the Earth", + "Nickname": "C1 Dark Matter", "Snap": true, "Sticky": true, "Tags": [ @@ -197400,9 +199919,9 @@ ], "Tooltip": true, "Transform": { - "posX": 66.88, + "posX": 47.575, "posY": 3.038, - "posZ": -13.447, + "posZ": 36.067, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -197428,16 +199947,16 @@ "SpecularIntensity": 0, "SpecularSharpness": 2 }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/08%20Edge%20of%20the%20Earth.jpg?raw=true", + "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/C1%20Dark%20Matter.jpg?raw=true", "MaterialIndex": 3, "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", "NormalURL": "", "TypeIndex": 6 }, - "Description": "", + "Description": "Designed by Axolotl", "DragSelectable": true, "GMNotes": "", - "GUID": "e32dc3", + "GUID": "3a08d9", "Grid": true, "GridProjection": false, "Hands": false, @@ -197451,14 +199970,14 @@ "MeasureMovement": false, "MeshIndex": -1, "Name": "Custom_Model_Bag", - "Nickname": "08 Edge of the Earth", + "Nickname": "C1 Dark Matter", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": 56.825, + "posX": 48, "posY": 1.249, - "posZ": -19.96, + "posZ": 35, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -197582,315 +200101,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 39.825, + "posX": 48, "posY": 1.249, - "posZ": 22.04, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2006%20The%20Dream-Eaters%20-%20A%20-%20The%20Dream-Quest.pdf?raw=true" - }, - "Description": "The Dream-Eaters", - "DragSelectable": true, - "GMNotes": "", - "GUID": "47b9c1", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "The Dream Quest (Campaign A)", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 66.919, - "posY": 3.038, - "posZ": 4.633, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/06A%20Dream%20Quest.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "f03c2d", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "06A The Dream-Quest", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 56.825, - "posY": 1.249, - "posZ": -1.96, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "Bag": { - "Order": 0 - }, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects": [ - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2007%20The%20Innsmouth%20Conspiracy%20-%20Play%20Order.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "f42179", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "07 The Innsmouth Conspiracy - Play Order", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 65.915, - "posY": 3.038, - "posZ": -7.148, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - }, - { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "CustomPDF": { - "PDFPage": 0, - "PDFPageOffset": 0, - "PDFPassword": "", - "PDFUrl": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Dual%20Pages%2007%20The%20Innsmouth%20Conspiracy%20-%20Chronolognical.pdf?raw=true" - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "c50a3a", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "function onLoad()\n self.createInput({\n input_function = \"jumpToPage\",\n function_owner = self,\n label = \"jump to page\",\n alignment = 3,\n position = Vector(-1.6,0.1,-2.2),\n rotation = Vector(0,0,0),\n scale = Vector(0.5,0.5,0.5),\n width = 2000,\n height = 300,\n font_size = 250,\n font_color = {0.95,0.95,0.95,0.9},\n color = {0.3,0.3,0.3,0.6},\n tooltip = \"Type which page you wish to jump to, then click off\",\n value = \"\",\n validation = 1,\n tab = 1,\n })\nend\n\nfunction jumpToPage(_, _, inputValue, stillEditing)\n if inputValue == \"\" or inputValue == nil then return end -- do nothing if input is empty\n \n if not stillEditing then -- jump to page if not selecting the textbox anymore\n jump((tonumber(inputValue) + 2)/2)\n return\n elseif string.find(inputValue, \"%\\n\") ~= nil then -- jump to page if enter is pressed\n inputValue = inputValue.gsub(inputValue, \"%\\n\", \"\")\n jump((tonumber(inputValue) + 2)/2)\n return\n end\n \n if (tonumber(inputValue:sub(-1)) == nil) then -- check and remove non numeric character\n Wait.time(function()\n self.editInput({\n index = 0,\n value = inputValue:sub(1,-2)\n })\n end, 0.01)\n return\n end\nend\n\nfunction jump(page)\n self.Book.setPage(page - 1) -- offset since 0 index\n Wait.time(function() -- clear page search\n self.editInput({\n index = 0,\n value = \"\",\n })\n end, 0.01)\nend", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Custom_PDF", - "Nickname": "07 The Innsmouth Conspiracy - Chronological", - "Snap": true, - "Sticky": true, - "Tags": [ - "CleanUpHelper_ignore" - ], - "Tooltip": true, - "Transform": { - "posX": 66.932, - "posY": 3.038, - "posZ": -8.659, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1.76, - "scaleY": 1, - "scaleZ": 1.76 - }, - "Value": 0, - "XmlUI": "" - } - ], - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "CustomShader": { - "FresnelStrength": 0, - "SpecularColor": { - "b": 1, - "g": 1, - "r": 1 - }, - "SpecularIntensity": 0, - "SpecularSharpness": 2 - }, - "DiffuseURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/07%20Innsmouth%20Conspiracy.jpg?raw=true", - "MaterialIndex": 3, - "MeshURL": "https://github.com/Antimarkovnikov/TTS_AHC_CYOA/blob/master/Book%20Model.obj?raw=true", - "NormalURL": "", - "TypeIndex": 6 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "f5f3b5", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Bag", - "Nickname": "07 The Innsmouth Conspiracy", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": 56.825, - "posY": 1.249, - "posZ": -13.96, + "posZ": 29, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -198014,9 +200227,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 43.493, - "posY": 3.182, - "posZ": -22.799, + "posX": 48, + "posY": 1.249, + "posZ": 23, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -198026,6 +200239,96 @@ }, "Value": 0, "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "Description": "When playing with the Return to Versions of the CYOA guides you will need to use the Return to setup card avaliable above the scenario card to modify the original setup of the game.\r\n\r\nEither version can be used to play a Standard campaign. Howevever, for Return to The Forgotten Age and The Circle Undone you will need the Return to guide.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "2275ed", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Notecard", + "Nickname": "Return to Expansions", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 50, + "posY": 1.569, + "posZ": -26, + "rotX": 0, + "rotY": 90, + "rotZ": 0, + "scaleX": 1.25, + "scaleY": 1.25, + "scaleZ": 1.25 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "Description": "To Update to the latest version of my campaign guides and their respective covers. On windows go to...\r\nC:\\Users\\[USERNAME]\\Documents\\My Games\\Tabletop Simulator\\Mods\\PDF\r\nAnd search for httpsgithubcomAntimarkovnikov and delete all files find with that in the filename and reload the MOD.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "a1b358", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Notecard", + "Nickname": "Updating to New Versions", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 44, + "posY": 1.569, + "posZ": -26, + "rotX": 0, + "rotY": 90, + "rotZ": 0, + "scaleX": 1.25, + "scaleY": 1.25, + "scaleZ": 1.25 + }, + "Value": 0, + "XmlUI": "" } ], "CustomMesh": { @@ -198059,8 +200362,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- CYOA Campaign Guides by Antimarkovnikov, scripted by Chr1Z\r\n-- Utility memory bag by Directsun\r\n-- Version 2.7.0\r\n-- Fork of Memory Bag 2.0 by MrStump\r\n\r\nCONFIG = {\r\n MEMORY_GROUP = {\r\n -- This determines how many frames to wait before actually placing objects onto the table when the \"Place\" button is clicked.\r\n -- This gives the other bags time to recall their objects.\r\n -- The delay ONLY occurs if other bags have objects out.\r\n FRAME_DELAY_BEFORE_PLACING_OBJECTS = 30,\r\n },\r\n}\r\n\r\n--[[ Memory Bag Groups ]] -------------------------------------------------------\r\n--[[\r\nUtility Memory Bags may be added to a named group, called a \"memory group\".\r\nYou can add a bag to a group through the bag's UI: \"Setup\" \u003e \"Group Name\" (to the left of the bag).\r\nOnly one bag from a group may have it's contents placed on the table at a time.\r\nWhen \"Place\" is clicked on a bag, the other bags in it's memory group are recalled.\r\nBy default a memory bag is not in any group. It's memory group is \"nil\".\r\n--]]\r\n\r\nmemoryGroupName = { memoryBag = self }\r\nfunction memoryGroupName:get()\r\n return self._name\r\nend\r\n\r\nfunction memoryGroupName:set(newName)\r\n GlobalMemoryGroups:unregisterBagInGroup(self:get(), self.memoryBag.getGUID())\r\n GlobalMemoryGroups:registerBagInGroup(newName, self.memoryBag.getGUID())\r\n\r\n if newName == \"\" then\r\n self._name = nil\r\n else\r\n self._name = newName\r\n end\r\nend\r\n\r\n-- Click the \"Recall\" button on all other bags in my memory group.\r\nfunction recallOtherBagsInMyGroup()\r\n for _, bag in ipairs(getOtherBagsInMyGroup()) do\r\n bag.call('buttonClick_recall')\r\n end\r\nend\r\n\r\n-- Return \"true\" if another bag in my memory group has any objects out on the table.\r\nfunction anyOtherBagsInMyGroupArePlaced()\r\n for _, bag in ipairs(getOtherBagsInMyGroup()) do\r\n local state = bag.call('areAnyOfMyObjectsPlaced')\r\n if state then return true end\r\n end\r\n\r\n return false\r\nend\r\n\r\n-- Return \"true\" if at least one object from this memory bag is out on the table.\r\nfunction areAnyOfMyObjectsPlaced()\r\n for guid, _ in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then\r\n return true\r\n end\r\n end\r\n return false\r\nend\r\n\r\nfunction getOtherBagsInMyGroup()\r\n local bags = {}\r\n for bagGuid, _ in pairs(GlobalMemoryGroups:getGroup(memoryGroupName:get())) do\r\n if bagGuid ~= self.getGUID() then\r\n bag = getObjectFromGUID(bagGuid)\r\n -- \"bag\" is nill if it has been deleted since the last time onLoad() was called.\r\n if bag ~= nil then\r\n table.insert(bags, bag)\r\n end\r\n end\r\n end\r\n return bags\r\nend\r\n\r\n--[[\r\nThis object provides access to a variable stored on the \"Global script\".\r\nThe variable holds the names \u0026 guids of all memory bag groups.\r\nThe global variable is a table and holds data like this:\r\n{\r\n 'My First Group Name' = {\r\n '805ebd' = {},\r\n '35cc21' = {},\r\n 'fc8886' = {},\r\n },\r\n 'My Second Group Name' = {\r\n 'f50264' = {},\r\n '5f5f63' = {},\r\n },\r\n}\r\n--]]\r\nGlobalMemoryGroups = {\r\n NAME_OF_GLOBAL_VARIABLE = '_GlobalUtilityMemoryBagGroups',\r\n}\r\n\r\n-- Call me inside this script's \"onLoad()\" method!\r\nfunction GlobalMemoryGroups:onLoad(myGuid)\r\n -- Create and initialize the global variable if it doesn't already exist:\r\n if self:_getGroups() == nil then\r\n self:_setGroups({})\r\n end\r\nend\r\n\r\n-- Return the GUIDs of all bags in the \"groupName\". The return value is a dictionary that maps [GUID -\u003e empty table].\r\nfunction GlobalMemoryGroups:getGroup(groupName)\r\n guids = self:_getGroups()[groupName] or {}\r\n return guids\r\nend\r\n\r\n-- Registers a bag in a memory group. Creates a new group if one doesn't exist.\r\nfunction GlobalMemoryGroups:registerBagInGroup(groupName, bagGuid)\r\n if groupName == nil or groupName == \"\" then\r\n return\r\n end\r\n\r\n self:_tryCreateNewGroup(groupName)\r\n local groups = self:_getGroups()\r\n groups[groupName][bagGuid] = {}\r\n self:_setGroups(groups)\r\nend\r\n\r\n-- Removes this bag from the memory group.\r\nfunction GlobalMemoryGroups:unregisterBagInGroup(groupName, bagGuid)\r\n local groups = self:_getGroups()\r\n local group = groups[groupName]\r\n if group ~= nil then\r\n group[bagGuid] = nil\r\n self:_setGroups(groups)\r\n end\r\nend\r\n\r\n-- Return the global variable, which is a table holding all memory group names \u0026 guids.\r\nfunction GlobalMemoryGroups:_getGroups()\r\n return Global.getTable(self.NAME_OF_GLOBAL_VARIABLE)\r\nend\r\n\r\n-- Override the global variable (i.e. the entire table).\r\nfunction GlobalMemoryGroups:_setGroups(newTable)\r\n Global.setTable(self.NAME_OF_GLOBAL_VARIABLE, newTable)\r\nend\r\n\r\n-- Add a new memory group named \"groupName\" to the global variable, if one doesn't already exist.\r\nfunction GlobalMemoryGroups:_tryCreateNewGroup(groupName)\r\n local groups = self:_getGroups()\r\n if groups[groupName] == nil then\r\n groups[groupName] = {}\r\n self:_setGroups(groups)\r\n end\r\nend\r\n\r\n-- This object controls the \"Group Name\" input text field that is part of the bag's ingame UI.\r\ngroupNameInput = {\r\n greyedOutText = \"Group Name\",\r\n widthPerCharacter = 100,\r\n padding = 4,\r\n memoryBag = self,\r\n}\r\nfunction groupNameInput:create(optionalStartingValue)\r\n local effectiveText = optionalStartingValue or self.greyedOutText\r\n local width = self:computeWidth(effectiveText)\r\n\r\n self.memoryBag.createInput({\r\n label = self.greyedOutText,\r\n value = optionalStartingValue or nil,\r\n alignment = 3, -- Center aligned\r\n input_function = \"groupNameInput_onCharacterTyped\", function_owner = self.memoryBag,\r\n position = { 2.1, 0.3, 0 }, rotation = { 0, 270, 0 }, width = width, height = 350,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 },\r\n })\r\nend\r\n\r\nfunction groupNameInput:computeWidth(text)\r\n return (string.len(text) + self.padding) * self.widthPerCharacter\r\nend\r\n\r\nfunction groupNameInput:updatedWidth(text)\r\n self.memoryBag.editInput({\r\n index = 0,\r\n width = self:computeWidth(text)\r\n })\r\nend\r\n\r\nfunction groupNameInput:onCharacterTyped(text, stillEditing)\r\n if stillEditing then\r\n self:updatedWidth(text)\r\n else\r\n if text == \"\" then\r\n self:updatedWidth(self.greyedOutText)\r\n end\r\n end\r\nend\r\n\r\nfunction groupNameInput_onCharacterTyped(memoryBag, playerColor, text, stillEditing)\r\n groupNameInput:onCharacterTyped(text, stillEditing)\r\nend\r\n\r\nfunction groupNameInput:setGroupNameToInputField()\r\n local inputFields = self.memoryBag.getInputs()\r\n if inputFields ~= nil then\r\n -- Get input field 0, which corresponds to the groupNameInput.\r\n -- Unfortunately \"self.getInputs()\" doesn't return the inputs in a guaranteed order.\r\n local nameField = nil\r\n for _, field in ipairs(inputFields) do\r\n if field.index == 0 then\r\n nameField = field\r\n end\r\n end\r\n\r\n memoryGroupName:set(nameField.value)\r\n end\r\nend\r\n\r\n--//////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\nfunction updateSave()\r\n local data_to_save = { [\"ml\"] = memoryList, [\"groupName\"] = memoryGroupName:get() }\r\n saved_data = JSON.encode(data_to_save)\r\n self.script_state = saved_data\r\nend\r\n\r\nfunction combineMemoryFromBagsWithin()\r\n local bagObjList = self.getObjects()\r\n for _, bagObj in ipairs(bagObjList) do\r\n local data = bagObj.lua_script_state\r\n if data ~= nil then\r\n local j = JSON.decode(data)\r\n if j ~= nil and j.ml ~= nil then\r\n for guid, entry in pairs(j.ml) do\r\n memoryList[guid] = entry\r\n end\r\n end\r\n end\r\n end\r\nend\r\n\r\nfunction updateMemoryWithMoves()\r\n memoryList = memoryListBackup\r\n --get the first transposed object's coordinates\r\n local obj = getObjectFromGUID(moveGuid)\r\n\r\n -- p1 is where needs to go, p2 is where it was\r\n local refObjPos = memoryList[moveGuid].pos\r\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\r\n local movedRotation = obj.getRotation()\r\n for guid, entry in pairs(memoryList) do\r\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\r\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\r\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\r\n -- memoryList[guid].rot.x = movedRotation.x\r\n -- memoryList[guid].rot.y = movedRotation.y\r\n -- memoryList[guid].rot.z = movedRotation.z\r\n end\r\n\r\n --theList[obj.getGUID()] = {\r\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\r\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\r\n -- lock=obj.getLock()\r\n --}\r\n moveList = {}\r\nend\r\n\r\nfunction onload(saved_data)\r\n GlobalMemoryGroups:onLoad(self.getGUID())\r\n AllMemoryBagsInScene:add(self.getGUID())\r\n\r\n fresh = true\r\n if saved_data ~= \"\" then\r\n local loaded_data = JSON.decode(saved_data)\r\n --Set up information off of loaded_data\r\n memoryList = loaded_data.ml\r\n memoryGroupName:set(loaded_data.groupName)\r\n else\r\n --Set up information for if there is no saved saved data\r\n memoryList = {}\r\n memoryGroupName:set(nil)\r\n end\r\n\r\n moveList = {}\r\n moveGuid = nil\r\n\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n fresh = false\r\n createMemoryActionButtons()\r\n end\r\nend\r\n\r\n--Beginning Setup\r\n\r\n\r\n--Make setup button\r\nfunction createSetupButton()\r\n self.createButton({\r\n label = \"Setup\", click_function = \"buttonClick_setup\", function_owner = self,\r\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\nend\r\n\r\n--Triggered by Transpose button\r\nfunction buttonClick_transpose()\r\n moveGuid = nil\r\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", { 0.75, 0.75, 1 })\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n moveList = {}\r\n self.clearButtons()\r\n self.clearInputs()\r\n createButtonsOnAllObjects(true)\r\n createSetupActionButtons(true)\r\nend\r\n\r\n--Triggered by setup button,\r\nfunction buttonClick_setup()\r\n memoryListBackup = duplicateTable(memoryList)\r\n memoryList = {}\r\n self.clearButtons()\r\n self.clearInputs()\r\n createButtonsOnAllObjects(false)\r\n createSetupActionButtons(false)\r\nend\r\n\r\nfunction getAllObjectsInMemory()\r\n local objTable = {}\r\n local curObj = {}\r\n\r\n for guid in pairs(memoryListBackup) do\r\n curObj = getObjectFromGUID(guid)\r\n table.insert(objTable, curObj)\r\n end\r\n\r\n return objTable\r\n -- return getAllObjects()\r\nend\r\n\r\n--Creates selection buttons on objects\r\nfunction createButtonsOnAllObjects(move)\r\n buttonIndexMap = {}\r\n local howManyButtons = 0\r\n\r\n local objsToHaveButtons = {}\r\n if move == true then\r\n objsToHaveButtons = getAllObjectsInMemory()\r\n else\r\n objsToHaveButtons = getAllObjects()\r\n end\r\n\r\n for _, obj in ipairs(objsToHaveButtons) do\r\n if obj ~= self then\r\n --On a normal bag, the button positions aren't the same size as the bag.\r\n globalScaleFactor = 1 / self.getScale().x\r\n --Super sweet math to set button positions\r\n local selfPos = self.getPosition()\r\n local objPos = obj.getPosition()\r\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\r\n local objPos = rotateLocalCoordinates(deltaPos, self)\r\n objPos.x = -objPos.x * globalScaleFactor\r\n objPos.y = objPos.y * globalScaleFactor\r\n objPos.z = objPos.z * globalScaleFactor\r\n --Workaround for custom PDFs\r\n if obj.Book then\r\n objPos.y = objPos.y + 0.5\r\n end\r\n --Offset rotation of bag\r\n local rot = self.getRotation()\r\n rot.y = -rot.y + 180\r\n --Create function\r\n local funcName = \"selectButton_\" .. howManyButtons\r\n local func = function() buttonClick_selection(obj, move) end\r\n local color = { 0.75, 0.25, 0.25, 0.6 }\r\n local colorMove = { 0, 0, 1, 0.6 }\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.setVar(funcName, func)\r\n self.createButton({\r\n click_function = funcName, function_owner = self,\r\n position = objPos, rotation = rot, height = 1000, width = 1000,\r\n color = color,\r\n })\r\n buttonIndexMap[obj.getGUID()] = howManyButtons\r\n howManyButtons = howManyButtons + 1\r\n end\r\n end\r\nend\r\n\r\n--Creates submit and cancel buttons\r\nfunction createSetupActionButtons(move)\r\n self.createButton({\r\n label = \"Cancel\", click_function = \"buttonClick_cancel\", function_owner = self,\r\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n\r\n self.createButton({\r\n label = \"Submit\", click_function = \"buttonClick_submit\", function_owner = self,\r\n position = { 0, 0.3, 5.3 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n\r\n if move == false then\r\n self.createButton({\r\n label = \"Add\", click_function = \"buttonClick_add\", function_owner = self,\r\n position = { 0, 0.3, 6.1 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.25, 1, 0.25 }\r\n })\r\n\r\n self.createButton({\r\n label = \"Selection\", click_function = \"editDragSelection\", function_owner = self,\r\n position = { 0, 0.3, -4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n groupNameInput:create(memoryGroupName:get())\r\n\r\n if fresh == false then\r\n self.createButton({\r\n label = \"Set New\", click_function = \"buttonClick_setNew\", function_owner = self,\r\n position = { 0, 0.3, 6.9 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.75, 0.75, 1 }\r\n })\r\n self.createButton({\r\n label = \"Remove\", click_function = \"buttonClick_remove\", function_owner = self,\r\n position = { 0, 0.3, 7.7 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 0.25, 0.25 }\r\n })\r\n end\r\n end\r\n\r\n self.createButton({\r\n label = \"Reset\", click_function = \"buttonClick_reset\", function_owner = self,\r\n position = { 3, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\nend\r\n\r\n--During Setup\r\n\r\n\r\n--Checks or unchecks buttons\r\nfunction buttonClick_selection(obj, move)\r\n local index = buttonIndexMap[obj.getGUID()]\r\n local colorMove = { 0, 0, 1, 0.6 }\r\n local color = { 0, 1, 0, 0.6 }\r\n\r\n previousGuid = selectedGuid\r\n selectedGuid = obj.getGUID()\r\n\r\n theList = memoryList\r\n if move == true then\r\n theList = moveList\r\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\r\n local prevObj = getObjectFromGUID(previousGuid)\r\n prevObj.highlightOff()\r\n self.editButton({ index = previousIndex, color = colorMove })\r\n theList[previousGuid] = nil\r\n end\r\n previousIndex = index\r\n end\r\n\r\n if theList[selectedGuid] == nil then\r\n self.editButton({ index = index, color = color })\r\n --Adding pos/rot to memory table\r\n local pos, rot = obj.getPosition(), obj.getRotation()\r\n --I need to add it like this or it won't save due to indexing issue\r\n theList[obj.getGUID()] = {\r\n pos = { x = round(pos.x, 4), y = round(pos.y, 4), z = round(pos.z, 4) },\r\n rot = { x = round(rot.x, 4), y = round(rot.y, 4), z = round(rot.z, 4) },\r\n lock = obj.getLock(),\r\n tint = obj.getColorTint()\r\n }\r\n obj.highlightOn({ 0, 1, 0 })\r\n else\r\n color = { 0.75, 0.25, 0.25, 0.6 }\r\n if move == true then\r\n color = colorMove\r\n end\r\n self.editButton({ index = index, color = color })\r\n theList[obj.getGUID()] = nil\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\nfunction editDragSelection(bagObj, player, remove)\r\n local selectedObjs = Player[player].getSelectedObjects()\r\n if not remove then\r\n for _, obj in ipairs(selectedObjs) do\r\n local index = buttonIndexMap[obj.getGUID()]\r\n --Ignore if already in the memory list, or does not have a button\r\n if index and not memoryList[obj.getGUID()] then\r\n self.editButton({ index = index, color = { 0, 1, 0, 0.6 } })\r\n --Adding pos/rot to memory table\r\n local pos, rot = obj.getPosition(), obj.getRotation()\r\n --I need to add it like this or it won't save due to indexing issue\r\n memoryList[obj.getGUID()] = {\r\n pos = { x = round(pos.x, 4), y = round(pos.y, 4), z = round(pos.z, 4) },\r\n rot = { x = round(rot.x, 4), y = round(rot.y, 4), z = round(rot.z, 4) },\r\n lock = obj.getLock(),\r\n tint = obj.getColorTint()\r\n }\r\n obj.highlightOn({ 0, 1, 0 })\r\n end\r\n end\r\n else\r\n for _, obj in ipairs(selectedObjs) do\r\n local index = buttonIndexMap[obj.getGUID()]\r\n if index and memoryList[obj.getGUID()] then\r\n color = { 0.75, 0.25, 0.25, 0.6 }\r\n self.editButton({ index = index, color = color })\r\n memoryList[obj.getGUID()] = nil\r\n obj.highlightOff()\r\n end\r\n end\r\n end\r\nend\r\n\r\n--Cancels selection process\r\nfunction buttonClick_cancel()\r\n memoryList = memoryListBackup\r\n moveList = {}\r\n self.clearButtons()\r\n self.clearInputs()\r\n if next(memoryList) == nil then\r\n createSetupButton()\r\n else\r\n createMemoryActionButtons()\r\n end\r\n removeAllHighlights()\r\n broadcastToAll(\"Selection Canceled\", { 1, 1, 1 })\r\n moveGuid = nil\r\nend\r\n\r\n--Saves selections\r\nfunction buttonClick_submit()\r\n fresh = false\r\n if next(moveList) ~= nil then\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n end\r\n if memoryListBackup[moveGuid] == nil then\r\n broadcastToAll(\"Item selected for moving is not already in memory\", { 1, 0.25, 0.25 })\r\n else\r\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", { 0.75, 0.75, 1 })\r\n self.clearButtons()\r\n self.clearInputs()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(moveList) do\r\n moveGuid = guid\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n updateMemoryWithMoves()\r\n updateSave()\r\n buttonClick_place()\r\n end\r\n elseif next(memoryList) == nil and moveGuid == nil then\r\n memoryList = memoryListBackup\r\n broadcastToAll(\"No selections made.\", { 0.75, 0.25, 0.25 })\r\n end\r\n combineMemoryFromBagsWithin()\r\n groupNameInput:setGroupNameToInputField()\r\n self.clearButtons()\r\n self.clearInputs()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\r\n updateSave()\r\n moveGuid = nil\r\nend\r\n\r\nfunction combineTables(first_table, second_table)\r\n for k, v in pairs(second_table) do first_table[k] = v end\r\nend\r\n\r\nfunction buttonClick_add()\r\n fresh = false\r\n combineTables(memoryList, memoryListBackup)\r\n broadcastToAll(\"Adding internal bags and selections to existing memory\", { 0.25, 0.75, 0.25 })\r\n combineMemoryFromBagsWithin()\r\n self.clearButtons()\r\n self.clearInputs()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_remove()\r\n broadcastToAll(\"Removing Selected Entries From Memory\", { 1.0, 0.25, 0.25 })\r\n self.clearButtons()\r\n self.clearInputs()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for guid in pairs(memoryList) do\r\n count = count + 1\r\n memoryListBackup[guid] = nil\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then obj.highlightOff() end\r\n end\r\n broadcastToAll(count .. \" Objects Removed\", { 1, 1, 1 })\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\nfunction buttonClick_setNew()\r\n broadcastToAll(\"Setting new position relative to items in memory\", { 0.75, 0.75, 1 })\r\n self.clearButtons()\r\n self.clearInputs()\r\n createMemoryActionButtons()\r\n local count = 0\r\n for _, obj in ipairs(getAllObjects()) do\r\n guid = obj.guid\r\n if memoryListBackup[guid] ~= nil then\r\n count = count + 1\r\n memoryListBackup[guid].pos = obj.getPosition()\r\n memoryListBackup[guid].rot = obj.getRotation()\r\n memoryListBackup[guid].lock = obj.getLock()\r\n memoryListBackup[guid].tint = obj.getColorTint()\r\n end\r\n end\r\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\r\n memoryList = memoryListBackup\r\n updateSave()\r\nend\r\n\r\n--Resets bag to starting status\r\nfunction buttonClick_reset()\r\n fresh = true\r\n memoryList = {}\r\n memoryGroupName:set(nil)\r\n self.clearButtons()\r\n self.clearInputs()\r\n createSetupButton()\r\n removeAllHighlights()\r\n broadcastToAll(\"Tool Reset\", { 1, 1, 1 })\r\n updateSave()\r\nend\r\n\r\n--After Setup\r\n\r\n\r\n--Creates recall and place buttons\r\nfunction createMemoryActionButtons()\r\n self.createButton({\r\n label = \"Place\", click_function = \"buttonClick_place\", function_owner = self,\r\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n self.createButton({\r\n label = \"Recall\", click_function = \"buttonClick_recall\", function_owner = self,\r\n position = { 0, 0.3, 5.3 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n self.createButton({\r\n label = \"Setup\", click_function = \"buttonClick_setup\", function_owner = self,\r\n position = { 3, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\r\n })\r\n self.createButton({\r\n label = \"Move\", click_function = \"buttonClick_transpose\", function_owner = self,\r\n position = { 3.8, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\r\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.75, 0.75, 1 }\r\n })\r\nend\r\n\r\n--Sends objects from bag/table to their saved position/rotation\r\nfunction buttonClick_place()\r\n if anyOtherBagsInMyGroupArePlaced() then\r\n recallOtherBagsInMyGroup()\r\n Wait.frames(_placeObjects, CONFIG.MEMORY_GROUP.FRAME_DELAY_BEFORE_PLACING_OBJECTS)\r\n else\r\n _placeObjects()\r\n end\r\nend\r\n\r\nfunction _placeObjects()\r\n local bagObjList = self.getObjects()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n --If obj is out on the table, move it to the saved pos/rot\r\n if obj ~= nil then\r\n obj.setPositionSmooth(entry.pos)\r\n obj.setRotationSmooth(entry.rot)\r\n obj.setLock(entry.lock)\r\n obj.setColorTint(entry.tint)\r\n else\r\n --If obj is inside of the bag\r\n for _, bagObj in ipairs(bagObjList) do\r\n if bagObj.guid == guid then\r\n local item = self.takeObject({\r\n guid = guid, position = entry.pos, rotation = entry.rot, smooth = false\r\n })\r\n item.setLock(entry.lock)\r\n item.setColorTint(entry.tint)\r\n break\r\n end\r\n end\r\n end\r\n end\r\n broadcastToAll(\"Objects Placed\", { 1, 1, 1 })\r\nend\r\n\r\n--Recalls objects to bag from table\r\nfunction buttonClick_recall()\r\n for guid, entry in pairs(memoryList) do\r\n local obj = getObjectFromGUID(guid)\r\n if obj ~= nil then self.putObject(obj) end\r\n end\r\n broadcastToAll(\"Objects Recalled\", { 1, 1, 1 })\r\nend\r\n\r\n--Utility functions\r\n\r\n\r\n--Find delta (difference) between 2 x/y/z coordinates\r\nfunction findOffsetDistance(p1, p2, obj)\r\n local yOffset = 0\r\n if obj ~= nil then\r\n local bounds = obj.getBounds()\r\n yOffset = (bounds.size.y - bounds.offset.y)\r\n end\r\n local deltaPos = {}\r\n deltaPos.x = (p2.x - p1.x)\r\n deltaPos.y = (p2.y - p1.y) + yOffset\r\n deltaPos.z = (p2.z - p1.z)\r\n return deltaPos\r\nend\r\n\r\n--Used to rotate a set of coordinates by an angle\r\nfunction rotateLocalCoordinates(desiredPos, obj)\r\n local objPos, objRot = obj.getPosition(), obj.getRotation()\r\n local angle = math.rad(objRot.y)\r\n local x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\r\n local z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\r\n --return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\r\n return { x = x, y = desiredPos.y, z = z }\r\nend\r\n\r\nfunction rotateMyCoordinates(desiredPos, obj)\r\n local angle = math.rad(obj.getRotation().y)\r\n local x = desiredPos.x * math.sin(angle)\r\n local z = desiredPos.z * math.cos(angle)\r\n return { x = x, y = desiredPos.y, z = z }\r\nend\r\n\r\n--Coroutine delay, in seconds\r\nfunction wait(time)\r\n local start = os.time()\r\n repeat coroutine.yield(0) until os.time() \u003e start + time\r\nend\r\n\r\n--Duplicates a table (needed to prevent it making reference to the same objects)\r\nfunction duplicateTable(oldTable)\r\n local newTable = {}\r\n for k, v in pairs(oldTable) do\r\n newTable[k] = v\r\n end\r\n return newTable\r\nend\r\n\r\n--Moves scripted highlight from all objects\r\nfunction removeAllHighlights()\r\n for _, obj in ipairs(getAllObjects()) do\r\n obj.highlightOff()\r\n end\r\nend\r\n\r\n--Round number (num) to the Nth decimal (dec)\r\nfunction round(num, dec)\r\n local mult = 10 ^ (dec or 0)\r\n return math.floor(num * mult + 0.5) / mult\r\nend\r\n\r\n--[[\r\nThis object provides access to a variable stored on the \"Global script\".\r\nThe variable holds the GUIDs for every Utility Memory Bag in the scene.\r\nExample:\r\n{'805ebd', '35cc21', 'fc8886', 'f50264', '5f5f63'}\r\n--]]\r\nAllMemoryBagsInScene = {\r\n NAME_OF_GLOBAL_VARIABLE = \"_UtilityMemoryBag_AllMemoryBagsInScene\"\r\n}\r\n\r\nfunction AllMemoryBagsInScene:add(guid)\r\n local guids = Global.getTable(self.NAME_OF_GLOBAL_VARIABLE) or {}\r\n table.insert(guids, guid)\r\n Global.setTable(self.NAME_OF_GLOBAL_VARIABLE, guids)\r\nend\r\n\r\nfunction AllMemoryBagsInScene:getGuidList()\r\n return Global.getTable(self.NAME_OF_GLOBAL_VARIABLE) or {}\r\nend\r\n\r", - "LuaScriptState": "{\"ml\":{\"06a742\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":16.0398769378662},\"rot\":{\"x\":0,\"y\":269.9891,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"11d148\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-25.9601230621338},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"1bac4d\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-7.96012306213379},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"20d53c\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":4.03987693786621},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"2275ed\":{\"lock\":false,\"pos\":{\"x\":41.8248138427734,\"y\":1.56903828582764,\"z\":-32.9601230621338},\"rot\":{\"x\":0,\"y\":90.0118,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"2e50cf\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-31.9601230621338},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"38d1cd\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":22.0398769378662},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"3a08d9\":{\"lock\":false,\"pos\":{\"x\":39.8248138427734,\"y\":1.24943828582764,\"z\":28.0398769378662},\"rot\":{\"x\":0,\"y\":270.0101,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"4c47d8\":{\"lock\":false,\"pos\":{\"x\":48.3248138427734,\"y\":1.24943828582764,\"z\":22.0398769378662},\"rot\":{\"x\":0,\"y\":270.0195,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"56a91d\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":28.0398769378662},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"8f7e04\":{\"lock\":false,\"pos\":{\"x\":48.3248138427734,\"y\":1.24943828582764,\"z\":4.03987693786621},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"a1b358\":{\"lock\":false,\"pos\":{\"x\":35.8248138427734,\"y\":1.56903828582764,\"z\":-32.9601230621338},\"rot\":{\"x\":0,\"y\":89.9871,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"d5cd12\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":10.0398769378662},\"rot\":{\"x\":0,\"y\":270.0119,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"e227ad\":{\"lock\":false,\"pos\":{\"x\":48.3248138427734,\"y\":1.24943828582764,\"z\":28.0398769378662},\"rot\":{\"x\":0,\"y\":269.9818,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"e32dc3\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-19.9601230621338},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"ed1d0c\":{\"lock\":false,\"pos\":{\"x\":39.8248138427734,\"y\":1.24943828582764,\"z\":22.0398769378662},\"rot\":{\"x\":0,\"y\":269.9964,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f03c2d\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-1.96012306213379},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f5f3b5\":{\"lock\":false,\"pos\":{\"x\":56.8248138427734,\"y\":1.24943828582764,\"z\":-13.9601230621338},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f72800\":{\"lock\":false,\"pos\":{\"x\":39.8248138427734,\"y\":1.24943828582764,\"z\":16.0398769378662},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}}}}", + "LuaScript": "-- CYOA Campaign Guides by Antimarkovnikov, scripted by Chr1Z\n-- Utility memory bag by Directsun\n-- Version 2.7.0\n-- Fork of Memory Bag 2.0 by MrStump\n\nCONFIG = {\n MEMORY_GROUP = {\n -- This determines how many frames to wait before actually placing objects onto the table when the \"Place\" button is clicked.\n -- This gives the other bags time to recall their objects.\n -- The delay ONLY occurs if other bags have objects out.\n FRAME_DELAY_BEFORE_PLACING_OBJECTS = 30,\n },\n}\n\n--[[ Memory Bag Groups ]] -------------------------------------------------------\n--[[\nUtility Memory Bags may be added to a named group, called a \"memory group\".\nYou can add a bag to a group through the bag's UI: \"Setup\" \u003e \"Group Name\" (to the left of the bag).\nOnly one bag from a group may have it's contents placed on the table at a time.\nWhen \"Place\" is clicked on a bag, the other bags in it's memory group are recalled.\nBy default a memory bag is not in any group. It's memory group is \"nil\".\n--]]\n\nmemoryGroupName = { memoryBag = self }\nfunction memoryGroupName:get()\n return self._name\nend\n\nfunction memoryGroupName:set(newName)\n GlobalMemoryGroups:unregisterBagInGroup(self:get(), self.memoryBag.getGUID())\n GlobalMemoryGroups:registerBagInGroup(newName, self.memoryBag.getGUID())\n\n if newName == \"\" then\n self._name = nil\n else\n self._name = newName\n end\nend\n\n-- Click the \"Recall\" button on all other bags in my memory group.\nfunction recallOtherBagsInMyGroup()\n for _, bag in ipairs(getOtherBagsInMyGroup()) do\n bag.call('buttonClick_recall')\n end\nend\n\n-- Return \"true\" if another bag in my memory group has any objects out on the table.\nfunction anyOtherBagsInMyGroupArePlaced()\n for _, bag in ipairs(getOtherBagsInMyGroup()) do\n local state = bag.call('areAnyOfMyObjectsPlaced')\n if state then return true end\n end\n\n return false\nend\n\n-- Return \"true\" if at least one object from this memory bag is out on the table.\nfunction areAnyOfMyObjectsPlaced()\n for guid, _ in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then\n return true\n end\n end\n return false\nend\n\nfunction getOtherBagsInMyGroup()\n local bags = {}\n for bagGuid, _ in pairs(GlobalMemoryGroups:getGroup(memoryGroupName:get())) do\n if bagGuid ~= self.getGUID() then\n bag = getObjectFromGUID(bagGuid)\n -- \"bag\" is nill if it has been deleted since the last time onLoad() was called.\n if bag ~= nil then\n table.insert(bags, bag)\n end\n end\n end\n return bags\nend\n\n--[[\nThis object provides access to a variable stored on the \"Global script\".\nThe variable holds the names \u0026 guids of all memory bag groups.\nThe global variable is a table and holds data like this:\n{\n 'My First Group Name' = {\n '805ebd' = {},\n '35cc21' = {},\n 'fc8886' = {},\n },\n 'My Second Group Name' = {\n 'f50264' = {},\n '5f5f63' = {},\n },\n}\n--]]\nGlobalMemoryGroups = {\n NAME_OF_GLOBAL_VARIABLE = '_GlobalUtilityMemoryBagGroups',\n}\n\n-- Call me inside this script's \"onLoad()\" method!\nfunction GlobalMemoryGroups:onLoad(myGuid)\n -- Create and initialize the global variable if it doesn't already exist:\n if self:_getGroups() == nil then\n self:_setGroups({})\n end\nend\n\n-- Return the GUIDs of all bags in the \"groupName\". The return value is a dictionary that maps [GUID -\u003e empty table].\nfunction GlobalMemoryGroups:getGroup(groupName)\n guids = self:_getGroups()[groupName] or {}\n return guids\nend\n\n-- Registers a bag in a memory group. Creates a new group if one doesn't exist.\nfunction GlobalMemoryGroups:registerBagInGroup(groupName, bagGuid)\n if groupName == nil or groupName == \"\" then\n return\n end\n\n self:_tryCreateNewGroup(groupName)\n local groups = self:_getGroups()\n groups[groupName][bagGuid] = {}\n self:_setGroups(groups)\nend\n\n-- Removes this bag from the memory group.\nfunction GlobalMemoryGroups:unregisterBagInGroup(groupName, bagGuid)\n local groups = self:_getGroups()\n local group = groups[groupName]\n if group ~= nil then\n group[bagGuid] = nil\n self:_setGroups(groups)\n end\nend\n\n-- Return the global variable, which is a table holding all memory group names \u0026 guids.\nfunction GlobalMemoryGroups:_getGroups()\n return Global.getTable(self.NAME_OF_GLOBAL_VARIABLE)\nend\n\n-- Override the global variable (i.e. the entire table).\nfunction GlobalMemoryGroups:_setGroups(newTable)\n Global.setTable(self.NAME_OF_GLOBAL_VARIABLE, newTable)\nend\n\n-- Add a new memory group named \"groupName\" to the global variable, if one doesn't already exist.\nfunction GlobalMemoryGroups:_tryCreateNewGroup(groupName)\n local groups = self:_getGroups()\n if groups[groupName] == nil then\n groups[groupName] = {}\n self:_setGroups(groups)\n end\nend\n\n-- This object controls the \"Group Name\" input text field that is part of the bag's ingame UI.\ngroupNameInput = {\n greyedOutText = \"Group Name\",\n widthPerCharacter = 100,\n padding = 4,\n memoryBag = self,\n}\nfunction groupNameInput:create(optionalStartingValue)\n local effectiveText = optionalStartingValue or self.greyedOutText\n local width = self:computeWidth(effectiveText)\n\n self.memoryBag.createInput({\n label = self.greyedOutText,\n value = optionalStartingValue or nil,\n alignment = 3, -- Center aligned\n input_function = \"groupNameInput_onCharacterTyped\", function_owner = self.memoryBag,\n position = { 2.1, 0.3, 0 }, rotation = { 0, 270, 0 }, width = width, height = 350,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 },\n })\nend\n\nfunction groupNameInput:computeWidth(text)\n return (string.len(text) + self.padding) * self.widthPerCharacter\nend\n\nfunction groupNameInput:updatedWidth(text)\n self.memoryBag.editInput({\n index = 0,\n width = self:computeWidth(text)\n })\nend\n\nfunction groupNameInput:onCharacterTyped(text, stillEditing)\n if stillEditing then\n self:updatedWidth(text)\n else\n if text == \"\" then\n self:updatedWidth(self.greyedOutText)\n end\n end\nend\n\nfunction groupNameInput_onCharacterTyped(memoryBag, playerColor, text, stillEditing)\n groupNameInput:onCharacterTyped(text, stillEditing)\nend\n\nfunction groupNameInput:setGroupNameToInputField()\n local inputFields = self.memoryBag.getInputs()\n if inputFields ~= nil then\n -- Get input field 0, which corresponds to the groupNameInput.\n -- Unfortunately \"self.getInputs()\" doesn't return the inputs in a guaranteed order.\n local nameField = nil\n for _, field in ipairs(inputFields) do\n if field.index == 0 then\n nameField = field\n end\n end\n\n memoryGroupName:set(nameField.value)\n end\nend\n\n--//////////////////////////////////////////////////////////////////////////////\n\n\nfunction updateSave()\n local data_to_save = { [\"ml\"] = memoryList, [\"groupName\"] = memoryGroupName:get() }\n saved_data = JSON.encode(data_to_save)\n self.script_state = saved_data\nend\n\nfunction combineMemoryFromBagsWithin()\n local bagObjList = self.getObjects()\n for _, bagObj in ipairs(bagObjList) do\n local data = bagObj.lua_script_state\n if data ~= nil then\n local j = JSON.decode(data)\n if j ~= nil and j.ml ~= nil then\n for guid, entry in pairs(j.ml) do\n memoryList[guid] = entry\n end\n end\n end\n end\nend\n\nfunction updateMemoryWithMoves()\n memoryList = memoryListBackup\n --get the first transposed object's coordinates\n local obj = getObjectFromGUID(moveGuid)\n\n -- p1 is where needs to go, p2 is where it was\n local refObjPos = memoryList[moveGuid].pos\n local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)\n local movedRotation = obj.getRotation()\n for guid, entry in pairs(memoryList) do\n memoryList[guid].pos.x = entry.pos.x - deltaPos.x\n memoryList[guid].pos.y = entry.pos.y - deltaPos.y\n memoryList[guid].pos.z = entry.pos.z - deltaPos.z\n -- memoryList[guid].rot.x = movedRotation.x\n -- memoryList[guid].rot.y = movedRotation.y\n -- memoryList[guid].rot.z = movedRotation.z\n end\n\n --theList[obj.getGUID()] = {\n -- pos={x=round(pos.x,4), y=round(pos.y,4), z=round(pos.z,4)},\n -- rot={x=round(rot.x,4), y=round(rot.y,4), z=round(rot.z,4)},\n -- lock=obj.getLock()\n --}\n moveList = {}\nend\n\nfunction onload(saved_data)\n GlobalMemoryGroups:onLoad(self.getGUID())\n AllMemoryBagsInScene:add(self.getGUID())\n\n fresh = true\n if saved_data ~= \"\" then\n local loaded_data = JSON.decode(saved_data)\n --Set up information off of loaded_data\n memoryList = loaded_data.ml\n memoryGroupName:set(loaded_data.groupName)\n else\n --Set up information for if there is no saved saved data\n memoryList = {}\n memoryGroupName:set(nil)\n end\n\n moveList = {}\n moveGuid = nil\n\n if next(memoryList) == nil then\n createSetupButton()\n else\n fresh = false\n createMemoryActionButtons()\n end\nend\n\n--Beginning Setup\n\n\n--Make setup button\nfunction createSetupButton()\n self.createButton({\n label = \"Setup\", click_function = \"buttonClick_setup\", function_owner = self,\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\nend\n\n--Triggered by Transpose button\nfunction buttonClick_transpose()\n moveGuid = nil\n broadcastToAll(\"Select one object and move it- all objects will move relative to the new location\", { 0.75, 0.75, 1 })\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n moveList = {}\n self.clearButtons()\n self.clearInputs()\n createButtonsOnAllObjects(true)\n createSetupActionButtons(true)\nend\n\n--Triggered by setup button,\nfunction buttonClick_setup()\n memoryListBackup = duplicateTable(memoryList)\n memoryList = {}\n self.clearButtons()\n self.clearInputs()\n createButtonsOnAllObjects(false)\n createSetupActionButtons(false)\nend\n\nfunction getAllObjectsInMemory()\n local objTable = {}\n local curObj = {}\n\n for guid in pairs(memoryListBackup) do\n curObj = getObjectFromGUID(guid)\n table.insert(objTable, curObj)\n end\n\n return objTable\n -- return getAllObjects()\nend\n\n--Creates selection buttons on objects\nfunction createButtonsOnAllObjects(move)\n buttonIndexMap = {}\n local howManyButtons = 0\n\n local objsToHaveButtons = {}\n if move == true then\n objsToHaveButtons = getAllObjectsInMemory()\n else\n objsToHaveButtons = getAllObjects()\n end\n\n for _, obj in ipairs(objsToHaveButtons) do\n if obj ~= self then\n --On a normal bag, the button positions aren't the same size as the bag.\n globalScaleFactor = 1 / self.getScale().x\n --Super sweet math to set button positions\n local selfPos = self.getPosition()\n local objPos = obj.getPosition()\n local deltaPos = findOffsetDistance(selfPos, objPos, obj)\n local objPos = rotateLocalCoordinates(deltaPos, self)\n objPos.x = -objPos.x * globalScaleFactor\n objPos.y = objPos.y * globalScaleFactor\n objPos.z = objPos.z * globalScaleFactor\n --Workaround for custom PDFs\n if obj.Book then\n objPos.y = objPos.y + 0.5\n end\n --Offset rotation of bag\n local rot = self.getRotation()\n rot.y = -rot.y + 180\n --Create function\n local funcName = \"selectButton_\" .. howManyButtons\n local func = function() buttonClick_selection(obj, move) end\n local color = { 0.75, 0.25, 0.25, 0.6 }\n local colorMove = { 0, 0, 1, 0.6 }\n if move == true then\n color = colorMove\n end\n self.setVar(funcName, func)\n self.createButton({\n click_function = funcName, function_owner = self,\n position = objPos, rotation = rot, height = 1000, width = 1000,\n color = color,\n })\n buttonIndexMap[obj.getGUID()] = howManyButtons\n howManyButtons = howManyButtons + 1\n end\n end\nend\n\n--Creates submit and cancel buttons\nfunction createSetupActionButtons(move)\n self.createButton({\n label = \"Cancel\", click_function = \"buttonClick_cancel\", function_owner = self,\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n\n self.createButton({\n label = \"Submit\", click_function = \"buttonClick_submit\", function_owner = self,\n position = { 0, 0.3, 5.3 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n\n if move == false then\n self.createButton({\n label = \"Add\", click_function = \"buttonClick_add\", function_owner = self,\n position = { 0, 0.3, 6.1 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.25, 1, 0.25 }\n })\n\n self.createButton({\n label = \"Selection\", click_function = \"editDragSelection\", function_owner = self,\n position = { 0, 0.3, -4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n groupNameInput:create(memoryGroupName:get())\n\n if fresh == false then\n self.createButton({\n label = \"Set New\", click_function = \"buttonClick_setNew\", function_owner = self,\n position = { 0, 0.3, 6.9 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.75, 0.75, 1 }\n })\n self.createButton({\n label = \"Remove\", click_function = \"buttonClick_remove\", function_owner = self,\n position = { 0, 0.3, 7.7 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 0.25, 0.25 }\n })\n end\n end\n\n self.createButton({\n label = \"Reset\", click_function = \"buttonClick_reset\", function_owner = self,\n position = { 3, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\nend\n\n--During Setup\n\n\n--Checks or unchecks buttons\nfunction buttonClick_selection(obj, move)\n local index = buttonIndexMap[obj.getGUID()]\n local colorMove = { 0, 0, 1, 0.6 }\n local color = { 0, 1, 0, 0.6 }\n\n previousGuid = selectedGuid\n selectedGuid = obj.getGUID()\n\n theList = memoryList\n if move == true then\n theList = moveList\n if previousGuid ~= nil and previousGuid ~= selectedGuid then\n local prevObj = getObjectFromGUID(previousGuid)\n prevObj.highlightOff()\n self.editButton({ index = previousIndex, color = colorMove })\n theList[previousGuid] = nil\n end\n previousIndex = index\n end\n\n if theList[selectedGuid] == nil then\n self.editButton({ index = index, color = color })\n --Adding pos/rot to memory table\n local pos, rot = obj.getPosition(), obj.getRotation()\n --I need to add it like this or it won't save due to indexing issue\n theList[obj.getGUID()] = {\n pos = { x = round(pos.x, 4), y = round(pos.y, 4), z = round(pos.z, 4) },\n rot = { x = round(rot.x, 4), y = round(rot.y, 4), z = round(rot.z, 4) },\n lock = obj.getLock(),\n tint = obj.getColorTint()\n }\n obj.highlightOn({ 0, 1, 0 })\n else\n color = { 0.75, 0.25, 0.25, 0.6 }\n if move == true then\n color = colorMove\n end\n self.editButton({ index = index, color = color })\n theList[obj.getGUID()] = nil\n obj.highlightOff()\n end\nend\n\nfunction editDragSelection(bagObj, player, remove)\n local selectedObjs = Player[player].getSelectedObjects()\n if not remove then\n for _, obj in ipairs(selectedObjs) do\n local index = buttonIndexMap[obj.getGUID()]\n --Ignore if already in the memory list, or does not have a button\n if index and not memoryList[obj.getGUID()] then\n self.editButton({ index = index, color = { 0, 1, 0, 0.6 } })\n --Adding pos/rot to memory table\n local pos, rot = obj.getPosition(), obj.getRotation()\n --I need to add it like this or it won't save due to indexing issue\n memoryList[obj.getGUID()] = {\n pos = { x = round(pos.x, 4), y = round(pos.y, 4), z = round(pos.z, 4) },\n rot = { x = round(rot.x, 4), y = round(rot.y, 4), z = round(rot.z, 4) },\n lock = obj.getLock(),\n tint = obj.getColorTint()\n }\n obj.highlightOn({ 0, 1, 0 })\n end\n end\n else\n for _, obj in ipairs(selectedObjs) do\n local index = buttonIndexMap[obj.getGUID()]\n if index and memoryList[obj.getGUID()] then\n color = { 0.75, 0.25, 0.25, 0.6 }\n self.editButton({ index = index, color = color })\n memoryList[obj.getGUID()] = nil\n obj.highlightOff()\n end\n end\n end\nend\n\n--Cancels selection process\nfunction buttonClick_cancel()\n memoryList = memoryListBackup\n moveList = {}\n self.clearButtons()\n self.clearInputs()\n if next(memoryList) == nil then\n createSetupButton()\n else\n createMemoryActionButtons()\n end\n removeAllHighlights()\n broadcastToAll(\"Selection Canceled\", { 1, 1, 1 })\n moveGuid = nil\nend\n\n--Saves selections\nfunction buttonClick_submit()\n fresh = false\n if next(moveList) ~= nil then\n for guid in pairs(moveList) do\n moveGuid = guid\n end\n if memoryListBackup[moveGuid] == nil then\n broadcastToAll(\"Item selected for moving is not already in memory\", { 1, 0.25, 0.25 })\n else\n broadcastToAll(\"Moving all items in memory relative to new objects position!\", { 0.75, 0.75, 1 })\n self.clearButtons()\n self.clearInputs()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(moveList) do\n moveGuid = guid\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n updateMemoryWithMoves()\n updateSave()\n buttonClick_place()\n end\n elseif next(memoryList) == nil and moveGuid == nil then\n memoryList = memoryListBackup\n broadcastToAll(\"No selections made.\", { 0.75, 0.25, 0.25 })\n end\n combineMemoryFromBagsWithin()\n groupNameInput:setGroupNameToInputField()\n self.clearButtons()\n self.clearInputs()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\n updateSave()\n moveGuid = nil\nend\n\nfunction combineTables(first_table, second_table)\n for k, v in pairs(second_table) do first_table[k] = v end\nend\n\nfunction buttonClick_add()\n fresh = false\n combineTables(memoryList, memoryListBackup)\n broadcastToAll(\"Adding internal bags and selections to existing memory\", { 0.25, 0.75, 0.25 })\n combineMemoryFromBagsWithin()\n self.clearButtons()\n self.clearInputs()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\n updateSave()\nend\n\nfunction buttonClick_remove()\n broadcastToAll(\"Removing Selected Entries From Memory\", { 1.0, 0.25, 0.25 })\n self.clearButtons()\n self.clearInputs()\n createMemoryActionButtons()\n local count = 0\n for guid in pairs(memoryList) do\n count = count + 1\n memoryListBackup[guid] = nil\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then obj.highlightOff() end\n end\n broadcastToAll(count .. \" Objects Removed\", { 1, 1, 1 })\n memoryList = memoryListBackup\n updateSave()\nend\n\nfunction buttonClick_setNew()\n broadcastToAll(\"Setting new position relative to items in memory\", { 0.75, 0.75, 1 })\n self.clearButtons()\n self.clearInputs()\n createMemoryActionButtons()\n local count = 0\n for _, obj in ipairs(getAllObjects()) do\n guid = obj.guid\n if memoryListBackup[guid] ~= nil then\n count = count + 1\n memoryListBackup[guid].pos = obj.getPosition()\n memoryListBackup[guid].rot = obj.getRotation()\n memoryListBackup[guid].lock = obj.getLock()\n memoryListBackup[guid].tint = obj.getColorTint()\n end\n end\n broadcastToAll(count .. \" Objects Saved\", { 1, 1, 1 })\n memoryList = memoryListBackup\n updateSave()\nend\n\n--Resets bag to starting status\nfunction buttonClick_reset()\n fresh = true\n memoryList = {}\n memoryGroupName:set(nil)\n self.clearButtons()\n self.clearInputs()\n createSetupButton()\n removeAllHighlights()\n broadcastToAll(\"Tool Reset\", { 1, 1, 1 })\n updateSave()\nend\n\n--After Setup\n\n\n--Creates recall and place buttons\nfunction createMemoryActionButtons()\n self.createButton({\n label = \"Place\", click_function = \"buttonClick_place\", function_owner = self,\n position = { 0, 0.3, 4.5 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n self.createButton({\n label = \"Recall\", click_function = \"buttonClick_recall\", function_owner = self,\n position = { 0, 0.3, 5.3 }, rotation = { 0, 0, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n self.createButton({\n label = \"Setup\", click_function = \"buttonClick_setup\", function_owner = self,\n position = { 3, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }\n })\n self.createButton({\n label = \"Move\", click_function = \"buttonClick_transpose\", function_owner = self,\n position = { 3.8, 0.3, 0 }, rotation = { 0, 90, 0 }, height = 350, width = 800,\n font_size = 250, color = { 0, 0, 0 }, font_color = { 0.75, 0.75, 1 }\n })\nend\n\n--Sends objects from bag/table to their saved position/rotation\nfunction buttonClick_place()\n if anyOtherBagsInMyGroupArePlaced() then\n recallOtherBagsInMyGroup()\n Wait.frames(_placeObjects, CONFIG.MEMORY_GROUP.FRAME_DELAY_BEFORE_PLACING_OBJECTS)\n else\n _placeObjects()\n end\nend\n\nfunction _placeObjects()\n local bagObjList = self.getObjects()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n --If obj is out on the table, move it to the saved pos/rot\n if obj ~= nil then\n obj.setPositionSmooth(entry.pos)\n obj.setRotationSmooth(entry.rot)\n obj.setLock(entry.lock)\n obj.setColorTint(entry.tint)\n else\n --If obj is inside of the bag\n for _, bagObj in ipairs(bagObjList) do\n if bagObj.guid == guid then\n local item = self.takeObject({\n guid = guid, position = entry.pos, rotation = entry.rot, smooth = false\n })\n item.setLock(entry.lock)\n item.setColorTint(entry.tint)\n break\n end\n end\n end\n end\n broadcastToAll(\"Objects Placed\", { 1, 1, 1 })\nend\n\n--Recalls objects to bag from table\nfunction buttonClick_recall()\n for guid, entry in pairs(memoryList) do\n local obj = getObjectFromGUID(guid)\n if obj ~= nil then self.putObject(obj) end\n end\n broadcastToAll(\"Objects Recalled\", { 1, 1, 1 })\nend\n\n--Utility functions\n\n\n--Find delta (difference) between 2 x/y/z coordinates\nfunction findOffsetDistance(p1, p2, obj)\n local yOffset = 0\n if obj ~= nil then\n local bounds = obj.getBounds()\n yOffset = (bounds.size.y - bounds.offset.y)\n end\n local deltaPos = {}\n deltaPos.x = (p2.x - p1.x)\n deltaPos.y = (p2.y - p1.y) + yOffset\n deltaPos.z = (p2.z - p1.z)\n return deltaPos\nend\n\n--Used to rotate a set of coordinates by an angle\nfunction rotateLocalCoordinates(desiredPos, obj)\n local objPos, objRot = obj.getPosition(), obj.getRotation()\n local angle = math.rad(objRot.y)\n local x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)\n local z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)\n --return {x=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}\n return { x = x, y = desiredPos.y, z = z }\nend\n\nfunction rotateMyCoordinates(desiredPos, obj)\n local angle = math.rad(obj.getRotation().y)\n local x = desiredPos.x * math.sin(angle)\n local z = desiredPos.z * math.cos(angle)\n return { x = x, y = desiredPos.y, z = z }\nend\n\n--Coroutine delay, in seconds\nfunction wait(time)\n local start = os.time()\n repeat coroutine.yield(0) until os.time() \u003e start + time\nend\n\n--Duplicates a table (needed to prevent it making reference to the same objects)\nfunction duplicateTable(oldTable)\n local newTable = {}\n for k, v in pairs(oldTable) do\n newTable[k] = v\n end\n return newTable\nend\n\n--Moves scripted highlight from all objects\nfunction removeAllHighlights()\n for _, obj in ipairs(getAllObjects()) do\n obj.highlightOff()\n end\nend\n\n--Round number (num) to the Nth decimal (dec)\nfunction round(num, dec)\n local mult = 10 ^ (dec or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\n--[[\nThis object provides access to a variable stored on the \"Global script\".\nThe variable holds the GUIDs for every Utility Memory Bag in the scene.\nExample:\n{'805ebd', '35cc21', 'fc8886', 'f50264', '5f5f63'}\n--]]\nAllMemoryBagsInScene = {\n NAME_OF_GLOBAL_VARIABLE = \"_UtilityMemoryBag_AllMemoryBagsInScene\"\n}\n\nfunction AllMemoryBagsInScene:add(guid)\n local guids = Global.getTable(self.NAME_OF_GLOBAL_VARIABLE) or {}\n table.insert(guids, guid)\n Global.setTable(self.NAME_OF_GLOBAL_VARIABLE, guids)\nend\n\nfunction AllMemoryBagsInScene:getGuidList()\n return Global.getTable(self.NAME_OF_GLOBAL_VARIABLE) or {}\nend\n", + "LuaScriptState": "{\"ml\":{\"06a742\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":23},\"rot\":{\"x\":0,\"y\":269.9891,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"11d148\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":-19},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"1bac4d\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":-1},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"20d53c\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":11},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"2275ed\":{\"lock\":false,\"pos\":{\"x\":50,\"y\":1.569,\"z\":-26},\"rot\":{\"x\":0,\"y\":90.0118,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"2e50cf\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":-25},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"38d1cd\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":29},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"3a08d9\":{\"lock\":false,\"pos\":{\"x\":48,\"y\":1.2494,\"z\":35},\"rot\":{\"x\":0,\"y\":270.0101,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"4c47d8\":{\"lock\":false,\"pos\":{\"x\":56.5,\"y\":1.2494,\"z\":29},\"rot\":{\"x\":0,\"y\":270.0195,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"56a91d\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":35},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"8f7e04\":{\"lock\":false,\"pos\":{\"x\":56.5,\"y\":1.2494,\"z\":11},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"a1b358\":{\"lock\":false,\"pos\":{\"x\":44,\"y\":1.569,\"z\":-26},\"rot\":{\"x\":0,\"y\":89.9871,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"d5cd12\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":17},\"rot\":{\"x\":0,\"y\":270.0119,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"dcf492\":{\"lock\":false,\"pos\":{\"x\":56.5,\"y\":1.2494,\"z\":5},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"e227ad\":{\"lock\":false,\"pos\":{\"x\":56.5,\"y\":1.2494,\"z\":35},\"rot\":{\"x\":0,\"y\":269.9818,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"e32dc3\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":-13},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"ed1d0c\":{\"lock\":false,\"pos\":{\"x\":48,\"y\":1.2494,\"z\":29},\"rot\":{\"x\":0,\"y\":269.9964,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f03c2d\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":5},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f5f3b5\":{\"lock\":false,\"pos\":{\"x\":65,\"y\":1.2494,\"z\":-7},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}},\"f72800\":{\"lock\":false,\"pos\":{\"x\":48,\"y\":1.2494,\"z\":23},\"rot\":{\"x\":0,\"y\":270,\"z\":0},\"tint\":{\"a\":1,\"b\":1,\"g\":1,\"r\":1}}}}", "MaterialIndex": -1, "MeasureMovement": false, "MeshIndex": -1, @@ -198070,9 +200373,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": 39.494, - "posY": 3.793, - "posZ": 41.744, + "posX": 51.878, + "posY": 3.366, + "posZ": -44.258, "rotX": 0, "rotY": 270, "rotZ": 0, @@ -198132,7 +200435,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/AttachmentHelper\")\nend)\n__bundle_register(\"accessories/AttachmentHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal fontColor\nlocal BACKGROUNDS = {\n {\n title = \"Ancestral Knowledge\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1915746489207287888/2F9F6F211ED0F98E66C9D35D93221E4C7FB6DD3C/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Astronomical Atlas\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695853007989004/9153BC204FC707AE564ECFAC063A11CB8C2B5D1E/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Backpack\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2018212896278691928/F55BEFFC2540109C6333179532F583B367FF2EBC/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Binder's Jar\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228642191/4C149527851C1DBB3015F93DE91667937A3F91DD/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Crystallizer of Dreams\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1915746489207280958/100F16441939E5E23818651D1EB5C209BF3125B9/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Diana Stanley\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919071208/1AB7222850201630826BFFBA8F2BD0065E2D572F/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Gloria Goldberg\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919102502/453D4426118C8A6DE2EA281184716E26CA924C84/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Ikiaq\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228198966/5A408D8D760221DEA164E986B9BE1F79C4803071/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Katja Eastbank\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228203475/62EEE12F4DB1EB80D79B087677459B954380215F/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Ravenous\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228208075/EAC598A450BEE504A7FE179288F1FBBF7ABFA3E0/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Sefina Rousseau\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Stick to the Plan\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2018214163838897493/8E38B96C5A8D703A59009A932432CBE21ABE63A2/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Subject 5U-21\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228199363/CE43D58F37C9F48BDD6E6E145FE29BADEFF4DBC5/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Wooden Sledge\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/\",\n fontcolor = { 0, 0, 0 }\n }\n}\n\n-- save state and options to restore onLoad\nfunction onSave() return JSON.encode({ cardsInBag, showCost, showIcons }) end\n\n-- load variables and create context menu\nfunction onLoad(savedData)\n local loadedData = JSON.decode(savedData)\n cardsInBag = loadedData[1] or {}\n showCost = loadedData[2] or true\n showIcons = loadedData[3] or true\n fontColor = getFontColor()\n recreateButtons()\n\n self.addContextMenuItem(\"Select image\", selectImage)\n self.addContextMenuItem(\"Toggle cost\", function(color)\n showCost = not showCost\n printToColor(\"Show cost of cards: \" .. tostring(showCost), color, \"White\")\n refresh()\n end)\n\n self.addContextMenuItem(\"Toggle skill icons\", function(color)\n showIcons = not showIcons\n printToColor(\"Show skill icons of cards: \" .. tostring(showIcons), color, \"White\")\n refresh()\n end)\nend\n\n-- gets the font color based on background url\nfunction getFontColor()\n local customInfo = self.getCustomObject()\n for i = 1, #BACKGROUNDS do\n if BACKGROUNDS[i].url == customInfo.diffuse then\n return BACKGROUNDS[i].fontcolor\n end\n end\n return { 1, 1, 1 }\nend\n\n-- attempt to load image from below card when dropped\nfunction onDrop(playerColor)\n local pos = self.getPosition():setAt(\"y\", 2)\n local search = Physics.cast({\n direction = { 0, -1, 0 },\n max_distance = 2,\n type = 3,\n size = { 0.1, 0.1, 0.1 },\n origin = pos\n })\n\n local syncName\n for _, v in ipairs(search) do\n if v.hit_object.tag == \"Card\" then\n syncName = v.hit_object.getName()\n break\n end\n end\n\n if not syncName then return end\n\n -- remove level information fron syncName\n syncName = syncName:gsub(\"%s%(%d%)\", \"\")\n\n -- loop through background table\n for _, bgInfo in ipairs(BACKGROUNDS) do\n if bgInfo.title == syncName then\n printToColor(\"Background for '\" .. syncName .. \"' loaded!\", playerColor, \"Green\")\n updateImage(bgInfo.url)\n return\n end\n end\n printToColor(\"Didn't find background for '\" .. syncName .. \"'!\", playerColor, \"Orange\")\nend\n\n-- called by context menu to change background image\nfunction selectImage(color)\n -- generate list of options\n local options = {}\n for i = 1, #BACKGROUNDS do\n options[i] = BACKGROUNDS[i].title\n end\n\n -- prompt user to select option\n Player[color].showOptionsDialog(\"Select image:\", options, 1, function(_, optionIndex)\n updateImage(BACKGROUNDS[optionIndex].url)\n end)\nend\n\n-- sets background to the provided URL\nfunction updateImage(url)\n self.script_state = JSON.encode({ cardsInBag, showCost, showIcons })\n local customInfo = self.getCustomObject()\n customInfo.diffuse = url\n self.setCustomObject(customInfo)\n self.reload()\nend\n\n-- only allow cards to enter, split decks and reject other objects\nfunction onObjectEnterContainer(container, object)\n if container ~= self then return end\n if object.tag == \"Deck\" then\n takeDeckOut(object.getGUID(), self.getPosition() + Vector(0, 0.1, 0))\n elseif object.tag ~= \"Card\" then\n broadcastToAll(\"The 'Attachment Helper' is meant to be used for cards.\", \"White\")\n else\n findCard(object.getGUID(), object.getName(), object.getGMNotes())\n recreateButtons()\n end\nend\n\n-- takes the deck out and splits in into single cards\nfunction takeDeckOut(guid, pos)\n local deck = self.takeObject({ guid = guid, position = pos, smooth = false })\n for i = 1, #deck.getObjects() do\n self.putObject(deck.takeObject({ position = pos + Vector(0, 0.1 * i, 0), smooth = false }))\n end\nend\n\n-- removes leaving cards from the \"cardInBag\" table\nfunction onObjectLeaveContainer(container, object)\n if container == self then\n local guid = object.getGUID()\n local found = false\n for i, card in ipairs(cardsInBag) do\n if card.id == guid then\n table.remove(cardsInBag, i)\n found = true\n break\n end\n end\n\n if found ~= true then\n local name = object.getName()\n for i, card in ipairs(cardsInBag) do\n if card.name == name then\n table.remove(cardsInBag, i)\n break\n end\n end\n end\n recreateButtons()\n end\nend\n\n-- refreshes displayed buttons based on contained cards\nfunction refresh()\n cardsInBag = {}\n for _, object in ipairs(self.getObjects()) do\n findCard(object.guid, object.name, object.gm_notes)\n end\n recreateButtons()\nend\n\n-- gets cost and icons for a card\nfunction findCard(guid, name, GMNotes)\n local cost = \"\"\n local icons = {}\n local metadata = {}\n local displayName = name\n\n if displayName == nil or displayName == \"\" then displayName = \"unnamed\" end\n if showCost or showIcons then metadata = JSON.decode(GMNotes) end\n\n if showCost then\n if GMNotes ~= \"\" then cost = metadata.cost end\n if cost == nil or cost == \"\" then cost = \"–\" end\n displayName = \"[\" .. cost .. \"] \" .. displayName\n end\n\n if showIcons then\n if GMNotes ~= \"\" then\n icons[1] = metadata.wildIcons\n icons[2] = metadata.willpowerIcons\n icons[3] = metadata.intellectIcons\n icons[4] = metadata.combatIcons\n icons[5] = metadata.agilityIcons\n end\n\n local IconTypes = { \"Wild\", \"Willpower\", \"Intellect\", \"Combat\", \"Agility\" }\n local found = false\n for i = 1, 5 do\n if icons[i] ~= nil and icons[i] ~= \"\" then\n if found == false then\n displayName = displayName .. \"\\n\" .. IconTypes[i] .. \": \" .. icons[i]\n found = true\n else\n displayName = displayName .. \" \" .. IconTypes[i] .. \": \" .. icons[i]\n end\n end\n end\n end\n table.insert(cardsInBag, { name = name, displayName = displayName, id = guid })\nend\n\n-- recreates buttons with up-to-date labels\nfunction recreateButtons()\n self.clearButtons()\n local verticalPosition = 1.65\n\n for _, card in ipairs(cardsInBag) do\n local id = card.id\n local funcName = \"removeCard\" .. id\n self.setVar(funcName, function() removeCard(id) end)\n self.createButton({\n label = card.displayName,\n click_function = funcName,\n function_owner = self,\n position = { 0, -0.1, verticalPosition },\n height = 200,\n width = 1200,\n font_size = string.len(card.displayName) \u003e 20 and 75 or 100\n })\n verticalPosition = verticalPosition - 0.5\n end\n\n local countLabel = #cardsInBag\n local fontSize = 250\n if #cardsInBag == 0 then\n countLabel = \"Attachment Helper\"\n fontSize = 150\n end\n\n self.createButton({\n label = countLabel,\n click_function = \"none\",\n function_owner = self,\n position = { 0, -0.1, -1.7 },\n height = 0,\n width = 0,\n font_size = fontSize,\n font_color = fontColor\n })\nend\n\n-- click-function for buttons to take a card out of the bag\nfunction removeCard(cardGUID)\n self.takeObject({\n guid = cardGUID,\n rotation = self.getRotation(),\n position = self.getPosition() + Vector(0, 0.25, 0),\n callback_function = function(obj) obj.resting = true end\n })\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/AttachmentHelper\")\nend)\n__bundle_register(\"accessories/AttachmentHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nlocal fontColor\nlocal BACKGROUNDS = {\n {\n title = \"Ancestral Knowledge\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1915746489207287888/2F9F6F211ED0F98E66C9D35D93221E4C7FB6DD3C/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Astronomical Atlas\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695853007989004/9153BC204FC707AE564ECFAC063A11CB8C2B5D1E/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Backpack\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2018212896278691928/F55BEFFC2540109C6333179532F583B367FF2EBC/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Binder's Jar\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228642191/4C149527851C1DBB3015F93DE91667937A3F91DD/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Crystallizer of Dreams\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1915746489207280958/100F16441939E5E23818651D1EB5C209BF3125B9/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Diana Stanley\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919071208/1AB7222850201630826BFFBA8F2BD0065E2D572F/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Gloria Goldberg\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919102502/453D4426118C8A6DE2EA281184716E26CA924C84/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Ikiaq\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228198966/5A408D8D760221DEA164E986B9BE1F79C4803071/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Katja Eastbank\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228203475/62EEE12F4DB1EB80D79B087677459B954380215F/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Ravenous\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228208075/EAC598A450BEE504A7FE179288F1FBBF7ABFA3E0/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Sefina Rousseau\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/\",\n fontcolor = { 0, 0, 0 }\n },\n {\n title = \"Stick to the Plan\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2018214163838897493/8E38B96C5A8D703A59009A932432CBE21ABE63A2/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Subject 5U-21\",\n url = \"http://cloud-3.steamusercontent.com/ugc/2021606446228199363/CE43D58F37C9F48BDD6E6E145FE29BADEFF4DBC5/\",\n fontcolor = { 1, 1, 1 }\n },\n {\n title = \"Wooden Sledge\",\n url = \"http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/\",\n fontcolor = { 0, 0, 0 }\n }\n}\n\n-- save state and options to restore onLoad\nfunction onSave() return JSON.encode({ cardsInBag, showCost, showIcons }) end\n\n-- load variables and create context menu\nfunction onLoad(savedData)\n local loadedData = JSON.decode(savedData)\n cardsInBag = loadedData[1] or {}\n showCost = loadedData[2] or true\n showIcons = loadedData[3] or true\n fontColor = getFontColor()\n recreateButtons()\n\n self.addContextMenuItem(\"Select image\", selectImage)\n self.addContextMenuItem(\"Toggle cost\", function(color)\n showCost = not showCost\n printToColor(\"Show cost of cards: \" .. tostring(showCost), color, \"White\")\n refresh()\n end)\n\n self.addContextMenuItem(\"Toggle skill icons\", function(color)\n showIcons = not showIcons\n printToColor(\"Show skill icons of cards: \" .. tostring(showIcons), color, \"White\")\n refresh()\n end)\nend\n\n-- gets the font color based on background url\nfunction getFontColor()\n local customInfo = self.getCustomObject()\n for i = 1, #BACKGROUNDS do\n if BACKGROUNDS[i].url == customInfo.diffuse then\n return BACKGROUNDS[i].fontcolor\n end\n end\n return { 1, 1, 1 }\nend\n\n-- attempt to load image from below card when dropped\nfunction onDrop(playerColor)\n local pos = self.getPosition():setAt(\"y\", 2)\n local searchResult = searchLib.belowPosition(pos, \"isCard\")\n if #searchResult == 0 then return end\n local syncName = searchResult[1].getName()\n\n -- remove level information from syncName\n syncName = syncName:gsub(\"%s%(%d%)\", \"\")\n\n -- loop through background table\n for _, bgInfo in ipairs(BACKGROUNDS) do\n if bgInfo.title == syncName then\n printToColor(\"Background for '\" .. syncName .. \"' loaded!\", playerColor, \"Green\")\n updateImage(bgInfo.url)\n return\n end\n end\n printToColor(\"Didn't find background for '\" .. syncName .. \"'!\", playerColor, \"Orange\")\nend\n\n-- called by context menu to change background image\nfunction selectImage(color)\n -- generate list of options\n local options = {}\n for i = 1, #BACKGROUNDS do\n options[i] = BACKGROUNDS[i].title\n end\n\n -- prompt user to select option\n Player[color].showOptionsDialog(\"Select image:\", options, 1, function(_, optionIndex)\n updateImage(BACKGROUNDS[optionIndex].url)\n end)\nend\n\n-- sets background to the provided URL\nfunction updateImage(url)\n self.script_state = JSON.encode({ cardsInBag, showCost, showIcons })\n local customInfo = self.getCustomObject()\n customInfo.diffuse = url\n self.setCustomObject(customInfo)\n self.reload()\nend\n\n-- only allow cards to enter, split decks and reject other objects\nfunction onObjectEnterContainer(container, object)\n if container ~= self then return end\n if object.type == \"Deck\" then\n takeDeckOut(object.getGUID(), self.getPosition() + Vector(0, 0.1, 0))\n elseif object.type ~= \"Card\" then\n broadcastToAll(\"The 'Attachment Helper' is meant to be used for cards.\", \"White\")\n else\n findCard(object.getGUID(), object.getName(), object.getGMNotes())\n recreateButtons()\n end\nend\n\n-- takes the deck out and splits in into single cards\nfunction takeDeckOut(guid, pos)\n local deck = self.takeObject({ guid = guid, position = pos, smooth = false })\n for i = 1, #deck.getObjects() do\n self.putObject(deck.takeObject({ position = pos + Vector(0, 0.1 * i, 0), smooth = false }))\n end\nend\n\n-- removes leaving cards from the \"cardInBag\" table\nfunction onObjectLeaveContainer(container, object)\n if container == self then\n local guid = object.getGUID()\n local found = false\n for i, card in ipairs(cardsInBag) do\n if card.id == guid then\n table.remove(cardsInBag, i)\n found = true\n break\n end\n end\n\n if found ~= true then\n local name = object.getName()\n for i, card in ipairs(cardsInBag) do\n if card.name == name then\n table.remove(cardsInBag, i)\n break\n end\n end\n end\n recreateButtons()\n end\nend\n\n-- refreshes displayed buttons based on contained cards\nfunction refresh()\n cardsInBag = {}\n for _, object in ipairs(self.getObjects()) do\n findCard(object.guid, object.name, object.gm_notes)\n end\n recreateButtons()\nend\n\n-- gets cost and icons for a card\nfunction findCard(guid, name, GMNotes)\n local cost = \"\"\n local icons = {}\n local metadata = {}\n local displayName = name\n\n if displayName == nil or displayName == \"\" then displayName = \"unnamed\" end\n if showCost or showIcons then metadata = JSON.decode(GMNotes) end\n\n if showCost then\n if GMNotes ~= \"\" then cost = metadata.cost end\n if cost == nil or cost == \"\" then cost = \"–\" end\n displayName = \"[\" .. cost .. \"] \" .. displayName\n end\n\n if showIcons then\n if GMNotes ~= \"\" then\n icons[1] = metadata.wildIcons\n icons[2] = metadata.willpowerIcons\n icons[3] = metadata.intellectIcons\n icons[4] = metadata.combatIcons\n icons[5] = metadata.agilityIcons\n end\n\n local IconTypes = { \"Wild\", \"Willpower\", \"Intellect\", \"Combat\", \"Agility\" }\n local found = false\n for i = 1, 5 do\n if icons[i] ~= nil and icons[i] ~= \"\" then\n if found == false then\n displayName = displayName .. \"\\n\" .. IconTypes[i] .. \": \" .. icons[i]\n found = true\n else\n displayName = displayName .. \" \" .. IconTypes[i] .. \": \" .. icons[i]\n end\n end\n end\n end\n table.insert(cardsInBag, { name = name, displayName = displayName, id = guid })\nend\n\n-- recreates buttons with up-to-date labels\nfunction recreateButtons()\n self.clearButtons()\n local verticalPosition = 1.65\n\n for _, card in ipairs(cardsInBag) do\n local id = card.id\n local funcName = \"removeCard\" .. id\n self.setVar(funcName, function() removeCard(id) end)\n self.createButton({\n label = card.displayName,\n click_function = funcName,\n function_owner = self,\n position = { 0, -0.1, verticalPosition },\n height = 200,\n width = 1200,\n font_size = string.len(card.displayName) \u003e 20 and 75 or 100\n })\n verticalPosition = verticalPosition - 0.5\n end\n\n local countLabel = #cardsInBag\n local fontSize = 250\n if #cardsInBag == 0 then\n countLabel = \"Attachment Helper\"\n fontSize = 150\n end\n\n self.createButton({\n label = countLabel,\n click_function = \"none\",\n function_owner = self,\n position = { 0, -0.1, -1.7 },\n height = 0,\n width = 0,\n font_size = fontSize,\n font_color = fontColor\n })\nend\n\n-- click-function for buttons to take a card out of the bag\nfunction removeCard(cardGUID)\n self.takeObject({\n guid = cardGUID,\n rotation = self.getRotation(),\n position = self.getPosition() + Vector(0, 0.25, 0),\n callback_function = function(obj) obj.resting = true end\n })\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "[[],true,true]", "MaterialIndex": -1, "MeasureMovement": false, @@ -198231,7 +200534,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/SearchAssistant\")\nend)\n__bundle_register(\"accessories/SearchAssistant\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- forward declaration of variables that are used across functions\nlocal matColor, handColor, setAsidePosition, setAsideRotation, drawDeckPosition, topCardDetected\n\nlocal quickParameters = {}\nquickParameters.function_owner = self\nquickParameters.font_size = 165\nquickParameters.width = 275\nquickParameters.height = 275\nquickParameters.color = \"White\"\n\n-- common parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.font_size = 125\nbuttonParameters.width = 650\nbuttonParameters.height = 225\nbuttonParameters.color = \"White\"\n\nlocal inputParameters = {}\ninputParameters.function_owner = self\ninputParameters.input_function = \"updateSearchNumber\"\ninputParameters.tooltip = \"custom search amount\"\ninputParameters.label = \"#\"\ninputParameters.font_size = 175\ninputParameters.width = 400\ninputParameters.height = inputParameters.font_size + 23\ninputParameters.position = { 0, 0.11, 0 }\ninputParameters.alignment = 3\ninputParameters.validation = 2\n\nfunction onLoad()\n normalView()\nend\n\n-- regular view with search box\nfunction normalView()\n self.clearButtons()\n self.clearInputs()\n self.createInput(inputParameters)\n\n -- create custom search button\n buttonParameters.click_function = \"searchCustom\"\n buttonParameters.tooltip = \"Search the entered number of cards\"\n buttonParameters.position = { 0, 0.11, 0.65 }\n buttonParameters.label = \"Search\"\n self.createButton(buttonParameters)\n\n -- create buttons to search 3, 6 or 9 cards\n quickParameters.click_function = \"search3\"\n quickParameters.label = \"3\"\n quickParameters.position = { -0.65, 0.11, -0.65 }\n self.createButton(quickParameters)\n\n quickParameters.click_function = \"search6\"\n quickParameters.label = \"6\"\n quickParameters.position = { 0, 0.11, -0.65 }\n self.createButton(quickParameters)\n\n quickParameters.click_function = \"search9\"\n quickParameters.label = \"9\"\n quickParameters.position = { 0.65, 0.11, -0.65 }\n self.createButton(quickParameters)\nend\n\n-- click functions\nfunction search3(_, playerColor) startSearch(playerColor, 3) end\nfunction search6(_, playerColor) startSearch(playerColor, 6) end\nfunction search9(_, playerColor) startSearch(playerColor, 9) end\n\n-- view during a search with \"done\" buttons\nfunction searchView()\n self.clearButtons()\n self.clearInputs()\n\n -- create the \"End Search\" button\n buttonParameters.click_function = \"endSearch\"\n buttonParameters.tooltip = \"Left-click: Return cards and shuffle\\nRight-click: Return cards without shuffling\"\n buttonParameters.position = { 0, 0.11, 0 }\n buttonParameters.label = \"End Search\"\n self.createButton(buttonParameters)\nend\n\n-- input_function to get number of cards to search\nfunction updateSearchNumber(_, _, input)\n inputParameters.value = tonumber(input)\nend\n\n-- starts the search with the number from the input field\nfunction searchCustom(_, messageColor)\n local number = inputParameters.value\n if number ~= nil then\n startSearch(messageColor, number)\n else\n printToColor(\"Enter the number of cards to search in the textbox.\", messageColor, \"Orange\")\n end\nend\n\n-- start the search (change UI, set handCards aside, draw cards)\nfunction startSearch(messageColor, number)\n matColor = playmatApi.getMatColorByPosition(self.getPosition())\n handColor = playmatApi.getPlayerColor(matColor)\n topCardDetected = false\n\n -- get draw deck\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n if deckAreaObjects.draw == nil then\n printToColor(matColor .. \" draw deck could not be found!\", messageColor, \"Red\")\n return\n end\n\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n drawDeckPosition = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n printToColor(\"Place target(s) of search on set aside hand.\", messageColor, \"Green\")\n\n -- get playmat orientation\n local offset = -15\n if matColor == \"Orange\" or matColor == \"Red\" then\n offset = 15\n end\n\n -- get position and rotation for set aside cards\n local handData = Player[handColor].getHandTransform()\n local handCards = Player[handColor].getHandObjects()\n setAsidePosition = handData.position + offset * handData.right\n setAsideRotation = { handData.rotation.x, handData.rotation.y + 180, 180 }\n\n -- set y-value\n setAsidePosition.y = 1.5\n\n for i = #handCards, 1, -1 do\n handCards[i].setPosition(setAsidePosition + Vector(0, (#handCards - i) * 0.1, 0))\n handCards[i].setRotation(setAsideRotation)\n end\n\n -- handling for Norman Withers\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.flip()\n topCardDetected = true\n end\n\n searchView()\n\n Wait.time(function()\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deckAreaObjects.draw.deal(number, handColor)\n end, 1)\nend\n\n-- place handCards back into deck and optionally shuffle\nfunction endSearch(_, _, isRightClick)\n local handCards = Player[handColor].getHandObjects()\n\n for i = #handCards, 1, -1 do\n handCards[i].setPosition(drawDeckPosition + Vector(0, (#handCards - i) * 0.1, 0))\n handCards[i].setRotation(setAsideRotation)\n end\n\n -- draw set aside cards (from the ground!)\n for _, v in ipairs(searchArea(setAsidePosition)) do\n local obj = v.hit_object\n if obj.type == \"Deck\" then\n Wait.time(function()\n obj.deal(#obj.getObjects(), handColor)\n end, 1)\n break\n elseif obj.type == \"Card\" then\n obj.setPosition(Player[handColor].getHandTransform().position)\n obj.flip()\n break\n end\n end\n\n normalView()\n\n -- delay is to wait for cards to enter deck\n if not isRightClick then\n Wait.time(function()\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n if deckAreaObjects.draw then\n deckAreaObjects.draw.shuffle()\n end\n end, #handCards * 0.1)\n end\n\n -- Norman Withers handling\n if topCardDetected then\n Wait.time(function() playmatApi.flipTopCardFromDeck(matColor) end, #handCards * 0.1)\n end\nend\n\n-- utility function\nfunction searchArea(position)\n return Physics.cast({\n origin = position,\n direction = { 0, 1, 0 },\n type = 3,\n size = { 2, 2, 2 },\n max_distance = 0\n })\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/SearchAssistant\")\nend)\n__bundle_register(\"accessories/SearchAssistant\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal searchLib = require(\"util/SearchLib\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- forward declaration of variables that are used across functions\nlocal matColor, handColor, setAsidePosition, setAsideRotation, drawDeckPosition, topCardDetected\n\nlocal quickParameters = {}\nquickParameters.function_owner = self\nquickParameters.font_size = 165\nquickParameters.width = 275\nquickParameters.height = 275\nquickParameters.color = \"White\"\n\n-- common parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.font_size = 125\nbuttonParameters.width = 650\nbuttonParameters.height = 225\nbuttonParameters.color = \"White\"\n\nlocal inputParameters = {}\ninputParameters.function_owner = self\ninputParameters.input_function = \"updateSearchNumber\"\ninputParameters.tooltip = \"custom search amount\"\ninputParameters.label = \"#\"\ninputParameters.font_size = 175\ninputParameters.width = 400\ninputParameters.height = inputParameters.font_size + 23\ninputParameters.position = { 0, 0.11, 0 }\ninputParameters.alignment = 3\ninputParameters.validation = 2\n\nfunction onLoad()\n normalView()\nend\n\n-- regular view with search box\nfunction normalView()\n self.clearButtons()\n self.clearInputs()\n self.createInput(inputParameters)\n\n -- create custom search button\n buttonParameters.click_function = \"searchCustom\"\n buttonParameters.tooltip = \"Search the entered number of cards\"\n buttonParameters.position = { 0, 0.11, 0.65 }\n buttonParameters.label = \"Search\"\n self.createButton(buttonParameters)\n\n -- create buttons to search 3, 6 or 9 cards\n quickParameters.click_function = \"search3\"\n quickParameters.label = \"3\"\n quickParameters.position = { -0.65, 0.11, -0.65 }\n self.createButton(quickParameters)\n\n quickParameters.click_function = \"search6\"\n quickParameters.label = \"6\"\n quickParameters.position = { 0, 0.11, -0.65 }\n self.createButton(quickParameters)\n\n quickParameters.click_function = \"search9\"\n quickParameters.label = \"9\"\n quickParameters.position = { 0.65, 0.11, -0.65 }\n self.createButton(quickParameters)\nend\n\n-- click functions\nfunction search3(_, playerColor) startSearch(playerColor, 3) end\nfunction search6(_, playerColor) startSearch(playerColor, 6) end\nfunction search9(_, playerColor) startSearch(playerColor, 9) end\n\n-- view during a search with \"done\" buttons\nfunction searchView()\n self.clearButtons()\n self.clearInputs()\n\n -- create the \"End Search\" button\n buttonParameters.click_function = \"endSearch\"\n buttonParameters.tooltip = \"Left-click: Return cards and shuffle\\nRight-click: Return cards without shuffling\"\n buttonParameters.position = { 0, 0.11, 0 }\n buttonParameters.label = \"End Search\"\n self.createButton(buttonParameters)\nend\n\n-- input_function to get number of cards to search\nfunction updateSearchNumber(_, _, input)\n inputParameters.value = tonumber(input)\nend\n\n-- starts the search with the number from the input field\nfunction searchCustom(_, messageColor)\n local number = inputParameters.value\n if number ~= nil then\n startSearch(messageColor, number)\n else\n printToColor(\"Enter the number of cards to search in the textbox.\", messageColor, \"Orange\")\n end\nend\n\n-- start the search (change UI, set handCards aside, draw cards)\nfunction startSearch(messageColor, number)\n matColor = playmatApi.getMatColorByPosition(self.getPosition())\n handColor = playmatApi.getPlayerColor(matColor)\n topCardDetected = false\n\n -- get draw deck\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n if deckAreaObjects.draw == nil then\n printToColor(matColor .. \" draw deck could not be found!\", messageColor, \"Red\")\n return\n end\n\n -- get bounds to know the height of the deck\n local bounds = deckAreaObjects.draw.getBounds()\n drawDeckPosition = bounds.center + Vector(0, bounds.size.y / 2 + 0.2, 0)\n printToColor(\"Place target(s) of search on set aside hand.\", messageColor, \"Green\")\n\n -- get playmat orientation\n local offset = -15\n if matColor == \"Orange\" or matColor == \"Red\" then\n offset = 15\n end\n\n -- get position and rotation for set aside cards\n local handData = Player[handColor].getHandTransform()\n local handCards = Player[handColor].getHandObjects()\n setAsidePosition = handData.position + offset * handData.right\n setAsideRotation = { handData.rotation.x, handData.rotation.y + 180, 180 }\n\n -- set y-value\n setAsidePosition.y = 1.5\n\n for i = #handCards, 1, -1 do\n handCards[i].setPosition(setAsidePosition + Vector(0, (#handCards - i) * 0.1, 0))\n handCards[i].setRotation(setAsideRotation)\n end\n\n -- handling for Norman Withers\n if deckAreaObjects.topCard then\n deckAreaObjects.topCard.flip()\n topCardDetected = true\n end\n\n searchView()\n\n Wait.time(function()\n deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n deckAreaObjects.draw.deal(number, handColor)\n end, 1)\nend\n\n-- place handCards back into deck and optionally shuffle\nfunction endSearch(_, _, isRightClick)\n local handCards = Player[handColor].getHandObjects()\n\n for i = #handCards, 1, -1 do\n handCards[i].setPosition(drawDeckPosition + Vector(0, (#handCards - i) * 0.1, 0))\n handCards[i].setRotation(setAsideRotation)\n end\n\n -- draw set aside cards (from the ground!)\n for _, obj in ipairs(searchLib.atPosition(setAsidePosition, \"isCardOrDeck\")) do\n if obj.type == \"Deck\" then\n Wait.time(function() obj.deal(#obj.getObjects(), handColor) end, 1)\n elseif obj.type == \"Card\" then\n obj.setPosition(Player[handColor].getHandTransform().position)\n obj.flip()\n end\n end\n\n normalView()\n\n -- delay is to wait for cards to enter deck\n if not isRightClick then\n Wait.time(function()\n local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)\n if deckAreaObjects.draw then\n deckAreaObjects.draw.shuffle()\n end\n end, #handCards * 0.1)\n end\n\n -- Norman Withers handling\n if topCardDetected then\n Wait.time(function() playmatApi.flipTopCardFromDeck(matColor) end, #handCards * 0.1)\n end\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -198292,7 +200595,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/HandHelper\")\nend)\n__bundle_register(\"accessories/HandHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- forward declaration of variables that are used across functions\nlocal matColor, handColor, loopId, hovering\n\nfunction onLoad()\n local buttonParamaters = {}\n buttonParamaters.function_owner = self\n\n -- index 0: button as hand size label\n buttonParamaters.hover_color = \"White\"\n buttonParamaters.click_function = \"none\"\n buttonParamaters.position = { 0, 0.11, -0.4 }\n buttonParamaters.height = 0\n buttonParamaters.width = 0\n buttonParamaters.font_size = 500\n buttonParamaters.font_color = \"White\"\n self.createButton(buttonParamaters)\n\n -- index 1: button to toggle \"des\"\n buttonParamaters.label = \"DES: ✗\"\n buttonParamaters.click_function = \"none\"\n buttonParamaters.position = { 0, 0.11, 0.25 }\n buttonParamaters.height = 0\n buttonParamaters.width = 0\n buttonParamaters.font_size = 120\n self.createButton(buttonParamaters)\n\n -- index 2: button to discard a card\n buttonParamaters.label = \"discard random card\"\n buttonParamaters.click_function = \"discardRandom\"\n buttonParamaters.position = { 0, 0.11, 0.7 }\n buttonParamaters.height = 175\n buttonParamaters.width = 900\n buttonParamaters.font_size = 90\n buttonParamaters.font_color = \"Black\"\n self.createButton(buttonParamaters)\n\n updateColors()\n\n -- start loop to update card count\n loopId = Wait.time(updateValue, 1, -1)\nend\n\n-- updates colors when object is dropped somewhere\nfunction onDrop() updateColors() end\n\n-- toggles counting method briefly\nfunction onObjectHover(hover_color, obj)\n -- only continue if correct player hovers over \"self\"\n if obj ~= self or hover_color ~= handColor or hovering then return end\n\n -- toggle this flag so this doesn't get executed multiple times during the delay\n hovering = true\n\n -- stop loop, toggle \"des\" and displayed value briefly, then start new loop after 2s\n Wait.stop(loopId)\n updateValue(true)\n Wait.time(function()\n loopId = Wait.time(updateValue, 1, -1)\n hovering = false\n end, 1)\nend\n\n-- updates the matcolor and handcolor variable\nfunction updateColors()\n matColor = playmatApi.getMatColorByPosition(self.getPosition())\n handColor = playmatApi.getPlayerColor(matColor)\n self.setName(handColor .. \" Hand Helper\")\nend\n\n-- count cards in hand (by name for DES)\nfunction updateValue(toggle)\n -- update colors if handColor doesn't own a handzone\n if Player[handColor].getHandCount() == 0 then\n updateColors()\n end\n\n -- if there is still no handzone, then end here\n if Player[handColor].getHandCount() == 0 then return end\n\n -- get state of \"Dream-Enhancing Serum\" from playermat and update button label\n local des = playmatApi.isDES(matColor)\n if toggle then des = not des end\n self.editButton({ index = 1, label = \"DES: \" .. (des and \"✓\" or \"✗\") })\n\n -- count cards in hand\n local hand = Player[handColor].getHandObjects()\n local size = 0\n\n if des then\n local cardHash = {}\n for _, obj in pairs(hand) do\n if obj.tag == \"Card\" then\n local name = obj.getName()\n local title = string.match(name, '(.+)(%s%(%d+%))') or name\n cardHash[title] = true\n end\n end\n for _, title in pairs(cardHash) do\n size = size + 1\n end\n else\n for _, obj in pairs(hand) do\n if obj.tag == \"Card\" then size = size + 1 end\n end\n end\n\n -- update button label and color\n self.editButton({ index = 0, font_color = des and \"Green\" or \"White\", label = size })\nend\n\n-- discards a random non-hidden card from hand\nfunction discardRandom()\n playmatApi.doDiscardOne(matColor)\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/HandHelper\")\nend)\n__bundle_register(\"accessories/HandHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\n-- forward declaration of variables that are used across functions\nlocal matColor, handColor, loopId, hovering\n\nfunction onLoad()\n local buttonParamaters = {}\n buttonParamaters.function_owner = self\n\n -- index 0: button as hand size label\n buttonParamaters.hover_color = \"White\"\n buttonParamaters.click_function = \"none\"\n buttonParamaters.position = { 0, 0.11, -0.4 }\n buttonParamaters.height = 0\n buttonParamaters.width = 0\n buttonParamaters.font_size = 500\n buttonParamaters.font_color = \"White\"\n self.createButton(buttonParamaters)\n\n -- index 1: button to toggle \"des\"\n buttonParamaters.label = \"DES: ✗\"\n buttonParamaters.click_function = \"none\"\n buttonParamaters.position = { 0, 0.11, 0.25 }\n buttonParamaters.height = 0\n buttonParamaters.width = 0\n buttonParamaters.font_size = 120\n self.createButton(buttonParamaters)\n\n -- index 2: button to discard a card\n buttonParamaters.label = \"discard random card\"\n buttonParamaters.click_function = \"discardRandom\"\n buttonParamaters.position = { 0, 0.11, 0.7 }\n buttonParamaters.height = 175\n buttonParamaters.width = 900\n buttonParamaters.font_size = 90\n buttonParamaters.font_color = \"Black\"\n self.createButton(buttonParamaters)\n\n updateColors()\n\n -- start loop to update card count\n loopId = Wait.time(updateValue, 1, -1)\nend\n\n-- updates colors when object is dropped somewhere\nfunction onDrop() updateColors() end\n\n-- toggles counting method briefly\nfunction onObjectHover(hover_color, obj)\n -- only continue if correct player hovers over \"self\"\n if obj ~= self or hover_color ~= handColor or hovering then return end\n\n -- toggle this flag so this doesn't get executed multiple times during the delay\n hovering = true\n\n -- stop loop, toggle \"des\" and displayed value briefly, then start new loop after 2s\n Wait.stop(loopId)\n updateValue(true)\n Wait.time(function()\n loopId = Wait.time(updateValue, 1, -1)\n hovering = false\n end, 1)\nend\n\n-- updates the matcolor and handcolor variable\nfunction updateColors()\n matColor = playmatApi.getMatColorByPosition(self.getPosition())\n handColor = playmatApi.getPlayerColor(matColor)\n self.setName(handColor .. \" Hand Helper\")\nend\n\n-- count cards in hand (by name for DES)\nfunction updateValue(toggle)\n -- update colors if handColor doesn't own a handzone\n if Player[handColor].getHandCount() == 0 then\n updateColors()\n end\n\n -- if there is still no handzone, then end here\n if Player[handColor].getHandCount() == 0 then return end\n\n -- get state of \"Dream-Enhancing Serum\" from playermat and update button label\n local des = playmatApi.isDES(matColor)\n if toggle then des = not des end\n self.editButton({ index = 1, label = \"DES: \" .. (des and \"✓\" or \"✗\") })\n\n -- count cards in hand\n local hand = Player[handColor].getHandObjects()\n local size = 0\n\n if des then\n local cardHash = {}\n for _, obj in pairs(hand) do\n if obj.tag == \"Card\" then\n local name = obj.getName()\n local title = string.match(name, '(.+)(%s%(%d+%))') or name\n cardHash[title] = true\n end\n end\n for _, title in pairs(cardHash) do\n size = size + 1\n end\n else\n for _, obj in pairs(hand) do\n if obj.tag == \"Card\" then size = size + 1 end\n end\n end\n\n -- update button label and color\n self.editButton({ index = 0, font_color = des and \"Green\" or \"White\", label = size })\nend\n\n-- discards a random non-hidden card from hand\nfunction discardRandom()\n playmatApi.doDiscardOne(matColor)\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -198353,7 +200656,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/DisplacementTool\")\nend)\n__bundle_register(\"accessories/DisplacementTool\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playAreaApi = require(\"core/PlayAreaApi\")\n\nlocal UI_offset = 1.15\n\nlocal buttonParamaters = {}\nbuttonParamaters.function_owner = self\nbuttonParamaters.label = \"\"\nbuttonParamaters.height = 500\nbuttonParamaters.width = 500\nbuttonParamaters.color = { 0, 0, 0, 0 }\n\nfunction onLoad()\n -- index 0: left\n buttonParamaters.click_function = \"shift_left\"\n buttonParamaters.tooltip = \"Move left\"\n buttonParamaters.position = { -UI_offset, 0, 0 }\n self.createButton(buttonParamaters)\n\n -- index 1: right\n buttonParamaters.click_function = \"shift_right\"\n buttonParamaters.tooltip = \"Move right\"\n buttonParamaters.position = { UI_offset, 0, 0 }\n self.createButton(buttonParamaters)\n\n -- index 2: up\n buttonParamaters.click_function = \"shift_up\"\n buttonParamaters.tooltip = \"Move up\"\n buttonParamaters.position = { 0, 0, -UI_offset }\n self.createButton(buttonParamaters)\n\n -- index 3: down\n buttonParamaters.click_function = \"shift_down\"\n buttonParamaters.tooltip = \"Move down\"\n buttonParamaters.position = { 0, 0, UI_offset }\n self.createButton(buttonParamaters)\nend\n\nfunction shift_left(color) playAreaApi.shiftContentsLeft(color) end\n\nfunction shift_right(color) playAreaApi.shiftContentsRight(color) end\n\nfunction shift_up(color) playAreaApi.shiftContentsUp(color) end\n\nfunction shift_down(color) playAreaApi.shiftContentsDown(color) end\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/DisplacementTool\")\nend)\n__bundle_register(\"accessories/DisplacementTool\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playAreaApi = require(\"core/PlayAreaApi\")\n\nlocal UI_offset = 1.15\n\nlocal buttonParamaters = {}\nbuttonParamaters.function_owner = self\nbuttonParamaters.label = \"\"\nbuttonParamaters.height = 500\nbuttonParamaters.width = 500\nbuttonParamaters.color = { 0, 0, 0, 0 }\n\nfunction onLoad()\n -- index 0: left\n buttonParamaters.click_function = \"shift_left\"\n buttonParamaters.tooltip = \"Move left\"\n buttonParamaters.position = { -UI_offset, 0, 0 }\n self.createButton(buttonParamaters)\n\n -- index 1: right\n buttonParamaters.click_function = \"shift_right\"\n buttonParamaters.tooltip = \"Move right\"\n buttonParamaters.position = { UI_offset, 0, 0 }\n self.createButton(buttonParamaters)\n\n -- index 2: up\n buttonParamaters.click_function = \"shift_up\"\n buttonParamaters.tooltip = \"Move up\"\n buttonParamaters.position = { 0, 0, -UI_offset }\n self.createButton(buttonParamaters)\n\n -- index 3: down\n buttonParamaters.click_function = \"shift_down\"\n buttonParamaters.tooltip = \"Move down\"\n buttonParamaters.position = { 0, 0, UI_offset }\n self.createButton(buttonParamaters)\nend\n\nfunction shift_left(color) playAreaApi.shiftContentsLeft(color) end\n\nfunction shift_right(color) playAreaApi.shiftContentsRight(color) end\n\nfunction shift_up(color) playAreaApi.shiftContentsUp(color) end\n\nfunction shift_down(color) playAreaApi.shiftContentsDown(color) end\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", @@ -198431,7 +200734,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/SoundCubeApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SoundCubeApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- this table links the name of a trigger effect to its index\n local soundIndices = {\n [\"Vacuum\"] = 0,\n [\"Deep Bell\"] = 1,\n [\"Dark Souls\"] = 2\n }\n\n local function playTriggerEffect(index)\n local SoundCube = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"SoundCube\")\n SoundCube.AssetBundle.playTriggerEffect(index)\n end\n\n -- plays the by name requested sound\n ---@param soundName String Name of the sound to play\n SoundCubeApi.playSoundByName = function(soundName)\n playTriggerEffect(soundIndices[soundName])\n end\n\n return SoundCubeApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/CleanUpHelper\")\nend)\n__bundle_register(\"accessories/CleanUpHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Cleans up the table for the next scenario in a campaign:\n- sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log\n- puts everything on playmats and hands into respective trashcans\n- use the IGNORE_TAG to exclude objects from tidying (default: \"CleanUpHelper_Ignore\")]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal soundCubeApi = require(\"core/SoundCubeApi\")\nlocal tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n-- objects with this tag will be ignored\nlocal IGNORE_TAG = \"CleanUpHelper_ignore\"\n\n-- colors and order for following tables\nlocal COLORS = { \"White\", \"Orange\", \"Green\", \"Red\", \"Mythos\" }\nlocal campaignLog\nlocal RESET_VALUES = {}\nlocal loadingFailedBefore = false\nlocal optionsVisible = false\n\nlocal options = {}\noptions[\"importTrauma\"] = true\noptions[\"tidyPlayermats\"] = true\noptions[\"removeDrawnLines\"] = false\n\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\n\n\n---------------------------------------------------------\n-- option loading and GUI setup\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({ options = options })\nend\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n local loadedData = JSON.decode(savedData)\n options = loadedData.options\n -- update UI to match saved state\n for id, state in pairs(options) do\n self.UI.setAttribute(id, \"image\", state and \"option_on\" or \"option_off\")\n end\n end\n\n -- index 0: button as label\n buttonParameters.label = \"Clean Up Helper\"\n buttonParameters.click_function = \"none\"\n buttonParameters.position = { x = 0, y = 0.1, z = -1.3 }\n buttonParameters.height = 0\n buttonParameters.width = 0\n buttonParameters.font_size = 230\n buttonParameters.font_color = Color(0, 0, 0)\n self.createButton(buttonParameters)\n\n -- index 1: option button\n buttonParameters.label = \"Settings\"\n buttonParameters.click_function = \"showOrHideOptions\"\n buttonParameters.color = { 0, 0, 0, 0.96 }\n buttonParameters.position.z = -0.1\n buttonParameters.height = 350\n buttonParameters.width = 1000\n buttonParameters.font_size = 190\n buttonParameters.font_color = \"White\"\n self.createButton(buttonParameters)\n\n -- index 2: start button\n buttonParameters.label = \"Reset play areas\"\n buttonParameters.click_function = \"cleanUp\"\n buttonParameters.position.z = 1.1\n buttonParameters.width = 1550\n self.createButton(buttonParameters)\nend\n\n---------------------------------------------------------\n-- click functions for option buttons\n---------------------------------------------------------\n\n-- changes the UI state and the internal variable for the togglebuttons\nfunction optionButtonClick(_, id)\n local currentState = options[id]\n local newState = (currentState and \"option_off\" or \"option_on\")\n options[id] = not currentState\n self.UI.setAttribute(id, \"image\", newState)\nend\n\n-- shows or hides the option panel\nfunction showOrHideOptions()\n optionsVisible = not optionsVisible\n\n if optionsVisible then\n self.UI.show(\"options\")\n else\n self.UI.hide(\"options\")\n end\nend\n\n---------------------------------------------------------\n-- main function\n---------------------------------------------------------\n\nfunction cleanUp(_, color)\n printToAll(\"------------------------------\", \"White\")\n printToAll(\"Clean up started!\", \"Orange\")\n printToAll(\"Resetting counters...\", \"White\")\n\n soundCubeApi.playSoundByName(\"Vacuum\")\n ignoreCustomDataHelper()\n getTrauma()\n\n -- delay to account for potential state change\n Wait.time(updateCounters, 0.2)\n\n resetDoomCounter()\n blessCurseManagerApi.removeAll(color)\n removeLines()\n discardHands()\n tokenSpawnTrackerApi.resetAll()\n chaosBagApi.returnChaosTokens()\n chaosBagApi.releaseAllSealedTokens(color)\n\n printToAll(\"Tidying main play area...\", \"White\")\n startLuaCoroutine(self, \"tidyPlayareaCoroutine\")\nend\n\n---------------------------------------------------------\n-- modular functions, called by other functions\n---------------------------------------------------------\n\nfunction updateCounters()\n playmatApi.updateCounter(\"All\", \"ResourceCounter\" , 5)\n playmatApi.updateCounter(\"All\", \"ClickableClueCounter\" , 0)\n playmatApi.resetSkillTracker(\"All\")\n\n for i = 1, 4 do\n playmatApi.updateCounter(COLORS[i], \"DamageCounter\", RESET_VALUES.Damage[i])\n playmatApi.updateCounter(COLORS[i], \"HorrorCounter\", RESET_VALUES.Horror[i])\n end\nend\n\n-- reset doom on agenda\nfunction resetDoomCounter()\n local doomCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomCounter\")\n if doomCounter ~= nil then\n doomCounter.call(\"updateVal\")\n else\n printToAll(\"Doom counter could not be found.\", \"Yellow\")\n end\nend\n\n-- adds the ignore tag to the custom data helper\nfunction ignoreCustomDataHelper()\n local customDataHelper = playAreaApi.getCustomDataHelper()\n if customDataHelper then\n customDataHelper.addTag(IGNORE_TAG)\n end\nend\n\n-- read values for trauma from campaign log if enabled\nfunction getTrauma()\n RESET_VALUES = {\n Damage = { 0, 0, 0, 0 },\n Horror = { 0, 0, 0, 0 }\n }\n\n -- stop here if trauma import is disabled\n if not options[\"importTrauma\"] then\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n return\n end\n\n -- get campaign log\n campaignLog = getObjectsWithTag(\"CampaignLog\")[1]\n if campaignLog == nil then\n printToAll(\"Campaign log not found in standard position!\", \"Yellow\")\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n return\n end\n loadTrauma()\nend\n\n-- gets data from campaign log if possible\nfunction loadTrauma()\n -- check if \"returnTrauma\" function exists to avoid calling nil\n local trauma = campaignLog.getVar(\"returnTrauma\")\n\n if trauma ~= nil then\n printToAll(\"Trauma values found in campaign log!\", \"Green\")\n trauma = campaignLog.call(\"returnTrauma\")\n for i = 1, 8 do\n if i \u003c 5 then\n RESET_VALUES.Damage[i] = trauma[i]\n else\n RESET_VALUES.Horror[i-4] = trauma[i]\n end\n end\n loadingFailedBefore = false\n elseif loadingFailedBefore then\n printToAll(\"Trauma values could not be found in campaign log!\", \"Yellow\")\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n loadingFailedBefore = false\n else\n -- set campaign log to first state\n local stateId = campaignLog.getStateId()\n\n if stateId ~= 1 then\n campaignLog = campaignLog.setState(1)\n end\n loadingFailedBefore = true\n\n -- small delay to account for potential state change\n Wait.time(loadTrauma, 0.1)\n end\nend\n\n-- remove drawn lines\nfunction removeLines()\n if options[\"removeDrawnLines\"] then\n printToAll(\"Removing global vector lines...\", \"White\")\n Global.setVectorLines({})\n end\nend\n\n-- discard all hand objects\nfunction discardHands()\n if not options[\"tidyPlayermats\"] then return end\n for i = 1, 4 do\n local trash = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Trash\")\n if trash == nil then return end\n local hand = Player[playmatApi.getPlayerColor(COLORS[i])].getHandObjects()\n for j = #hand, 1, -1 do\n trash.putObject(hand[j])\n end\n end\nend\n\n-- clean up for play area\nfunction tidyPlayareaCoroutine()\n local trash = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n local playAreaZone = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n\n if playAreaZone == nil then\n printToAll(\"Scripting zone for main play area could not be found!\", \"Red\")\n elseif trash == nil then\n printToAll(\"Trashcan for main play area could not be found!\", \"Red\")\n else\n for _, obj in ipairs(playAreaZone.getObjects()) do\n -- ignore these elements\n if obj.hasTag(IGNORE_TAG) == false\n and obj.locked == false \n and obj.interactable == true then\n coroutine.yield(0)\n trash.putObject(obj)\n end\n end\n end\n\n printToAll(\"Tidying playermats and mythos area...\", \"White\")\n startLuaCoroutine(self, \"tidyPlayerMatCoroutine\")\n return 1\nend\n\n-- clean up for the four playermats and the mythos area\nfunction tidyPlayerMatCoroutine()\n for i = 1, 5 do\n -- only continue for playermat (1-4) if option enabled\n if options[\"tidyPlayermats\"] or i == 5 then\n -- delay for animation purpose\n for k = 1, 30 do coroutine.yield(0) end\n\n -- get respective trash\n local trash = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Trash\")\n if trash == nil then\n printToAll(\"Trashcan for \" .. COLORS[i] .. \" playmat could not be found!\", \"Red\")\n return 1\n end\n\n local objList\n if i \u003c 5 then\n objList = playmatApi.searchAroundPlaymat(COLORS[i])\n else\n objList = searchMythosArea()\n end\n\n for _, obj in ipairs(objList) do\n -- ignore these elements\n if obj.hasTag(IGNORE_TAG) == false\n and obj.getDescription() ~= \"Action Token\"\n and obj.hasTag(\"chaosBag\") == false\n and obj.locked == false \n and obj.interactable == true then\n coroutine.yield(0)\n trash.putObject(obj)\n\n -- flip action tokens back to ready\n elseif obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n end\n end\n\n -- reset \"activeInvestigatorId\"\n if i \u003c 5 then\n local playermat = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Playermat\")\n if playermat then\n playermat.setVar(\"activeInvestigatorId\", \"00000\")\n end\n end\n end\n end\n\n local datahelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n if datahelper then\n datahelper.setTable(\"SPAWNED_PLAYER_CARD_GUIDS\", {})\n end\n\n printToAll(\"Clean up completed!\", \"Green\")\n return 1\nend\n\n---------------------------------------------------------\n-- helper functions\n---------------------------------------------------------\n\n-- find objects in the mythos area\nfunction searchMythosArea()\n local searchResult = Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 1,\n type = 3,\n size = { 55, 1, 13.5 },\n origin = { -2, 2, 10 },\n orientation = { 0, 270, 0 },\n debug = false\n })\n\n local objList = {}\n for _, v in ipairs(searchResult) do\n table.insert(objList, v.hit_object)\n end\n return objList\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"core/SoundCubeApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SoundCubeApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- this table links the name of a trigger effect to its index\n local soundIndices = {\n [\"Vacuum\"] = 0,\n [\"Deep Bell\"] = 1,\n [\"Dark Souls\"] = 2\n }\n\n local function playTriggerEffect(index)\n local SoundCube = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"SoundCube\")\n SoundCube.AssetBundle.playTriggerEffect(index)\n end\n\n -- plays the by name requested sound\n ---@param soundName String Name of the sound to play\n SoundCubeApi.playSoundByName = function(soundName)\n playTriggerEffect(soundIndices[soundName])\n end\n\n return SoundCubeApi\nend\nend)\n__bundle_register(\"core/token/TokenSpawnTrackerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local TokenSpawnTracker = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getSpawnTracker()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TokenSpawnTracker\")\n end\n\n TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)\n return getSpawnTracker().call(\"hasSpawnedTokens\", cardGuid)\n end\n\n TokenSpawnTracker.markTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"markTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetTokensSpawned = function(cardGuid)\n return getSpawnTracker().call(\"resetTokensSpawned\", cardGuid)\n end\n\n TokenSpawnTracker.resetAllAssetAndEvents = function()\n return getSpawnTracker().call(\"resetAllAssetAndEvents\")\n end\n\n TokenSpawnTracker.resetAllLocations = function()\n return getSpawnTracker().call(\"resetAllLocations\")\n end\n\n TokenSpawnTracker.resetAll = function()\n return getSpawnTracker().call(\"resetAll\")\n end\n\n return TokenSpawnTracker\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"accessories/CleanUpHelper\", function(require, _LOADED, __bundle_register, __bundle_modules)\n--[[ Cleans up the table for the next scenario in a campaign:\n- sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log\n- puts everything on playmats and hands into respective trashcans\n- use the IGNORE_TAG to exclude objects from tidying (default: \"CleanUpHelper_Ignore\")]]\n\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal soundCubeApi = require(\"core/SoundCubeApi\")\nlocal tokenSpawnTrackerApi = require(\"core/token/TokenSpawnTrackerApi\")\n\n-- objects with this tag will be ignored\nlocal IGNORE_TAG = \"CleanUpHelper_ignore\"\n\n-- colors and order for following tables\nlocal COLORS = { \"White\", \"Orange\", \"Green\", \"Red\", \"Mythos\" }\nlocal campaignLog\nlocal RESET_VALUES = {}\nlocal loadingFailedBefore = false\nlocal optionsVisible = false\n\nlocal options = {}\noptions[\"importTrauma\"] = true\noptions[\"tidyPlayermats\"] = true\noptions[\"removeDrawnLines\"] = false\n\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\n\n\n---------------------------------------------------------\n-- option loading and GUI setup\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({ options = options })\nend\n\nfunction onLoad(savedData)\n if savedData ~= nil then\n local loadedData = JSON.decode(savedData)\n options = loadedData.options\n -- update UI to match saved state\n for id, state in pairs(options) do\n self.UI.setAttribute(id, \"image\", state and \"option_on\" or \"option_off\")\n end\n end\n\n -- index 0: button as label\n buttonParameters.label = \"Clean Up Helper\"\n buttonParameters.click_function = \"none\"\n buttonParameters.position = { x = 0, y = 0.1, z = -1.3 }\n buttonParameters.height = 0\n buttonParameters.width = 0\n buttonParameters.font_size = 230\n buttonParameters.font_color = Color(0, 0, 0)\n self.createButton(buttonParameters)\n\n -- index 1: option button\n buttonParameters.label = \"Settings\"\n buttonParameters.click_function = \"showOrHideOptions\"\n buttonParameters.color = { 0, 0, 0, 0.96 }\n buttonParameters.position.z = -0.1\n buttonParameters.height = 350\n buttonParameters.width = 1000\n buttonParameters.font_size = 190\n buttonParameters.font_color = \"White\"\n self.createButton(buttonParameters)\n\n -- index 2: start button\n buttonParameters.label = \"Reset play areas\"\n buttonParameters.click_function = \"cleanUp\"\n buttonParameters.position.z = 1.1\n buttonParameters.width = 1550\n self.createButton(buttonParameters)\nend\n\n---------------------------------------------------------\n-- click functions for option buttons\n---------------------------------------------------------\n\n-- changes the UI state and the internal variable for the togglebuttons\nfunction optionButtonClick(_, id)\n local currentState = options[id]\n local newState = (currentState and \"option_off\" or \"option_on\")\n options[id] = not currentState\n self.UI.setAttribute(id, \"image\", newState)\nend\n\n-- shows or hides the option panel\nfunction showOrHideOptions()\n optionsVisible = not optionsVisible\n\n if optionsVisible then\n self.UI.show(\"options\")\n else\n self.UI.hide(\"options\")\n end\nend\n\n---------------------------------------------------------\n-- main function\n---------------------------------------------------------\n\nfunction cleanUp(_, color)\n printToAll(\"------------------------------\", \"White\")\n printToAll(\"Clean up started!\", \"Orange\")\n printToAll(\"Resetting counters...\", \"White\")\n\n soundCubeApi.playSoundByName(\"Vacuum\")\n ignoreCustomDataHelper()\n getTrauma()\n\n -- delay to account for potential state change\n Wait.time(updateCounters, 0.2)\n\n resetDoomCounter()\n blessCurseManagerApi.removeAll(color)\n removeLines()\n discardHands()\n chaosBagApi.returnChaosTokens()\n chaosBagApi.releaseAllSealedTokens(color)\n\n printToAll(\"Tidying main play area...\", \"White\")\n startLuaCoroutine(self, \"tidyPlayareaCoroutine\")\nend\n\n---------------------------------------------------------\n-- modular functions, called by other functions\n---------------------------------------------------------\n\nfunction updateCounters()\n playmatApi.updateCounter(\"All\", \"ResourceCounter\" , 5)\n playmatApi.updateCounter(\"All\", \"ClickableClueCounter\" , 0)\n playmatApi.resetSkillTracker(\"All\")\n\n for i = 1, 4 do\n playmatApi.updateCounter(COLORS[i], \"DamageCounter\", RESET_VALUES.Damage[i])\n playmatApi.updateCounter(COLORS[i], \"HorrorCounter\", RESET_VALUES.Horror[i])\n end\nend\n\n-- reset doom on agenda\nfunction resetDoomCounter()\n local doomCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomCounter\")\n if doomCounter ~= nil then\n doomCounter.call(\"updateVal\")\n else\n printToAll(\"Doom counter could not be found.\", \"Yellow\")\n end\nend\n\n-- adds the ignore tag to the custom data helper\nfunction ignoreCustomDataHelper()\n local customDataHelper = playAreaApi.getCustomDataHelper()\n if customDataHelper then\n customDataHelper.addTag(IGNORE_TAG)\n end\nend\n\n-- read values for trauma from campaign log if enabled\nfunction getTrauma()\n RESET_VALUES = {\n Damage = { 0, 0, 0, 0 },\n Horror = { 0, 0, 0, 0 }\n }\n\n -- stop here if trauma import is disabled\n if not options[\"importTrauma\"] then\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n return\n end\n\n -- get campaign log\n campaignLog = getObjectsWithTag(\"CampaignLog\")[1]\n if campaignLog == nil then\n printToAll(\"Campaign log not found in standard position!\", \"Yellow\")\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n return\n end\n loadTrauma()\nend\n\n-- gets data from campaign log if possible\nfunction loadTrauma()\n -- check if \"returnTrauma\" function exists to avoid calling nil\n local trauma = campaignLog.getVar(\"returnTrauma\")\n\n if trauma ~= nil then\n printToAll(\"Trauma values found in campaign log!\", \"Green\")\n trauma = campaignLog.call(\"returnTrauma\")\n for i = 1, 8 do\n if i \u003c 5 then\n RESET_VALUES.Damage[i] = trauma[i]\n else\n RESET_VALUES.Horror[i-4] = trauma[i]\n end\n end\n loadingFailedBefore = false\n elseif loadingFailedBefore then\n printToAll(\"Trauma values could not be found in campaign log!\", \"Yellow\")\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n loadingFailedBefore = false\n else\n -- set campaign log to first state\n local stateId = campaignLog.getStateId()\n\n if stateId ~= 1 then\n campaignLog = campaignLog.setState(1)\n end\n loadingFailedBefore = true\n\n -- small delay to account for potential state change\n Wait.time(loadTrauma, 0.1)\n end\nend\n\n-- remove drawn lines\nfunction removeLines()\n if options[\"removeDrawnLines\"] then\n printToAll(\"Removing global vector lines...\", \"White\")\n Global.setVectorLines({})\n end\nend\n\n-- discard all hand objects\nfunction discardHands()\n if not options[\"tidyPlayermats\"] then return end\n for i = 1, 4 do\n local trash = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Trash\")\n if trash == nil then return end\n local hand = Player[playmatApi.getPlayerColor(COLORS[i])].getHandObjects()\n for j = #hand, 1, -1 do\n trash.putObject(hand[j])\n end\n end\nend\n\n-- clean up for play area\nfunction tidyPlayareaCoroutine()\n local trash = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"Trash\")\n local playAreaZone = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayAreaZone\")\n\n -- reset the playarea image by not providing an image\n playAreaApi.updateSurface()\n\n if playAreaZone == nil then\n printToAll(\"Scripting zone for main play area could not be found!\", \"Red\")\n elseif trash == nil then\n printToAll(\"Trashcan for main play area could not be found!\", \"Red\")\n else\n for _, obj in ipairs(playAreaZone.getObjects()) do\n -- ignore these elements\n if obj.hasTag(IGNORE_TAG) == false\n and obj.locked == false \n and obj.interactable == true then\n coroutine.yield(0)\n trash.putObject(obj)\n end\n end\n end\n\n printToAll(\"Tidying playermats and mythos area...\", \"White\")\n startLuaCoroutine(self, \"tidyPlayerMatCoroutine\")\n return 1\nend\n\n-- clean up for the four playermats and the mythos area\nfunction tidyPlayerMatCoroutine()\n for i = 1, 5 do\n -- only continue for playermat (1-4) if option enabled\n if options[\"tidyPlayermats\"] or i == 5 then\n -- delay for animation purpose\n for k = 1, 30 do coroutine.yield(0) end\n\n -- get respective trash\n local trash = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Trash\")\n if trash == nil then\n printToAll(\"Trashcan for \" .. COLORS[i] .. \" playmat could not be found!\", \"Red\")\n break\n end\n\n local objList\n if i \u003c 5 then\n objList = playmatApi.searchAroundPlaymat(COLORS[i])\n else\n -- Victory Display + Mythos Area\n objList = searchLib.inArea({ -2, 2, 10 }, { 0, 270, 0 }, { 55, 1, 13.5 })\n end\n\n for _, obj in ipairs(objList) do\n -- ignore these elements\n if obj.hasTag(IGNORE_TAG) == false\n and obj.getDescription() ~= \"Action Token\"\n and obj.hasTag(\"chaosBag\") == false\n and obj.locked == false \n and obj.interactable == true then\n coroutine.yield(0)\n trash.putObject(obj)\n\n -- flip action tokens back to ready\n elseif obj.getDescription() == \"Action Token\" and obj.is_face_down then\n obj.flip()\n end\n end\n\n -- reset \"activeInvestigatorId\"\n if i \u003c 5 then\n local playermat = guidReferenceApi.getObjectByOwnerAndType(COLORS[i], \"Playermat\")\n if playermat then\n playermat.setVar(\"activeInvestigatorId\", \"00000\")\n end\n end\n end\n end\n\n -- reset spawned data\n tokenSpawnTrackerApi.resetAll()\n local datahelper = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DataHelper\")\n if datahelper then\n datahelper.setTable(\"SPAWNED_PLAYER_CARD_GUIDS\", {})\n end\n\n printToAll(\"Clean up completed!\", \"Green\")\n return 1\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/CleanUpHelper\")\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"options\":{\"importTrauma\":true,\"removeDrawnLines\":false,\"tidyPlayermats\":true}}", "MeasureMovement": false, "Name": "Custom_Token", @@ -198567,7 +200870,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/VictoryDisplayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local VictoryDisplayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getVictoryDisplay()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"VictoryDisplay\")\n end\n\n -- triggers an update of the Victory count\n ---@param delay Number Delay in seconds after which the update call is executed\n VictoryDisplayApi.update = function(delay)\n getVictoryDisplay().call(\"startUpdate\", delay)\n end\n\n -- moves a card to the victory display (in the first empty spot)\n ---@param object Object Object that should be checked and potentially moved\n VictoryDisplayApi.placeCard = function(object)\n if object ~= nil and object.tag == \"Card\" then\n getVictoryDisplay().call(\"placeCard\", object)\n end\n end\n\n return VictoryDisplayApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GameKeyHandler\")\nend)\n__bundle_register(\"core/GameKeyHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal optionPanelApi = require(\"core/OptionPanelApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal victoryDisplayApi = require(\"core/VictoryDisplayApi\")\n\nfunction onLoad()\n addHotkey(\"Add Doom to Agenda\", addDoomToAgenda)\n addHotkey(\"Bless/Curse Status\", showBlessCurseStatus)\n addHotkey(\"Discard Object\", discardObject)\n addHotkey(\"Move card to Victory Display\", moveCardToVictoryDisplay)\n addHotkey(\"Remove a use\", removeOneUse)\n addHotkey(\"Take clue from location\", takeClueFromLocation)\n addHotkey(\"Upkeep\", triggerUpkeep)\n addHotkey(\"Upkeep (Multi-handed)\", triggerUpkeepMultihanded)\n addHotkey(\"Wendy's Menu\", addWendysMenu)\nend\n\n-- triggers the \"Upkeep\" function of the calling player's playmat\nfunction triggerUpkeep(playerColor)\n if playerColor == \"Black\" then\n broadcastToColor(\"Triggering 'Upkeep (Multihanded)' instead\", playerColor, \"Yellow\")\n triggerUpkeepMultihanded(playerColor)\n return\n end\n local matColor = playmatApi.getMatColor(playerColor)\n playmatApi.doUpkeepFromHotkey(matColor, playerColor)\nend\n\n-- triggers the \"Upkeep\" function of the calling player's playmat AND\n-- for all playmats that don't have a seated player, but a investigator card\nfunction triggerUpkeepMultihanded(playerColor)\n if playerColor ~= \"Black\" then\n triggerUpkeep(playerColor)\n end\n local colors = Player.getAvailableColors()\n for _, handColor in ipairs(colors) do\n local matColor = playmatApi.getMatColor(handColor)\n if playmatApi.returnInvestigatorId(matColor) ~= \"00000\" and Player[handColor].seated == false then\n playmatApi.doUpkeepFromHotkey(matColor, playerColor)\n end\n end\nend\n\n-- adds 1 doom to the agenda\nfunction addDoomToAgenda()\n local doomCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomCounter\")\n doomCounter.call(\"addVal\", 1)\nend\n\n-- discard the hovered object to the respective trashcan and discard tokens on it if it was a card\nfunction discardObject(playerColor, hoveredObject)\n -- only continue if an unlocked card, deck or tile was hovered\n if hoveredObject == nil\n or (hoveredObject.type ~= \"Card\" and hoveredObject.type ~= \"Deck\" and hoveredObject.type ~= \"Tile\")\n or hoveredObject.locked then\n broadcastToColor(\"Hover a token/tile or a card/deck and try again.\", playerColor, \"Yellow\")\n return\n end\n\n -- warning for locations since these are usually not meant to be discarded\n if hoveredObject.hasTag(\"Location\") then\n broadcastToAll(\"Watch out: A location was discarded.\", \"Yellow\")\n end\n\n -- initialize list of objects to discard\n local discardTheseObjects = { hoveredObject }\n\n -- discard tokens / tiles on cards / decks\n if hoveredObject.type ~= \"Tile\" then\n for _, v in ipairs(searchOnObj(hoveredObject)) do\n if v.hit_object.type == \"Tile\" then\n table.insert(discardTheseObjects, v.hit_object)\n end\n end\n end\n\n local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)\n playmatApi.discardListOfObjects(discardForMatColor, discardTheseObjects)\nend\n\n-- helper function to get the player to trigger the discard function for\nfunction getColorToDiscardFor(hoveredObject, playerColor)\n local pos = hoveredObject.getPosition()\n local closestMatColor = playmatApi.getMatColorByPosition(pos)\n\n -- check if actually on the closest playmat\n local closestMat = guidReferenceApi.getObjectByOwnerAndType(closestMatColor, \"Playermat\")\n local bounds = closestMat.getBounds()\n\n -- define the area \"near\" the playmat\n local bufferAroundPlaymat = 2\n local areaNearPlaymat = {}\n areaNearPlaymat.minX = bounds.center.x - bounds.size.x / 2 - bufferAroundPlaymat\n areaNearPlaymat.maxX = bounds.center.x + bounds.size.x / 2 + bufferAroundPlaymat\n areaNearPlaymat.minZ = bounds.center.z - bounds.size.z / 2 - bufferAroundPlaymat\n areaNearPlaymat.maxZ = bounds.center.z + bounds.size.z / 2 + bufferAroundPlaymat\n\n -- discard to closest mat if near it, use triggering playmat if not\n local discardForMatColor\n if inArea(pos, areaNearPlaymat) then\n return closestMatColor\n else\n return playmatApi.getMatColor(playerColor)\n end\nend\n\n-- moves the hovered card to the victory display\nfunction moveCardToVictoryDisplay(_, hoveredObject)\n victoryDisplayApi.placeCard(hoveredObject)\nend\n\n-- removes a use from a card (or a token if hovered)\nfunction removeOneUse(playerColor, hoveredObject)\n -- only continue if an unlocked card or tile was hovered\n if hoveredObject == nil\n or (hoveredObject.type ~= \"Card\" and hoveredObject.type ~= \"Tile\")\n or hoveredObject.locked then\n broadcastToColor(\"Hover a token/tile or a card and try again.\", playerColor, \"Yellow\")\n return\n end\n\n local targetObject = nil\n\n -- discard hovered token / tile\n if hoveredObject.type == \"Tile\" then\n targetObject = hoveredObject\n elseif hoveredObject.type == \"Card\" then\n -- grab the first use type from the metadata (or nil)\n local notes = JSON.decode(hoveredObject.getGMNotes()) or {}\n local usesData = notes.uses or {}\n local useInfo = usesData[1] or {}\n local searchForType = useInfo.type\n if searchForType then searchForType = searchForType:lower() end\n\n for _, v in ipairs(searchOnObj(hoveredObject)) do\n local obj = v.hit_object\n if obj.type == \"Tile\" and not obj.locked and obj.memo ~= \"resourceCounter\" then\n -- check for matching object, otherwise use the first hit\n if obj.memo == searchForType then\n targetObject = obj\n break\n elseif not targetObject then\n targetObject = obj\n end\n end\n end\n end\n\n -- error handling\n if not targetObject then\n broadcastToColor(\"No tokens found!\", playerColor, \"Yellow\")\n return\n end\n\n -- handling for stacked tokens\n if targetObject.getQuantity() \u003e 1 then\n targetObject = targetObject.takeObject()\n end\n\n -- feedback message\n local tokenName = targetObject.getName()\n if tokenName == \"\" then\n if targetObject.memo ~= \"\" then\n -- name handling for clue / doom\n if targetObject.memo == \"clueDoom\" then\n if targetObject.is_face_down then\n tokenName = \"Doom\"\n else\n tokenName = \"Clue\"\n end\n else\n tokenName = titleCase(targetObject.memo)\n end\n else\n tokenName = \"Unknown\"\n end\n end\n\n local playerName = Player[playerColor].steam_name\n broadcastToAll(playerName .. \" removed a token: \" .. tokenName, playerColor)\n\n local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)\n playmatApi.discardListOfObjects(discardForMatColor, { targetObject })\nend\n\n-- takes a clue from a location, player needs to hover the clue directly or the location\nfunction takeClueFromLocation(playerColor, hoveredObject)\n local cardName, clue\n\n if hoveredObject == nil then\n broadcastToColor(\"Hover a clue or card with clues and try again.\", playerColor, \"Yellow\")\n return\n elseif hoveredObject.type == \"Card\" then\n cardName = hoveredObject.getName()\n\n for _, v in ipairs(searchOnObj(hoveredObject)) do\n local obj = v.hit_object\n if obj.memo == \"clueDoom\" and obj.is_face_down == false then\n clue = obj\n break\n end\n end\n\n if clue == nil then\n broadcastToColor(\"This card does not have any clues on it.\", playerColor, \"Yellow\")\n return\n end\n elseif hoveredObject.memo == \"clueDoom\" then\n if hoveredObject.is_face_down then\n broadcastToColor(\"This is a doom token and not a clue.\", playerColor, \"Yellow\")\n return\n end\n\n clue = hoveredObject\n\n local search = Physics.cast({\n direction = { 0, -1, 0 },\n max_distance = 0.1,\n type = 3,\n size = { 0.1, 0.1, 0.1 },\n origin = clue.getPosition()\n })\n \n for _, v in ipairs(search) do\n local obj = v.hit_object\n if obj.type == \"Card\" then\n cardName = obj.getName()\n break\n end\n end\n else\n broadcastToColor(\"Hover a clue or card with clues and try again.\", playerColor, \"Yellow\")\n return\n end\n\n local clickableClues = optionPanelApi.getOptions()[\"useClueClickers\"]\n local playerName = Player[playerColor].steam_name\n local matColor = playmatApi.getMatColor(playerColor)\n local pos = nil\n if clickableClues then\n pos = {x = 0.49, y = 2.66, z = 0.00}\n playmatApi.updateCounter(matColor, \"ClickableClueCounter\", _, 1)\n else\n pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor)\n end\n \n local rot = playmatApi.returnRotation(matColor)\n\n -- check if found clue is a stack or single token\n if clue.getQuantity() \u003e 1 then\n clue.takeObject({position = pos, rotation = rot})\n else\n clue.setPositionSmooth(pos)\n clue.setRotation(rot)\n end\n\n if cardName then\n broadcastToAll(playerName .. \" took one clue from \" .. cardName .. \".\", playerColor)\n else\n broadcastToAll(playerName .. \" took one clue.\", \"Green\")\n end\n\n victoryDisplayApi.update()\nend\n\n-- broadcasts the bless/curse status to the calling player\nfunction showBlessCurseStatus(playerColor)\n blessCurseManagerApi.broadcastStatus(playerColor)\nend\n\n-- adds Wendy's menu to the hovered card\nfunction addWendysMenu(playerColor, hoveredObject)\n blessCurseManagerApi.addWendysMenu(playerColor, hoveredObject)\nend\n\n-- searches on an object (by using its bounds)\n---@param obj Object Object to search on\nfunction searchOnObj(obj)\n return Physics.cast({\n direction = { 0, 1, 0 },\n max_distance = 0.5,\n type = 3,\n size = obj.getBounds().size,\n origin = obj.getPosition()\n })\nend\n\n-- Simple method to check if the given point is in a specified area\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within\nfunction inArea(point, bounds)\n return (point.x \u003e bounds.minX\n and point.x \u003c bounds.maxX\n and point.z \u003e bounds.minZ\n and point.z \u003c bounds.maxZ)\nend\n\n-- capitalizes the first letter\nfunction titleCase(str)\n local first = str:sub(1, 1)\n local rest = str:sub(2)\n return first:upper() .. rest:lower()\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/NavigationOverlayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local NavigationOverlayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getNOHandler()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"NavigationOverlayHandler\")\n end\n\n -- Copies the visibility for the Navigation overlay\n ---@param startColor String Color of the player to copy from\n ---@param targetColor String Color of the targeted player\n NavigationOverlayApi.copyVisibility = function(startColor, targetColor)\n getNOHandler().call(\"copyVisibility\", {\n startColor = startColor,\n targetColor = targetColor\n })\n end \n\n -- Changes the Navigation Overlay view (\"Full View\" --\u003e \"Play Areas\" --\u003e \"Closed\" etc.)\n ---@param playerColor String Color of the player to update the visibility for\n NavigationOverlayApi.cycleVisibility = function(playerColor)\n getNOHandler().call(\"cycleVisibility\", playerColor)\n end\n\n -- loads the specified camera for a player\n ---@param player TTSPlayerInstance Player whose camera should be moved\n ---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\n NavigationOverlayApi.loadCamera = function(player, camera)\n getNOHandler().call(\"loadCameraFromApi\", {\n player = player,\n camera = camera\n })\n end\n\n return NavigationOverlayApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/GameKeyHandler\")\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/VictoryDisplayApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local VictoryDisplayApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getVictoryDisplay()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"VictoryDisplay\")\n end\n\n -- triggers an update of the Victory count\n ---@param delay Number Delay in seconds after which the update call is executed\n VictoryDisplayApi.update = function(delay)\n getVictoryDisplay().call(\"startUpdate\", delay)\n end\n\n -- moves a card to the victory display (in the first empty spot)\n ---@param object Object Object that should be checked and potentially moved\n VictoryDisplayApi.placeCard = function(object)\n if object ~= nil and object.tag == \"Card\" then\n getVictoryDisplay().call(\"placeCard\", object)\n end\n end\n\n return VictoryDisplayApi\nend\nend)\n__bundle_register(\"core/GameKeyHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseManagerApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal navigationOverlayApi = require(\"core/NavigationOverlayApi\")\nlocal optionPanelApi = require(\"core/OptionPanelApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\nlocal searchLib = require(\"util/SearchLib\")\nlocal victoryDisplayApi = require(\"core/VictoryDisplayApi\")\n\nfunction onLoad()\n addHotkey(\"Add doom to agenda\", addDoomToAgenda)\n addHotkey(\"Add Bless/Curse context menu\", addBlurseSealingMenu)\n addHotkey(\"Discard object\", discardObject)\n addHotkey(\"Discard top card\", discardTopDeck)\n addHotkey(\"Display Bless/Curse status\", showBlessCurseStatus)\n addHotkey(\"Move card to Victory Display\", moveCardToVictoryDisplay)\n addHotkey(\"Remove a use\", removeOneUse)\n addHotkey(\"Switch seat clockwise\", switchSeatClockwise)\n addHotkey(\"Switch seat counter-clockwise\", switchSeatCounterClockwise)\n addHotkey(\"Take clue from location\", takeClueFromLocation)\n addHotkey(\"Upkeep\", triggerUpkeep)\n addHotkey(\"Upkeep (Multi-handed)\", triggerUpkeepMultihanded)\nend\n\n-- triggers the \"Upkeep\" function of the calling player's playmat\nfunction triggerUpkeep(playerColor)\n if playerColor == \"Black\" then\n broadcastToColor(\"Triggering 'Upkeep (Multihanded)' instead\", playerColor, \"Yellow\")\n triggerUpkeepMultihanded(playerColor)\n return\n end\n local matColor = playmatApi.getMatColor(playerColor)\n playmatApi.doUpkeepFromHotkey(matColor, playerColor)\nend\n\n-- triggers the \"Upkeep\" function of the calling player's playmat AND\n-- for all playmats that don't have a seated player, but a investigator card\nfunction triggerUpkeepMultihanded(playerColor)\n if playerColor ~= \"Black\" then\n triggerUpkeep(playerColor)\n end\n local colors = Player.getAvailableColors()\n for _, handColor in ipairs(colors) do\n local matColor = playmatApi.getMatColor(handColor)\n if playmatApi.returnInvestigatorId(matColor) ~= \"00000\" and Player[handColor].seated == false then\n playmatApi.doUpkeepFromHotkey(matColor, playerColor)\n end\n end\nend\n\n-- adds 1 doom to the agenda\nfunction addDoomToAgenda()\n local doomCounter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DoomCounter\")\n doomCounter.call(\"addVal\", 1)\nend\n\n-- discard the hovered object to the respective trashcan and discard tokens on it if it was a card\nfunction discardObject(playerColor, hoveredObject)\n -- only continue if an unlocked card, deck or tile was hovered\n if hoveredObject == nil\n or (hoveredObject.type ~= \"Card\" and hoveredObject.type ~= \"Deck\" and hoveredObject.type ~= \"Tile\")\n or hoveredObject.locked then\n broadcastToColor(\"Hover a token/tile or a card/deck and try again.\", playerColor, \"Yellow\")\n return\n end\n\n -- warning for locations since these are usually not meant to be discarded\n if hoveredObject.hasTag(\"Location\") then\n broadcastToAll(\"Watch out: A location was discarded.\", \"Yellow\")\n end\n\n -- initialize list of objects to discard\n local discardTheseObjects = { hoveredObject }\n\n -- discard tokens / tiles on cards / decks\n if hoveredObject.type ~= \"Tile\" then\n for _, obj in ipairs(searchLib.onObject(hoveredObject, \"isTileOrToken\")) do\n table.insert(discardTheseObjects, obj)\n end\n end\n\n local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)\n playmatApi.discardListOfObjects(discardForMatColor, discardTheseObjects)\nend\n\n-- discard the top card of hovered deck, calling discardObject function\nfunction discardTopDeck(playerColor, hoveredObject)\n -- only continue if an unlocked card or deck was hovered\n if hoveredObject == nil\n or (hoveredObject.type ~= \"Card\" and hoveredObject.type ~= \"Deck\")\n or hoveredObject.locked then\n broadcastToColor(\"Hover a deck/card and try again.\", playerColor, \"Yellow\")\n return\n end\n if hoveredObject.type == \"Deck\" then\n takenCard = hoveredObject.takeObject({index = 0})\n else\n takenCard = hoveredObject\n end\n Wait.frames(function() discardObject(playerColor, takenCard) end, 1)\nend \n\n-- helper function to get the player to trigger the discard function for\nfunction getColorToDiscardFor(hoveredObject, playerColor)\n local pos = hoveredObject.getPosition()\n local closestMatColor = playmatApi.getMatColorByPosition(pos)\n\n -- check if actually on the closest playmat\n local closestMat = guidReferenceApi.getObjectByOwnerAndType(closestMatColor, \"Playermat\")\n local bounds = closestMat.getBounds()\n\n -- define the area \"near\" the playmat\n local bufferAroundPlaymat = 2\n local areaNearPlaymat = {}\n areaNearPlaymat.minX = bounds.center.x - bounds.size.x / 2 - bufferAroundPlaymat\n areaNearPlaymat.maxX = bounds.center.x + bounds.size.x / 2 + bufferAroundPlaymat\n areaNearPlaymat.minZ = bounds.center.z - bounds.size.z / 2 - bufferAroundPlaymat\n areaNearPlaymat.maxZ = bounds.center.z + bounds.size.z / 2 + bufferAroundPlaymat\n\n -- discard to closest mat if near it, use triggering playmat if not\n local discardForMatColor\n if inArea(pos, areaNearPlaymat) then\n return closestMatColor\n else\n return playmatApi.getMatColor(playerColor)\n end\nend\n\n-- moves the hovered card to the victory display\nfunction moveCardToVictoryDisplay(_, hoveredObject)\n victoryDisplayApi.placeCard(hoveredObject)\nend\n\n-- removes a use from a card (or a token if hovered)\nfunction removeOneUse(playerColor, hoveredObject)\n -- only continue if an unlocked card or tile was hovered\n if hoveredObject == nil\n or (hoveredObject.type ~= \"Card\" and hoveredObject.type ~= \"Tile\")\n or hoveredObject.locked then\n broadcastToColor(\"Hover a token/tile or a card and try again.\", playerColor, \"Yellow\")\n return\n end\n\n local targetObject = nil\n\n -- discard hovered token / tile\n if hoveredObject.type == \"Tile\" then\n targetObject = hoveredObject\n elseif hoveredObject.type == \"Card\" then\n -- grab the first use type from the metadata (or nil)\n local notes = JSON.decode(hoveredObject.getGMNotes()) or {}\n local usesData = notes.uses or {}\n local useInfo = usesData[1] or {}\n local searchForType = useInfo.type\n if searchForType then searchForType = searchForType:lower() end\n\n for _, obj in ipairs(searchLib.onObject(hoveredObject, \"isTileOrToken\")) do\n if not obj.locked and obj.memo ~= \"resourceCounter\" then\n -- check for matching object, otherwise use the first hit\n if obj.memo == searchForType then\n targetObject = obj\n break\n elseif not targetObject then\n targetObject = obj\n end\n end\n end\n end\n\n -- error handling\n if not targetObject then\n broadcastToColor(\"No tokens found!\", playerColor, \"Yellow\")\n return\n end\n\n -- handling for stacked tokens\n if targetObject.getQuantity() \u003e 1 then\n targetObject = targetObject.takeObject()\n end\n\n -- feedback message\n local tokenName = targetObject.getName()\n if tokenName == \"\" then\n if targetObject.memo ~= \"\" then\n -- name handling for clue / doom\n if targetObject.memo == \"clueDoom\" then\n if targetObject.is_face_down then\n tokenName = \"Doom\"\n else\n tokenName = \"Clue\"\n end\n else\n tokenName = titleCase(targetObject.memo)\n end\n else\n tokenName = \"Unknown\"\n end\n end\n\n local playerName = Player[playerColor].steam_name\n broadcastToAll(playerName .. \" removed a token: \" .. tokenName, playerColor)\n\n local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)\n playmatApi.discardListOfObjects(discardForMatColor, { targetObject })\nend\n\n-- switches the triggering player to the next seat (clockwise)\nfunction switchSeatClockwise(playerColor)\n switchSeat(playerColor, \"clockwise\")\nend\n\n-- switches the triggering player to the next seat (counter-clockwise)\nfunction switchSeatCounterClockwise(playerColor)\n switchSeat(playerColor, \"counter-clockwise\")\nend\n\n-- handles seat switching in the given direction\nfunction switchSeat(playerColor, direction)\n if playerColor == \"Black\" or playerColor == \"Grey\" then\n broadcastToColor(\"This hotkey is only available to seated players.\", playerColor, \"Orange\")\n return\n end\n\n -- sort function for matcolors based on hand position (Green, White, Orange, Red)\n local function sortByHandPosition(color1, color2)\n local pos1 = Player[color1].getHandTransform().position\n local pos2 = Player[color2].getHandTransform().position\n return pos1.z \u003e pos2.z\n end\n\n -- get used playermats\n local usedColors = playmatApi.getUsedMatColors()\n table.sort(usedColors, sortByHandPosition)\n\n -- get current seat index\n local index\n for i, color in ipairs(usedColors) do\n if color == playerColor then\n index = i\n break\n end\n end\n if not index then\n broadcastToColor(\"Couldn't detect investigator.\", playerColor, \"Orange\")\n return\n end\n\n -- get next color\n index = index + ((direction == \"clockwise\") and -1 or 1)\n if index == 0 then\n index = #usedColors\n elseif index \u003e #usedColors then\n index = 1\n end\n\n -- swap color\n navigationOverlayApi.loadCamera(Player[playerColor], usedColors[index])\nend\n\n-- takes a clue from a location, player needs to hover the clue directly or the location\nfunction takeClueFromLocation(playerColor, hoveredObject)\n local cardName, clue\n\n if hoveredObject == nil then\n broadcastToColor(\"Hover a clue or card with clues and try again.\", playerColor, \"Yellow\")\n return\n elseif hoveredObject.type == \"Card\" then\n cardName = hoveredObject.getName()\n local searchResult = searchLib.onObject(hoveredObject, \"isClue\")\n\n if #searchResult == 0 then\n broadcastToColor(\"This card does not have any clues on it.\", playerColor, \"Yellow\")\n return\n else\n clue = searchResult[1]\n end\n elseif hoveredObject.memo == \"clueDoom\" then\n if hoveredObject.is_face_down then\n broadcastToColor(\"This is a doom token and not a clue.\", playerColor, \"Yellow\")\n return\n end\n\n clue = hoveredObject\n local searchResult = searchLib.belowPosition(clue.getPosition(), \"isCard\")\n\n if #searchResult ~= 0 then\n cardName = searchResult[1].getName()\n end\n else\n broadcastToColor(\"Hover a clue or card with clues and try again.\", playerColor, \"Yellow\")\n return\n end\n\n local clickableClues = optionPanelApi.getOptions()[\"useClueClickers\"]\n local playerName = Player[playerColor].steam_name\n local matColor = playmatApi.getMatColor(playerColor)\n local pos = nil\n if clickableClues then\n pos = {x = 0.49, y = 2.66, z = 0.00}\n playmatApi.updateCounter(matColor, \"ClickableClueCounter\", _, 1)\n else\n pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor)\n end\n \n local rot = playmatApi.returnRotation(matColor)\n\n -- check if found clue is a stack or single token\n if clue.getQuantity() \u003e 1 then\n clue.takeObject({position = pos, rotation = rot})\n else\n clue.setPositionSmooth(pos)\n clue.setRotation(rot)\n end\n\n if cardName then\n broadcastToAll(playerName .. \" took one clue from \" .. cardName .. \".\", \"White\")\n else\n broadcastToAll(playerName .. \" took one clue.\", \"White\")\n end\n\n victoryDisplayApi.update()\nend\n\n-- broadcasts the bless/curse status to the calling player\nfunction showBlessCurseStatus(playerColor)\n blessCurseManagerApi.broadcastStatus(playerColor)\nend\n\n-- adds Wendy's menu to the hovered card\nfunction addBlurseSealingMenu(playerColor, hoveredObject)\n blessCurseManagerApi.addBlurseSealingMenu(playerColor, hoveredObject)\nend\n\n-- Simple method to check if the given point is in a specified area\n---@param point Vector Point to check, only x and z values are relevant\n---@param bounds Table Defined area to see if the point is within\nfunction inArea(point, bounds)\n return (point.x \u003e bounds.minX\n and point.x \u003c bounds.maxX\n and point.z \u003e bounds.minZ\n and point.z \u003c bounds.maxZ)\nend\n\n-- capitalizes the first letter\nfunction titleCase(str)\n local first = str:sub(1, 1)\n local rest = str:sub(2)\n return first:upper() .. rest:lower()\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "go_game_piece_white", @@ -198728,8 +201031,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/NavigationOverlayHandler\")\nend)\n__bundle_register(\"core/NavigationOverlayHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nfullButtonData = {\n { id = \"1\", width = \"84\", height = \"33\", offset = \"1 2\" }, -- 1. Act/Agenda\n { id = \"2\", width = \"78\", height = \"69\", offset = \"1 -62\" }, -- 2. Map\n { id = \"3\", width = \"70\", height = \"36\", offset = \"-38 -126\" }, -- 3. White\n { id = \"4\", width = \"70\", height = \"36\", offset = \"38 -126\" }, -- 4. Orange\n { id = \"5\", width = \"36\", height = \"70\", offset = \"-63 -66\" }, -- 5. Green\n { id = \"6\", width = \"36\", height = \"70\", offset = \"63 -66\" }, -- 6. Red\n { id = \"7\", width = \"38\", height = \"38\", offset = \"-65 -3\" }, -- 7. Victory\n { id = \"8\", width = \"40\", height = \"40\", offset = \"65 -3\" }, -- 8. Guide\n { id = \"9\", width = \"56\", height = \"16\", offset = \"1 -20\" }, -- 9. Player count\n { id = \"10\", width = \"36\", height = \"16\", offset = \"1 -102\" }, -- 10. Bless/Curse\n { id = \"11\", width = \"168\", height = \"56\", offset = \"1 47\" }, -- 11. Scenarios\n { id = \"12\", width = \"52\", height = \"53\", offset = \"-154 134\" }, -- 12. Player card panel\n { id = \"13\", width = \"22\", height = \"22\", offset = \"-116 132\" }, -- 13. Search card panel\n { id = \"14\", width = \"120\", height = \"75\", offset = \"-152 70\" }, -- 14. Player card display\n { id = \"15\", width = \"40\", height = \"54\", offset = \"-150 -38\" }, -- 15. Deck builder\n { id = \"16\", width = \"104\", height = \"84\", offset = \"-154 -114\" }, -- 16. Rules area\n { id = \"17\", width = \"100\", height = \"170\", offset = \"152 72\" }, -- 17. Cycle area\n { id = \"18\", width = \"56\", height = \"60\", offset = \"182 -124\" }, -- 18. Additions\n { id = \"19\", width = \"20\", height = \"20\", offset = \"0 150\" }, -- 19. Shrink\n { id = \"20\", width = \"20\", height = \"20\", offset = \"20 150\" }, -- 20. Close\n { id = \"21\", width = \"20\", height = \"20\", offset = \"-20 150\" } -- 21. Settings\n}\n\nplayButtonData = {\n { id = \"1\", width = \"80\", height = \"33\", offset = \"0 55\" },\n { id = \"2\", width = \"78\", height = \"70\", offset = \"0 -8\" },\n { id = \"3\", width = \"68\", height = \"32\", offset = \"-36 -71\" },\n { id = \"4\", width = \"68\", height = \"32\", offset = \"36 -71\" },\n { id = \"5\", width = \"35\", height = \"66\", offset = \"-65 -10\" },\n { id = \"6\", width = \"35\", height = \"66\", offset = \"65 -10\" },\n { id = \"7\", width = \"38\", height = \"38\", offset = \"-66 52\" },\n { id = \"8\", width = \"38\", height = \"38\", offset = \"66 52\" },\n { id = \"9\", width = \"50\", height = \"12\", offset = \"0 33\" },\n { id = \"10\", width = \"32\", height = \"12\", offset = \"0 -48\" },\n { id = \"19\", width = \"20\", height = \"20\", offset = \"0 80\" },\n { id = \"20\", width = \"20\", height = \"20\", offset = \"20 80\" },\n { id = \"21\", width = \"20\", height = \"20\", offset = \"-20 80\" }\n}\n\n-- To-Do: dynamically get positions by linking to objects\ncameraData = {\n { position = { -1.6, 1.55, 0 }, distance = 18 }, -- 1. Act/Agenda\n { position = { -28, 1.55, 0 }, distance = -1 }, -- 2. Map\n { position = { -31.6, 1.55, 26.4 }, distance = -1 }, -- 3. Green playmat\n { position = { -55, 1.55, 12.05 }, distance = -1 }, -- 4. White playmat\n { position = { -55, 1.55, -11.48 }, distance = -1 }, -- 5. Orange playmat\n { position = { -31.6, 1.55, -26.4 }, distance = -1 }, -- 6. Red playmat\n { position = { -3, 1.55, 30 }, distance = 16 }, -- 7. Victory / SetAside\n { position = { -3, 1.55, -26.76 }, distance = 16 }, -- 8. Guide\n { position = { -11.83, 1.55, 0 }, distance = 10 }, -- 9. Player count\n { position = { -48.35, 1.55, 0 }, distance = 10 }, -- 10. Bless/Curse\n { position = { 12.56, 1.55, 0 }, distance = 45 }, -- 11. Scenarios\n { position = { 57.8, 1.55, 71 }, distance = 22 }, -- 12. Player card panel\n { position = { 60.38, 1.55, 56 }, distance = 10 }, -- 13. Card search panel\n { position = { 27.48, 1.55, 71 }, distance = 35 }, -- 14. Player card area\n { position = { -19.48, 1.55, 71 }, distance = 22 }, -- 15. Deck builder\n { position = { -52.92, 1.55, 71 }, distance = 42 }, -- 16. Rules area\n { position = { 26, 1.55, -71 }, distance = 65 }, -- 17. Cycle area\n { position = { -59.08, 1.55, -83 }, distance = 27 } -- 18. Additions\n}\n\nlocal settingsOpenForColor\nlocal visibility = {}\nlocal claims = {}\nlocal pitch = {}\n\n---------------------------------------------------------\n-- save/load functionality\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({\n visibility = visibility,\n claims = claims,\n pitch = pitch\n })\nend\n\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n visibility = loadedData.visibility\n claims = loadedData.claims\n pitch = loadedData.pitch\n else\n local allColors = Player.getColors()\n\n for _, color in ipairs(allColors) do\n -- default state for claims\n claims[color] = {}\n\n -- default state for visibility\n visibility[color] = { full = false, play = false }\n end\n end\n\n createXmlButtons()\n updateVisibility()\nend\n\n---------------------------------------------------------\n-- visibility related functions\n---------------------------------------------------------\n\nfunction cycleVisibility(color)\n setVisibility(\"next\", color)\nend\n\nfunction copyVisibility(params)\n visibility[params.targetColor] = {\n full = visibility[params.startColor].full,\n play = visibility[params.startColor].play\n }\n updateVisibility()\nend\n\nfunction setVisibility(type, color)\n if type == \"next\" then\n if visibility[color].full then\n visibility[color] = { full = false, play = true }\n elseif visibility[color].play then\n visibility[color] = { full = false, play = false }\n else\n visibility[color] = { full = true, play = false }\n end\n elseif type == \"toggle\" then\n visibility[color] = {\n full = not visibility[color].full,\n play = not visibility[color].play\n }\n else\n visibility[color] = { full = false, play = false }\n end\n\n updateVisibility()\nend\n\n-- update XML visibility\nfunction updateVisibility()\n local colorString = { full = \"\", play = \"\" }\n\n for color, v in pairs(visibility) do\n if v.full then\n if colorString.full == \"\" then\n colorString.full = color\n else\n colorString.full = colorString.full .. '|' .. color\n end\n elseif v.play then\n if colorString.play == \"\" then\n colorString.play = color\n else\n colorString.play = colorString.play .. '|' .. color\n end\n end\n end\n\n -- update the visibility on the XML\n UI.setAttribute(\"navPanelFull\", \"visibility\", colorString.full)\n UI.setAttribute(\"navPanelPlay\", \"visibility\", colorString.play)\n UI.setAttribute(\"navPanelFull\", \"active\", colorString.full ~= \"\")\n UI.setAttribute(\"navPanelPlay\", \"active\", colorString.play ~= \"\")\nend\n\n---------------------------------------------------------\n-- XML button creation\n---------------------------------------------------------\n\nfunction createXmlButtons()\n local ui = UI.getXmlTable()\n ui = createXmlButtonHelper(ui, {\n data = fullButtonData,\n id = \"navPanelFull\",\n overlay = \"OverlayLarge\"\n })\n ui = createXmlButtonHelper(ui, {\n data = playButtonData,\n id = \"navPanelPlay\",\n overlay = \"OverlaySmall\"\n })\n UI.setXmlTable(ui)\nend\n\n-- XML button creation\nfunction createXmlButtonHelper(ui, params)\n local color\n local guid = self.getGUID()\n local xml = findTagWithId(ui, params.id)\n\n -- add basic image\n xml.children = { {\n tag = \"image\",\n attributes = {\n id = \"backgroundImage\",\n image = params.overlay\n }\n } }\n\n -- add all buttons\n for _, d in ipairs(params.data) do\n table.insert(xml.children, {\n tag = \"button\",\n attributes = {\n onClick = guid .. \"/buttonClicked\",\n id = d.id,\n height = d.height,\n width = d.width,\n offsetXY = d.offset,\n color = \"rgba(0,1,0,0)\"\n }\n })\n end\n return ui\nend\n\nfunction findTagWithId(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = findTagWithId(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n---------------------------------------------------------\n-- core functionality\n---------------------------------------------------------\n\n-- handles all button clicks\nfunction buttonClicked(player, _, id)\n local index = tonumber(id)\n\n if index == 19 then\n setVisibility(\"toggle\", player.color)\n elseif index == 20 then\n setVisibility(\"close\", player.color)\n elseif index == 21 then\n toggleSettings(player)\n else\n loadCamera(player, index)\n end\nend\n\n-- generates a table with rectangular bounds for provided objects\nfunction getDynamicViewBounds(objList)\n local count = 0\n local totalBounds = {\n minX = 0,\n maxX = -70,\n minZ = 60,\n maxZ = -60\n }\n\n for _, obj in pairs(objList) do\n -- handling for Physics.cast() results\n if not obj.type then obj = obj.hit_object end\n\n if not obj.hasTag(\"CameraZoom_ignore\") and not obj.hasTag(\"CampaignLog\") then\n count = count + 1\n local bounds = obj.getBounds()\n local x1 = bounds['center'][1] - bounds['size'][1] / 2\n local x2 = bounds['center'][1] + bounds['size'][1] / 2\n local z1 = bounds['center'][3] - bounds['size'][3] / 2\n local z2 = bounds['center'][3] + bounds['size'][3] / 2\n\n totalBounds.minX = math.min(x1, totalBounds.minX)\n totalBounds.maxX = math.max(x2, totalBounds.maxX)\n totalBounds.minZ = math.min(z1, totalBounds.minZ)\n totalBounds.maxZ = math.max(z2, totalBounds.maxZ)\n end\n end\n\n -- default values (mainly for play area if nothing is found)\n if count == 0 then\n totalBounds.minX = -10\n totalBounds.maxX = -50\n totalBounds.minZ = -20\n totalBounds.maxZ = 20\n end\n\n totalBounds.middleX = (totalBounds.maxX + totalBounds.minX) / 2\n totalBounds.middleZ = (totalBounds.maxZ + totalBounds.minZ) / 2\n totalBounds.diffX = totalBounds.maxX - totalBounds.minX\n totalBounds.diffZ = totalBounds.maxZ - totalBounds.minZ\n\n return totalBounds\nend\n\n-- loads the specified camera for a player\nfunction loadCamera(player, index)\n local lookHere\n\n -- dynamic view of the play area\n if index == 2 then\n -- search the scripting zone on the play area for objects\n local bounds = getDynamicViewBounds(getObjectFromGUID(\"a2f932\").getObjects())\n\n lookHere = {\n position = { bounds.middleX, 1.55, bounds.middleZ },\n yaw = 90,\n distance = 0.8 * math.max(bounds.diffX, bounds.diffZ) + 7\n }\n -- dynamic view of the clicked play mat\n elseif index \u003e= 3 and index \u003c= 6 then\n local matColorList = { \"White\", \"Orange\", \"Green\", \"Red\" }\n local matColor = matColorList[index - 2] -- mat index 1 - 4\n\n -- check if anyone (except for yourself) has claimed this color\n local isClaimed = false\n\n for playerColor, playerTable in pairs(claims) do\n if playerColor ~= player.color and playerTable[matColor] then\n isClaimed = true\n break\n end\n end\n\n -- swap to that color if it isn't claimed by someone else\n if #getSeatedPlayers() == 1 or not isClaimed then\n local newPlayerColor = playmatApi.getPlayerColor(matColor)\n copyVisibility({ startColor = player.color, targetColor = newPlayerColor })\n player.changeColor(newPlayerColor)\n end\n\n -- search on the playmat for objects\n local bounds = getDynamicViewBounds(playmatApi.searchAroundPlaymat(matColor))\n\n lookHere = {\n position = { bounds.middleX, 0, bounds.middleZ },\n yaw = playmatApi.returnRotation(matColor).y + 180,\n distance = 0.42 * math.max(bounds.diffX, bounds.diffZ) + 7\n }\n end\n\n -- get default data if no dynamic view (play area or play mat) was loaded\n if not lookHere then\n lookHere = cameraData[index]\n lookHere.yaw = 90\n end\n\n -- set pitch to default if not edited\n lookHere.pitch = pitch[player.color] or 75\n\n -- delay is to account for colorswap\n Wait.frames(function() player.lookAt(lookHere) end, 2)\nend\n\n---------------------------------------------------------\n-- settings related functionality\n---------------------------------------------------------\n\n-- claims a color for a player\nfunction claimColor(player, color)\n local currentState = claims[player.color][color]\n claims[player.color][color] = not currentState\nend\n\nfunction loadDefaultSettings(player)\n -- reset claims for that player\n for _, color in ipairs(Player.getColors()) do\n claims[player.color][color] = (player.color == color)\n end\n\n -- reset pitch for that player\n pitch[player.color] = nil\n\n -- update the UI accordingly\n updateSettingsUI(player)\nend\n\n-- called by clicking a toggle\nfunction toggleSettings(player)\n if settingsOpenForColor == player.color then\n settingsOpenForColor = nil\n UI.setAttribute(\"navPanelSettings\", \"active\", false)\n elseif settingsOpenForColor then\n broadcastToColor(\"Someone else is currently using the settings. Please wait and try again.\", player.color, \"Yellow\")\n else\n settingsOpenForColor = player.color\n\n updateSettingsUI(player)\n UI.setAttribute(\"navPanelSettings\", \"visibility\", player.color)\n UI.setAttribute(\"navPanelSettings\", \"active\", true)\n end\nend\n\n-- called by the slider\nfunction updatePitch(player, number)\n pitch[player.color] = number\nend\n\n-- updates the settings UI for the provided player\nfunction updateSettingsUI(player)\n -- update the slider\n UI.setAttribute(\"sliderPitch\", \"value\", pitch[player.color] or 75)\n \n -- update the claims\n local matColorList = { \"White\", \"Orange\", \"Green\", \"Red\" }\n for _, matColor in pairs(matColorList) do\n UI.setAttribute(\"claim\" .. matColor, \"isOn\", claims[player.color][matColor] or false)\n end\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", - "LuaScriptState": "{\"claims\":{\"Black\":[],\"Blue\":[],\"Brown\":[],\"Green\":[],\"Grey\":[],\"Orange\":[],\"Pink\":[],\"Purple\":[],\"Red\":[],\"Teal\":[],\"White\":[],\"Yellow\":[]},\"pitch\":[],\"visibility\":{\"Black\":{\"full\":false,\"play\":false},\"Blue\":{\"full\":false,\"play\":false},\"Brown\":{\"full\":false,\"play\":false},\"Green\":{\"full\":false,\"play\":false},\"Grey\":{\"full\":false,\"play\":false},\"Orange\":{\"full\":false,\"play\":false},\"Pink\":{\"full\":false,\"play\":false},\"Purple\":{\"full\":false,\"play\":false},\"Red\":{\"full\":false,\"play\":false},\"Teal\":{\"full\":false,\"play\":false},\"White\":{\"full\":false,\"play\":false},\"Yellow\":{\"full\":false,\"play\":false}}}", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/NavigationOverlayHandler\")\nend)\n__bundle_register(\"core/NavigationOverlayHandler\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nfullButtonData = {\n { id = \"1\", width = \"84\", height = \"33\", offset = \"1 2\" }, -- 1. Act/Agenda\n { id = \"2\", width = \"78\", height = \"69\", offset = \"1 -62\" }, -- 2. Map\n { id = \"3\", width = \"70\", height = \"36\", offset = \"-38 -126\" }, -- 3. White\n { id = \"4\", width = \"70\", height = \"36\", offset = \"38 -126\" }, -- 4. Orange\n { id = \"5\", width = \"36\", height = \"70\", offset = \"-63 -66\" }, -- 5. Green\n { id = \"6\", width = \"36\", height = \"70\", offset = \"63 -66\" }, -- 6. Red\n { id = \"7\", width = \"38\", height = \"38\", offset = \"-65 -3\" }, -- 7. Victory\n { id = \"8\", width = \"40\", height = \"40\", offset = \"65 -3\" }, -- 8. Guide\n { id = \"9\", width = \"56\", height = \"16\", offset = \"1 -20\" }, -- 9. Player count\n { id = \"10\", width = \"36\", height = \"16\", offset = \"1 -102\" }, -- 10. Bless/Curse\n { id = \"11\", width = \"168\", height = \"56\", offset = \"1 47\" }, -- 11. Scenarios\n { id = \"12\", width = \"52\", height = \"53\", offset = \"-154 134\" }, -- 12. Player card panel\n { id = \"13\", width = \"22\", height = \"22\", offset = \"-116 132\" }, -- 13. Search card panel\n { id = \"14\", width = \"120\", height = \"75\", offset = \"-152 70\" }, -- 14. Player card display\n { id = \"15\", width = \"40\", height = \"54\", offset = \"-150 -38\" }, -- 15. Deck builder\n { id = \"16\", width = \"104\", height = \"84\", offset = \"-154 -114\" }, -- 16. Rules area\n { id = \"17\", width = \"100\", height = \"170\", offset = \"152 72\" }, -- 17. Cycle area\n { id = \"18\", width = \"56\", height = \"60\", offset = \"182 -124\" }, -- 18. Additions\n { id = \"19\", width = \"20\", height = \"20\", offset = \"0 150\" }, -- 19. Shrink\n { id = \"20\", width = \"20\", height = \"20\", offset = \"20 150\" }, -- 20. Close\n { id = \"21\", width = \"20\", height = \"20\", offset = \"-20 150\" } -- 21. Settings\n}\n\nplayButtonData = {\n { id = \"1\", width = \"80\", height = \"33\", offset = \"0 55\" },\n { id = \"2\", width = \"78\", height = \"70\", offset = \"0 -8\" },\n { id = \"3\", width = \"68\", height = \"32\", offset = \"-36 -71\" },\n { id = \"4\", width = \"68\", height = \"32\", offset = \"36 -71\" },\n { id = \"5\", width = \"35\", height = \"66\", offset = \"-65 -10\" },\n { id = \"6\", width = \"35\", height = \"66\", offset = \"65 -10\" },\n { id = \"7\", width = \"38\", height = \"38\", offset = \"-66 52\" },\n { id = \"8\", width = \"38\", height = \"38\", offset = \"66 52\" },\n { id = \"9\", width = \"50\", height = \"12\", offset = \"0 33\" },\n { id = \"10\", width = \"32\", height = \"12\", offset = \"0 -48\" },\n { id = \"19\", width = \"20\", height = \"20\", offset = \"0 80\" },\n { id = \"20\", width = \"20\", height = \"20\", offset = \"20 80\" },\n { id = \"21\", width = \"20\", height = \"20\", offset = \"-20 80\" }\n}\n\n-- To-Do: dynamically get positions by linking to objects\ncameraData = {\n { position = { -1.6, 1.55, 0 }, distance = 18 }, -- 1. Act/Agenda\n { position = { -28, 1.55, 0 }, distance = -1 }, -- 2. Map\n { position = { -31.6, 1.55, 26.4 }, distance = -1 }, -- 3. Green playmat\n { position = { -55, 1.55, 12.05 }, distance = -1 }, -- 4. White playmat\n { position = { -55, 1.55, -11.48 }, distance = -1 }, -- 5. Orange playmat\n { position = { -31.6, 1.55, -26.4 }, distance = -1 }, -- 6. Red playmat\n { position = { -3, 1.55, 30 }, distance = 16 }, -- 7. Victory / SetAside\n { position = { -3, 1.55, -26.76 }, distance = 16 }, -- 8. Guide\n { position = { -11.83, 1.55, 0 }, distance = 10 }, -- 9. Player count\n { position = { -48.35, 1.55, 0 }, distance = 10 }, -- 10. Bless/Curse\n { position = { 12.56, 1.55, 0 }, distance = 45 }, -- 11. Scenarios\n { position = { 57.8, 1.55, 71 }, distance = 22 }, -- 12. Player card panel\n { position = { 60.38, 1.55, 56 }, distance = 10 }, -- 13. Card search panel\n { position = { 27.48, 1.55, 71 }, distance = 35 }, -- 14. Player card area\n { position = { -19.48, 1.55, 71 }, distance = 22 }, -- 15. Deck builder\n { position = { -52.92, 1.55, 71 }, distance = 42 }, -- 16. Rules area\n { position = { 26, 1.55, -71 }, distance = 65 }, -- 17. Cycle area\n { position = { -59.08, 1.55, -83 }, distance = 27 } -- 18. Additions\n}\n\nlocal settingsOpenForColor\nlocal visibility = {}\nlocal claims = {}\nlocal pitch = {}\nlocal distance = {}\n\n---------------------------------------------------------\n-- save/load functionality\n---------------------------------------------------------\n\nfunction onSave()\n return JSON.encode({\n visibility = visibility,\n claims = claims,\n pitch = pitch,\n distance = distance\n })\nend\n\nfunction onLoad(savedData)\n if savedData ~= \"\" then\n local loadedData = JSON.decode(savedData)\n visibility = loadedData.visibility\n claims = loadedData.claims\n pitch = loadedData.pitch\n distance = loadedData.distance\n else\n local allColors = Player.getColors()\n\n for _, color in ipairs(allColors) do\n -- default state for claims\n claims[color] = {}\n\n -- default state for visibility\n visibility[color] = { full = false, play = false }\n end\n end\n\n createXmlButtons()\n updateVisibility()\nend\n\n---------------------------------------------------------\n-- visibility related functions\n---------------------------------------------------------\n\nfunction cycleVisibility(color)\n setVisibility(\"next\", color)\nend\n\nfunction copyVisibility(params)\n visibility[params.targetColor] = {\n full = visibility[params.startColor].full,\n play = visibility[params.startColor].play\n }\n updateVisibility()\nend\n\nfunction setVisibility(type, color)\n if type == \"next\" then\n if visibility[color].full then\n visibility[color] = { full = false, play = true }\n elseif visibility[color].play then\n visibility[color] = { full = false, play = false }\n else\n visibility[color] = { full = true, play = false }\n end\n elseif type == \"toggle\" then\n visibility[color] = {\n full = not visibility[color].full,\n play = not visibility[color].play\n }\n else\n visibility[color] = { full = false, play = false }\n end\n\n updateVisibility()\nend\n\n-- update XML visibility\nfunction updateVisibility()\n local colorString = { full = \"\", play = \"\" }\n\n for color, v in pairs(visibility) do\n if v.full then\n if colorString.full == \"\" then\n colorString.full = color\n else\n colorString.full = colorString.full .. '|' .. color\n end\n elseif v.play then\n if colorString.play == \"\" then\n colorString.play = color\n else\n colorString.play = colorString.play .. '|' .. color\n end\n end\n end\n\n -- update the visibility on the XML\n UI.setAttribute(\"navPanelFull\", \"visibility\", colorString.full)\n UI.setAttribute(\"navPanelPlay\", \"visibility\", colorString.play)\n UI.setAttribute(\"navPanelFull\", \"active\", colorString.full ~= \"\")\n UI.setAttribute(\"navPanelPlay\", \"active\", colorString.play ~= \"\")\nend\n\n---------------------------------------------------------\n-- XML button creation\n---------------------------------------------------------\n\nfunction createXmlButtons()\n local ui = UI.getXmlTable()\n ui = createXmlButtonHelper(ui, {\n data = fullButtonData,\n id = \"navPanelFull\",\n overlay = \"OverlayLarge\"\n })\n ui = createXmlButtonHelper(ui, {\n data = playButtonData,\n id = \"navPanelPlay\",\n overlay = \"OverlaySmall\"\n })\n UI.setXmlTable(ui)\nend\n\n-- XML button creation\nfunction createXmlButtonHelper(ui, params)\n local color\n local guid = self.getGUID()\n local xml = findTagWithId(ui, params.id)\n\n -- add basic image\n xml.children = { {\n tag = \"image\",\n attributes = {\n id = \"backgroundImage\",\n image = params.overlay\n }\n } }\n\n -- add all buttons\n for _, d in ipairs(params.data) do\n table.insert(xml.children, {\n tag = \"button\",\n attributes = {\n onClick = guid .. \"/buttonClicked\",\n id = d.id,\n height = d.height,\n width = d.width,\n offsetXY = d.offset,\n color = \"rgba(0,1,0,0)\"\n }\n })\n end\n return ui\nend\n\nfunction findTagWithId(ui, id)\n for _, obj in ipairs(ui) do\n if obj.attributes and obj.attributes.id and obj.attributes.id == id then return obj end\n if obj.children then\n local result = findTagWithId(obj.children, id)\n if result then return result end\n end\n end\n return nil\nend\n\n---------------------------------------------------------\n-- core functionality\n---------------------------------------------------------\n\n-- handles all button clicks\nfunction buttonClicked(player, _, id)\n local index = tonumber(id)\n\n if index == 19 then\n setVisibility(\"toggle\", player.color)\n elseif index == 20 then\n setVisibility(\"close\", player.color)\n elseif index == 21 then\n toggleSettings(player)\n else\n loadCamera(player, index)\n end\nend\n\n-- generates a table with rectangular bounds for provided objects\nfunction getDynamicViewBounds(objList)\n local count = 0\n local totalBounds = {\n minX = 0,\n maxX = -70,\n minZ = 60,\n maxZ = -60\n }\n\n for _, obj in pairs(objList) do\n if not obj.hasTag(\"CameraZoom_ignore\") and not obj.hasTag(\"CampaignLog\") then\n count = count + 1\n local bounds = obj.getBounds()\n local x1 = bounds['center'][1] - bounds['size'][1] / 2\n local x2 = bounds['center'][1] + bounds['size'][1] / 2\n local z1 = bounds['center'][3] - bounds['size'][3] / 2\n local z2 = bounds['center'][3] + bounds['size'][3] / 2\n\n totalBounds.minX = math.min(x1, totalBounds.minX)\n totalBounds.maxX = math.max(x2, totalBounds.maxX)\n totalBounds.minZ = math.min(z1, totalBounds.minZ)\n totalBounds.maxZ = math.max(z2, totalBounds.maxZ)\n end\n end\n\n -- default values (mainly for play area if nothing is found)\n if count == 0 then\n totalBounds.minX = -10\n totalBounds.maxX = -50\n totalBounds.minZ = -20\n totalBounds.maxZ = 20\n end\n\n totalBounds.middleX = (totalBounds.maxX + totalBounds.minX) / 2\n totalBounds.middleZ = (totalBounds.maxZ + totalBounds.minZ) / 2\n totalBounds.diffX = totalBounds.maxX - totalBounds.minX\n totalBounds.diffZ = totalBounds.maxZ - totalBounds.minZ\n\n return totalBounds\nend\n\nfunction loadCameraFromApi(params)\n loadCamera(params.player, params.camera)\nend\n\n-- loads the specified camera for a player\n---@param player TTSPlayerInstance Player whose camera should be moved\n---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to\nfunction loadCamera(player, camera)\n local lookHere, index, matColor\n local matColorList = { \"White\", \"Orange\", \"Green\", \"Red\" }\n local indexList = {\n White = 3,\n Orange = 4,\n Green = 5,\n Red = 6\n }\n\n if tonumber(camera) then\n index = tonumber(camera)\n matColor = matColorList[index - 2] -- mat index 1 - 4\n else\n index = indexList[camera]\n matColor = camera\n end\n\n -- dynamic view of the play area\n if index == 2 then\n -- search the scripting zone on the play area for objects\n local bounds = getDynamicViewBounds(getObjectFromGUID(\"a2f932\").getObjects())\n\n lookHere = {\n position = { bounds.middleX, 1.55, bounds.middleZ },\n yaw = 90,\n distance = 0.8 * math.max(bounds.diffX, bounds.diffZ) + 7\n }\n -- dynamic view of the clicked play mat\n elseif index \u003e= 3 and index \u003c= 6 then\n -- check if anyone (except for yourself) has claimed this color\n local isClaimed = false\n\n for playerColor, playerTable in pairs(claims) do\n if playerColor ~= player.color and playerTable[matColor] then\n isClaimed = true\n break\n end\n end\n\n -- swap to that color if it isn't claimed by someone else\n if #getSeatedPlayers() == 1 or not isClaimed then\n local newPlayerColor = playmatApi.getPlayerColor(matColor)\n copyVisibility({ startColor = player.color, targetColor = newPlayerColor })\n player.changeColor(newPlayerColor)\n player = Player[newPlayerColor]\n end\n\n -- search on the playmat for objects\n local bounds = getDynamicViewBounds(playmatApi.searchAroundPlaymat(matColor))\n\n lookHere = {\n position = { bounds.middleX, 0, bounds.middleZ },\n yaw = playmatApi.returnRotation(matColor).y + 180,\n distance = 0.42 * math.max(bounds.diffX, bounds.diffZ) + 7\n }\n end\n\n -- get default data if no dynamic view (play area or play mat) was loaded\n if not lookHere then\n lookHere = cameraData[index]\n lookHere.yaw = 90\n end\n\n -- set pitch to default if not edited\n lookHere.pitch = pitch[player.color] or 75\n\n -- update distance based on selected multiplier\n lookHere.distance = lookHere.distance * (distance[player.color] or 100) / 100\n\n -- delay is to account for colorswap\n Wait.frames(function() player.lookAt(lookHere) end, 2)\nend\n\n---------------------------------------------------------\n-- settings related functionality\n---------------------------------------------------------\n\n-- claims a color for a player\nfunction claimColor(player, color)\n local currentState = claims[player.color][color]\n claims[player.color][color] = not currentState\nend\n\nfunction loadDefaultSettings(player)\n -- reset claims for that player\n for _, color in ipairs(Player.getColors()) do\n claims[player.color][color] = (player.color == color)\n end\n\n -- reset pitch/distance for that player\n pitch[player.color] = nil\n distance[player.color] = nil\n\n -- update the UI accordingly\n updateSettingsUI(player)\nend\n\n-- called by clicking a toggle\nfunction toggleSettings(player)\n if settingsOpenForColor == player.color then\n settingsOpenForColor = nil\n UI.setAttribute(\"navPanelSettings\", \"active\", false)\n elseif settingsOpenForColor then\n broadcastToColor(\"Someone else is currently using the settings. Please wait and try again.\", player.color, \"Yellow\")\n else\n settingsOpenForColor = player.color\n\n updateSettingsUI(player)\n UI.setAttribute(\"navPanelSettings\", \"visibility\", player.color)\n UI.setAttribute(\"navPanelSettings\", \"active\", true)\n end\nend\n\n-- called by the navigation overlay options\nfunction updatePitch(player, number)\n pitch[player.color] = number\nend\n\n-- called by the navigation overlay options\nfunction updateDistance(player, number)\n distance[player.color] = number\nend\n\n-- updates the settings UI for the provided player\nfunction updateSettingsUI(player)\n -- update the sliders\n UI.setAttribute(\"sliderPitch\", \"value\", pitch[player.color] or 75)\n UI.setAttribute(\"sliderDistance\", \"value\", distance[player.color] or 100)\n \n -- update the claims\n local matColorList = { \"White\", \"Orange\", \"Green\", \"Red\" }\n for _, matColor in pairs(matColorList) do\n UI.setAttribute(\"claim\" .. matColor, \"isOn\", claims[player.color][matColor] or false)\n end\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "{\"claims\":{\"Black\":[],\"Blue\":[],\"Brown\":[],\"Green\":[],\"Grey\":[],\"Orange\":[],\"Pink\":[],\"Purple\":[],\"Red\":[],\"Teal\":[],\"White\":[],\"Yellow\":[]},\"distance\":[],\"pitch\":[],\"visibility\":{\"Black\":{\"full\":false,\"play\":false},\"Blue\":{\"full\":false,\"play\":false},\"Brown\":{\"full\":false,\"play\":false},\"Green\":{\"full\":false,\"play\":false},\"Grey\":{\"full\":false,\"play\":false},\"Orange\":{\"full\":false,\"play\":false},\"Pink\":{\"full\":false,\"play\":false},\"Purple\":{\"full\":false,\"play\":false},\"Red\":{\"full\":false,\"play\":false},\"Teal\":{\"full\":false,\"play\":false},\"White\":{\"full\":false,\"play\":false},\"Yellow\":{\"full\":false,\"play\":false}}}", "MeasureMovement": false, "Name": "go_game_piece_black", "Nickname": "Navigation Overlay Handler", @@ -198756,6 +201059,15 @@ "y": 0, "z": 0 }, + "AttachedSnapPoints": [ + { + "Position": { + "x": -0.95, + "y": 0.2, + "z": 0 + } + } + ], "Autoraise": true, "ColorDiffuse": { "b": 1, @@ -198774,7 +201086,7 @@ "ImageURL": "http://cloud-3.steamusercontent.com/ugc/254843371583173230/BECDC34EB4D2C8C5F9F9933C97085F82A2F21AE3/", "WidthScale": 0 }, - "Description": "Saves the state of the table to enable loading the campaign into a new save and keep all current progress.\n\nThis tool will track which campaign you're playing, the entire contents of your campaign log, the contents of your chaos bag, update your health/sanity according to trauma, your ArkhamDB deck IDs, the number of investigators, the page of your campaign guide, and any options you have selected in the options panel.\n\nFor saving trauma values to correct seats, ensure investigators in the campaign log are in the following order: White, Orange, Green, Red\n\n(For custom campaigns, ensure: 1) Campaign Box, Campaign Log, and Campaign Guide each have the corresponding tag, 2)The Campaign Box is on the table when you import or export.", + "Description": "Saves the state of the table to enable loading the campaign into a new save and keep all current progress.\n\nThis tool will track which campaign you're playing, the entire contents of your campaign log, the contents of your chaos bag, update your health/sanity according to trauma, your ArkhamDB deck IDs, the number of investigators, the page of your campaign guide, cards in the Additional Player Cards bag and any options you have selected in the options panel.\n\nFor saving trauma values to correct seats, ensure investigators in the campaign log are in the following order: White, Orange, Green, Red\n\nFor custom campaigns, ensure: 1) Campaign Box, Campaign Log, and Campaign Guide each have the corresponding tag, 2)The Campaign Box is on the table when you import or export.", "DragSelectable": true, "GMNotes": "", "GUID": "334ee3", @@ -198785,7 +201097,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/CampaignImporterExporter\")\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"accessories/CampaignImporterExporter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckImporterApi = require(\"arkhamdb/DeckImporterApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal optionPanelApi = require(\"core/OptionPanelApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal campaignTokenData = {\n Name = \"Custom_Model\",\n Transform = {\n posX = -21.25,\n posY = 1.68,\n posZ = 55.59,\n rotX = 0,\n rotY = 270,\n rotZ = 0,\n scaleX = 2,\n scaleY = 2,\n scaleZ = 2\n },\n Description = \"SCED Importer Token\",\n Tags = {\n \"ImporterToken\"\n },\n CustomMesh = {\n MeshURL = \"http://cloud-3.steamusercontent.com/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/\",\n DiffuseURL = \"http://cloud-3.steamusercontent.com/ugc/254843371583188147/920981125E37B5CEB6C400E3FD353A2C428DA969/\",\n NormalURL = \"\",\n ColliderURL = \"http://cloud-3.steamusercontent.com/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/\",\n Convex = true,\n MaterialIndex = 2,\n TypeIndex = 0,\n CustomShader = {\n SpecularColor = {\n r = 0.7222887,\n g = 0.507659256,\n b = 0.339915335\n },\n SpecularIntensity = 0.4,\n SpecularSharpness = 7.0,\n FresnelStrength = 0.0\n },\n CastShadows = true\n }\n}\nlocal COLORS = { \"White\", \"Orange\", \"Green\", \"Red\" }\n\nfunction onLoad()\n self.createButton({\n click_function = \"findCampaignFromToken\",\n function_owner = self,\n label = \"Import\",\n tooltip = \"Load in a campaign save from a token!\\n\\n(Token can be anywhere on the table, but ensure there is only 1!)\",\n position = { x = -1, y = 0.2, z = 0 },\n font_size = 400,\n width = 1400,\n height = 600,\n scale = { 0.5, 1, 0.5 },\n })\n self.createButton({\n click_function = \"createCampaignToken\",\n function_owner = self,\n label = \"Export\",\n tooltip = \"Create a campaign save token!\\n\\n(Ensure all chaos tokens have been unsealed!)\",\n position = { x = 1, y = 0.2, z = 0 },\n font_size = 400,\n width = 1400,\n height = 600,\n scale = { 0.5, 1, 0.5 },\n })\nend\n\n---------------------------------------------------------\n-- main import functions (split up to allow for Wait conditions)\n---------------------------------------------------------\n\n-- Identifies import token, determines campaign box and downloads it (if needed)\nfunction findCampaignFromToken(_, _, _)\n local coin = nil\n local coinObjects = getObjectsWithTag(\"ImporterToken\")\n if #coinObjects == 0 then\n broadcastToAll(\"Could not find importer token\", Color.Red)\n elseif #coinObjects \u003e 1 then\n broadcastToAll(\"More than 1 importer token found. Please delete all but 1 importer token\", Color.Yellow)\n else\n coin = coinObjects[1]\n\n local importData = JSON.decode(coin.getGMNotes())\n campaignBoxGUID = importData[\"box\"]\n\n local campaignBox = getObjectFromGUID(campaignBoxGUID)\n if campaignBox.type == \"Generic\" then\n campaignBox.call(\"buttonClick_download\")\n end\n Wait.condition(\n function()\n if #campaignBox.getObjects() \u003e 0 then\n placeCampaignFromToken(importData)\n else\n createCampaignFromToken(importData)\n end\n end,\n function()\n local obj = getObjectFromGUID(campaignBoxGUID)\n if obj == nil then\n return false\n else\n return obj.type == \"Bag\" and obj.getLuaScript() ~= \"\"\n end\n end,\n 2,\n function() broadcastToAll(\"Error loading campaign box\") end\n )\n end\nend\n\n-- After box has been downloaded, places content on table\nfunction placeCampaignFromToken(importData)\n getObjectFromGUID(importData[\"box\"]).call(\"buttonClick_place\")\n Wait.condition(\n function() createCampaignFromToken(importData) end,\n function() return findUniqueObjectWithTag(\"CampaignLog\") ~= nil end,\n 2,\n function() broadcastToAll(\"Error placing campaign box\") end\n )\nend\n\n-- After content is placed on table, conducts all the other import operations\nfunction createCampaignFromToken(importData)\n -- destroy existing campaign log and load saved campaign log\n findUniqueObjectWithTag(\"CampaignLog\").destruct()\n spawnObjectData({ data = importData[\"log\"] })\n \n chaosBagApi.setChaosBagState(importData[\"bag\"])\n\n -- populate trauma values\n if importData[\"trauma\"] then\n setTrauma(importData[\"trauma\"])\n end\n\n -- populate ArkhamDB deck IDs\n if importData[\"decks\"] then\n deckImporterApi.setUiState(importData[\"decks\"])\n end\n\n playAreaApi.setInvestigatorCount(importData[\"clueCount\"])\n\n -- set campaign guide page\n local guide = findUniqueObjectWithTag(\"CampaignGuide\")\n if guide then\n Wait.condition(\n -- Called after the condition function returns true\n function() log(\"Campaign Guide import successful!\") end,\n -- Condition function that is called continiously until returs true or timeout is reached\n function() return guide.Book.setPage(importData[\"guide\"]) end,\n -- Amount of time in seconds until the Wait times out\n 1,\n -- Called if the Wait times out\n function() log(\"Campaign Guide import failed!\") end\n )\n end\n\n Wait.time(function() optionPanelApi.loadSettings(importData[\"options\"]) end, 0.5)\n\n -- destroy Tour Starter token\n local tourStarter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TourStarter\")\n tourStarter.destruct()\n\n -- restore PlayArea image\n playAreaApi.updateSurface(importData[\"playmat\"])\n\n broadcastToAll(\"Campaign successfully imported!\", Color.Green)\nend\n\n-- Creates a campaign token with save data encoded into GM Notes based on the current state of the table\nfunction createCampaignToken(_, playerColor, _)\n -- clean up chaos tokens\n blessCurseApi.removeAll(playerColor)\n chaosBagApi.releaseAllSealedTokens(playerColor)\n\n -- find active campaign\n local campaignBox\n for _, obj in ipairs(getObjectsWithTag(\"CampaignBox\")) do\n if obj.type == \"Bag\" and #obj.getObjects() == 0 then\n if not campaignBox then\n campaignBox = obj\n else\n broadcastToAll(\"Multiple empty campaign box detected; delete all but one.\", Color.Red)\n return\n end\n end\n end\n if not campaignBox then\n broadcastToAll(\"Campaign box with all placed objects not found!\", Color.Red)\n return\n end\n\n local campaignLog = findUniqueObjectWithTag(\"CampaignLog\")\n if campaignLog == nil then\n broadcastToAll(\"Campaign log not found!\", Color.Red)\n return\n end\n\n local traumaValues = {\n 0, 0, 0, 0,\n 0, 0, 0, 0\n }\n local counterData = campaignLog.getVar(\"ref_buttonData\")\n if counterData ~= nil then\n printToAll(\"Trauma values found in campaign log!\", \"Green\")\n for i = 1, 10, 3 do\n traumaValues[1 + (i - 1) / 3] = counterData.counter[i].value\n traumaValues[5 + (i - 1) / 3] = counterData.counter[i + 1].value\n end\n else\n printToAll(\"Trauma values could not be found in campaign log!\", \"Yellow\")\n printToAll(\"Default values for health and sanity loaded.\", \"Yellow\")\n end\n\n local campaignGuide = findUniqueObjectWithTag(\"CampaignGuide\")\n if campaignGuide == nil then\n broadcastToAll(\"Campaign guide not found!\", Color.Red)\n return\n end\n\n local campaignData = {\n box = campaignBox.getGUID(),\n log = campaignLog.getData(),\n bag = chaosBagApi.getChaosBagState(),\n trauma = traumaValues,\n decks = deckImporterApi.getUiState(),\n clueCount = playAreaApi.getInvestigatorCount(),\n guide = campaignGuide.Book.getPage(),\n options = optionPanelApi.getOptions(),\n playmat = playAreaApi.getSurface()\n }\n campaignTokenData.GMNotes = JSON.encode(campaignData)\n campaignTokenData.Nickname = os.date(\"%b %d \") .. campaignBox.getName() .. \" Save\"\n spawnObjectData({ data = campaignTokenData })\n broadcastToAll(\"Campaign successfully exported! Save coin object to import on a fresh save\", Color.Green)\nend\n\n---------------------------------------------------------\n-- helper functions\n---------------------------------------------------------\n\nfunction findUniqueObjectWithTag(tag)\n local objects = getObjectsWithTag(tag)\n if not objects then return end\n\n if #objects == 1 then\n return objects[1]\n else\n broadcastToAll(\"More than 1 \" .. tag .. \" detected; delete all but one.\", Color.Red)\n return nil\n end\nend\n\nfunction setTrauma(trauma)\n for i = 1, 4 do\n playmatApi.updateCounter(COLORS[i], \"DamageCounter\", trauma[i])\n playmatApi.updateCounter(COLORS[i], \"HorrorCounter\", trauma[i + 4])\n end\nend\nend)\n__bundle_register(\"arkhamdb/DeckImporterApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckImporterApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getDeckImporter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DeckImporter\")\n end\n\n -- Returns a table with the full state of the UI, including options and deck IDs.\n -- This can be used to persist via onSave(), or provide values for a load operation\n -- Table values:\n -- redDeck: Deck ID to load for the red player\n -- orangeDeck: Deck ID to load for the orange player\n -- whiteDeck: Deck ID to load for the white player\n -- greenDeck: Deck ID to load for the green player\n -- private: True to load a private deck, false to load a public deck\n -- loadNewest: True if the most upgraded version of the deck should be loaded\n -- investigators: True if investigator cards should be spawned\n DeckImporterApi.getUiState = function()\n local passthroughTable = {}\n for k,v in pairs(getDeckImporter().call(\"getUiState\")) do\n passthroughTable[k] = v\n end\n return passthroughTable\n end\n\n -- Updates the state of the UI based on the provided table. Any values not provided will be left the same.\n ---@param uiStateTable Table of values to update on importer\n -- Table values:\n -- redDeck: Deck ID to load for the red player\n -- orangeDeck: Deck ID to load for the orange player\n -- whiteDeck: Deck ID to load for the white player\n -- greenDeck: Deck ID to load for the green player\n -- private: True to load a private deck, false to load a public deck\n -- loadNewest: True if the most upgraded version of the deck should be loaded\n -- investigators: True if investigator cards should be spawned\n DeckImporterApi.setUiState = function(uiStateTable)\n return getDeckImporter().call(\"setUiState\", uiStateTable)\n end\n\n return DeckImporterApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds Wendy's menu to the hovered card (allows sealing of tokens)\n ---@param color String Color of the player to show the broadcast to\n BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter Function Optional filter function (return true for desired objects)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"accessories/CampaignImporterExporter\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal blessCurseApi = require(\"chaosbag/BlessCurseManagerApi\")\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal deckImporterApi = require(\"arkhamdb/DeckImporterApi\")\nlocal guidReferenceApi = require(\"core/GUIDReferenceApi\")\nlocal optionPanelApi = require(\"core/OptionPanelApi\")\nlocal playAreaApi = require(\"core/PlayAreaApi\")\nlocal playmatApi = require(\"playermat/PlaymatApi\")\n\nlocal checkWarning = true\n\nlocal campaignTokenData = {\n Name = \"Custom_Model_Bag\",\n Transform = {\n posX = -21.25,\n posY = 1.68,\n posZ = 55.59,\n rotX = 0,\n rotY = 270,\n rotZ = 0,\n scaleX = 2,\n scaleY = 2,\n scaleZ = 2\n },\n Description = \"SCED Importer Token\",\n Tags = {\n \"ImporterToken\"\n },\n CustomMesh = {\n MeshURL = \"http://cloud-3.steamusercontent.com/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/\",\n DiffuseURL = \"http://cloud-3.steamusercontent.com/ugc/254843371583188147/920981125E37B5CEB6C400E3FD353A2C428DA969/\",\n NormalURL = \"\",\n ColliderURL = \"http://cloud-3.steamusercontent.com/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/\",\n Convex = true,\n MaterialIndex = 2,\n TypeIndex = 6,\n CustomShader = {\n SpecularColor = {\n r = 0.7222887,\n g = 0.507659256,\n b = 0.339915335\n },\n SpecularIntensity = 0.4,\n SpecularSharpness = 7.0,\n FresnelStrength = 0.0\n },\n CastShadows = true\n }\n}\nlocal COLORS = { \"White\", \"Orange\", \"Green\", \"Red\" }\n\nfunction onLoad()\n self.createButton({\n click_function = \"createCampaignToken\",\n function_owner = self,\n label = \"Export\",\n tooltip = \"Create a campaign save token!\",\n position = { x = -1, y = 0.21, z = 0 },\n font_size = 400,\n width = 1400,\n height = 600,\n scale = { 0.5, 1, 0.5 },\n })\nend\n\nfunction onObjectLeaveContainer(container, object)\n if container.hasTag(\"ImporterToken\") and checkWarning then\n broadcastToAll(\n \"Removing objects from the Save Coin bag will break functionality. Please replace the objects in the same order they were removed.\",\n Color.Yellow\n )\n end\nend\n\nfunction onObjectEnterContainer(container, object)\n if container.hasTag(\"ImporterToken\") and checkWarning then\n broadcastToAll(\n \"Adding objects to the Save Coin bag will break functionality. Please remove the objects.\",\n Color.Yellow\n )\n end\nend\n\n---------------------------------------------------------\n-- main import functions (split up to allow for Wait conditions)\n---------------------------------------------------------\n\nfunction onCollisionEnter(info)\n if info.collision_object.hasTag(\"ImporterToken\") then\n importFromToken(info.collision_object)\n end\nend\n\n-- Identifies import token, determines campaign box and downloads it (if needed)\nfunction importFromToken(coin)\n broadcastToAll(\"Campaign Import Initiated\")\n local importData = JSON.decode(coin.getGMNotes())\n\n local campaignBoxGUID = importData[\"box\"]\n local campaignBox = getObjectFromGUID(campaignBoxGUID)\n if not campaignBox then\n broadcastToAll(\"Campaign Box not present on table!\", Color.Red)\n return\n end\n if campaignBox.type == \"Generic\" then\n campaignBox.call(\"buttonClick_download\")\n end\n Wait.condition(\n function()\n if #campaignBox.getObjects() \u003e 0 then\n placeCampaignFromToken(importData, coin)\n else\n restoreCampaignData(importData, coin)\n end\n end,\n function()\n local obj = getObjectFromGUID(campaignBoxGUID)\n if obj == nil then\n return false\n else\n return obj.type == \"Bag\" and obj.getLuaScript() ~= \"\"\n end\n end,\n 2,\n function() broadcastToAll(\"Error loading campaign box\") end\n )\nend\n\n-- After box has been downloaded, places content on table\nfunction placeCampaignFromToken(importData, coin)\n getObjectFromGUID(importData[\"box\"]).call(\"buttonClick_place\")\n Wait.condition(\n function() restoreCampaignData(importData, coin) end,\n function() return findUniqueObjectWithTag(\"CampaignLog\") ~= nil end,\n 2,\n function() broadcastToAll(\"Error placing campaign box\") end\n )\nend\n\n-- After content is placed on table, conducts all the other import operations\nfunction restoreCampaignData(importData, coin)\n\n checkWarning = false\n if importData[\"additionalIndex\"] then\n guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AdditionalPlayerCardsBag\").destruct()\n if coin.type == \"Bag\" then\n coin.takeObject({index = 0, position = importData[\"additionalIndex\"], callback_function = function(obj) obj.setLock(true) end})\n else\n spawnObjectJSON({json = importData[\"additionalIndex\"]})\n end\n end\n\n -- destroy existing campaign log and load saved campaign log\n findUniqueObjectWithTag(\"CampaignLog\").destruct()\n if coin.type == \"Bag\" then\n local newLog = coin.takeObject({index = 0, position = importData[\"log\"], callback_function = function(obj) obj.setLock(true) end})\n else\n spawnObjectData({ data = importData[\"log\"] })\n end\n\n coin.destruct()\n checkWarning = true\n\n chaosBagApi.setChaosBagState(importData[\"bag\"])\n\n -- populate trauma values\n if importData[\"trauma\"] then\n setTrauma(importData[\"trauma\"])\n end\n\n -- populate ArkhamDB deck IDs\n if importData[\"decks\"] then\n deckImporterApi.setUiState(importData[\"decks\"])\n end\n\n playAreaApi.setInvestigatorCount(importData[\"clueCount\"])\n\n -- set campaign guide page\n local guide = findUniqueObjectWithTag(\"CampaignGuide\")\n if guide then\n Wait.condition(\n -- Called after the condition function returns true\n function() log(\"Campaign Guide import successful!\") end,\n -- Condition function that is called continiously until returs true or timeout is reached\n function() return guide.Book.setPage(importData[\"guide\"]) end,\n -- Amount of time in seconds until the Wait times out\n 2,\n -- Called if the Wait times out\n function() log(\"Campaign Guide import failed!\") end\n )\n end\n\n Wait.time(function() optionPanelApi.loadSettings(importData[\"options\"]) end, 0.5)\n\n -- destroy Tour Starter token\n local tourStarter = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"TourStarter\")\n if tourStarter then\n tourStarter.destruct()\n end\n\n -- restore PlayArea image\n playAreaApi.updateSurface(importData[\"playarea\"])\n\n broadcastToAll(\"Campaign successfully imported!\", Color.Green)\nend\n\n-- Creates a campaign token with save data encoded into GM Notes based on the current state of the table\nfunction createCampaignToken(_, playerColor, _)\n\n -- find active campaign\n local campaignBox\n for _, obj in ipairs(getObjectsWithTag(\"CampaignBox\")) do\n if obj.type == \"Bag\" and #obj.getObjects() == 0 then\n if not campaignBox then\n campaignBox = obj\n else\n broadcastToAll(\"Multiple empty campaign box detected; delete all but one.\", Color.Red)\n return\n end\n end\n end\n if not campaignBox then\n broadcastToAll(\"Campaign box with all placed objects not found!\", Color.Red)\n return\n end\n\n local campaignLog = findUniqueObjectWithTag(\"CampaignLog\")\n if campaignLog == nil then\n broadcastToAll(\"Campaign log not found!\", Color.Red)\n return\n end\n\n local additionalIndex = guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"AdditionalPlayerCardsBag\")\n\n local traumaValues = { }\n local trauma = campaignLog.getVar(\"returnTrauma\")\n\n if trauma ~= nil then\n printToAll(\"Trauma values found in campaign log!\", \"Green\")\n trauma = campaignLog.call(\"returnTrauma\")\n for _, val in ipairs(trauma) do\n table.insert(traumaValues, val)\n end\n else\n printToAll(\"Trauma values could not be found in campaign log!\", \"Yellow\") \n end\n\n local campaignGuide = findUniqueObjectWithTag(\"CampaignGuide\")\n if campaignGuide == nil then\n broadcastToAll(\"Campaign guide not found!\", Color.Red)\n return\n end\n\n -- clean up chaos tokens\n blessCurseApi.removeAll(playerColor)\n chaosBagApi.releaseAllSealedTokens(playerColor)\n\n local campaignData = {\n box = campaignBox.getGUID(),\n log = campaignLog.getPosition(),\n bag = chaosBagApi.getChaosBagState(),\n trauma = traumaValues,\n decks = deckImporterApi.getUiState(),\n clueCount = playAreaApi.getInvestigatorCount(),\n playarea = playAreaApi.getSurface(),\n options = optionPanelApi.getOptions(),\n guide = campaignGuide.Book.getPage(),\n additionalIndex = additionalIndex.getPosition()\n }\n campaignTokenData.GMNotes = JSON.encode(campaignData)\n campaignTokenData.Nickname = campaignBox.getName() .. os.date(\" %b %d\") .. \" Save\"\n campaignTokenData.ContainedObjects = { }\n local indexData = additionalIndex.getData()\n indexData.Locked = false\n table.insert(campaignTokenData.ContainedObjects, indexData)\n local logData = campaignLog.getData()\n logData.Locked = false\n table.insert(campaignTokenData.ContainedObjects, logData)\n spawnObjectData({ data = campaignTokenData })\n broadcastToAll(\"Campaign successfully exported! Save coin object to import on a fresh save\", Color.Green)\nend\n\n---------------------------------------------------------\n-- helper functions\n---------------------------------------------------------\n\nfunction findUniqueObjectWithTag(tag)\n local objects = getObjectsWithTag(tag)\n if not objects then return end\n\n if #objects == 1 then\n return objects[1]\n else\n broadcastToAll(\"More than 1 \" .. tag .. \" detected; delete all but one.\", Color.Red)\n return nil\n end\nend\n\nfunction setTrauma(trauma)\n for i = 1, 4 do\n playmatApi.updateCounter(COLORS[i], \"DamageCounter\", trauma[i])\n playmatApi.updateCounter(COLORS[i], \"HorrorCounter\", trauma[i + 4])\n end\nend\n\n-- gets data from campaign log if possible\nfunction loadTrauma(log)\n local trauma = log.getVar(\"returnTrauma\")\n\n if trauma ~= nil then\n printToAll(\"Trauma values found in campaign log!\", \"Green\")\n trauma = log.call(\"returnTrauma\")\n return trauma\n else\n return nil\n end\nend\nend)\n__bundle_register(\"core/PlayAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlayAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getPlayArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"PlayArea\")\n end\n\n local function getInvestigatorCounter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"InvestigatorCounter\")\n end\n\n -- Returns the current value of the investigator counter from the playmat\n ---@return Integer. Number of investigators currently set on the counter\n PlayAreaApi.getInvestigatorCount = function()\n return getInvestigatorCounter().getVar(\"val\")\n end\n\n -- Updates the current value of the investigator counter from the playmat\n ---@param count Number of investigators to set on the counter\n PlayAreaApi.setInvestigatorCount = function(count)\n getInvestigatorCounter().call(\"updateVal\", count)\n end\n\n -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain\n -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'\n ---@param playerColor Color Color of the player requesting the shift for messages\n PlayAreaApi.shiftContentsUp = function(playerColor)\n return getPlayArea().call(\"shiftContentsUp\", playerColor)\n end\n\n PlayAreaApi.shiftContentsDown = function(playerColor)\n return getPlayArea().call(\"shiftContentsDown\", playerColor)\n end\n\n PlayAreaApi.shiftContentsLeft = function(playerColor)\n return getPlayArea().call(\"shiftContentsLeft\", playerColor)\n end\n\n PlayAreaApi.shiftContentsRight = function(playerColor)\n return getPlayArea().call(\"shiftContentsRight\", playerColor)\n end\n\n -- Reset the play area's tracking of which cards have had tokens spawned.\n PlayAreaApi.resetSpawnedCards = function()\n return getPlayArea().call(\"resetSpawnedCards\")\n end\n\n -- Sets whether location connections should be drawn\n PlayAreaApi.setConnectionDrawState = function(state)\n getPlayArea().call(\"setConnectionDrawState\", state)\n end\n\n -- Sets the connection color\n PlayAreaApi.setConnectionColor = function(color)\n getPlayArea().call(\"setConnectionColor\", color)\n end\n\n -- Event to be called when the current scenario has changed.\n ---@param scenarioName Name of the new scenario\n PlayAreaApi.onScenarioChanged = function(scenarioName)\n getPlayArea().call(\"onScenarioChanged\", scenarioName)\n end\n\n -- Sets this playmat's snap points to limit snapping to locations or not.\n -- If matchTypes is false, snap points will be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types.\n PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)\n getPlayArea().call(\"setLimitSnapsByType\", matchCardTypes)\n end\n\n -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged\n -- cards before they're destroyed by entering the container\n PlayAreaApi.tryObjectEnterContainer = function(container, object)\n getPlayArea().call(\"tryObjectEnterContainer\", { container = container, object = object })\n end\n\n -- counts the VP on locations in the play area\n PlayAreaApi.countVP = function()\n return getPlayArea().call(\"countVP\")\n end\n\n -- highlights all locations in the play area without metadata\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightMissingData = function(state)\n return getPlayArea().call(\"highlightMissingData\", state)\n end\n \n -- highlights all locations in the play area with VP\n ---@param state Boolean True if highlighting should be enabled\n PlayAreaApi.highlightCountedVP = function(state)\n return getPlayArea().call(\"countVP\", state)\n end\n\n -- Checks if an object is in the play area (returns true or false)\n PlayAreaApi.isInPlayArea = function(object)\n return getPlayArea().call(\"isInPlayArea\", object)\n end\n\n PlayAreaApi.getSurface = function()\n return getPlayArea().getCustomObject().image\n end\n\n PlayAreaApi.updateSurface = function(url)\n return getPlayArea().call(\"updateSurface\", url)\n end\n \n -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the\n -- data to the local token manager instance.\n ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call\n PlayAreaApi.updateLocations = function(args)\n getPlayArea().call(\"updateLocations\", args)\n end\n\n PlayAreaApi.getCustomDataHelper = function()\n return getPlayArea().getVar(\"customDataHelper\")\n end\n\n return PlayAreaApi\nend\nend)\n__bundle_register(\"util/SearchLib\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local SearchLib = {}\n local filterFunctions = {\n isActionToken = function(x) return x.getDescription() == \"Action Token\" end,\n isCard = function(x) return x.type == \"Card\" end,\n isDeck = function(x) return x.type == \"Deck\" end,\n isCardOrDeck = function(x) return x.type == \"Card\" or x.type == \"Deck\" end,\n isClue = function(x) return x.memo == \"clueDoom\" and x.is_face_down == false end,\n isTileOrToken = function(x) return x.type == \"Tile\" end\n }\n\n -- performs the actual search and returns a filtered list of object references\n ---@param pos Table Global position\n ---@param rot Table Global rotation\n ---@param size Table Size\n ---@param filter String Name of the filter function\n ---@param direction Table Direction (positive is up)\n ---@param maxDistance Number Distance for the cast\n local function returnSearchResult(pos, rot, size, filter, direction, maxDistance)\n if filter then filter = filterFunctions[filter] end\n local searchResult = Physics.cast({\n origin = pos,\n direction = direction or { 0, 1, 0 },\n orientation = rot or { 0, 0, 0 },\n type = 3,\n size = size,\n max_distance = maxDistance or 0\n })\n\n -- filtering the result\n local objList = {}\n for _, v in ipairs(searchResult) do\n if not filter or filter(v.hit_object) then\n table.insert(objList, v.hit_object)\n end\n end\n return objList\n end\n\n -- searches the specified area\n SearchLib.inArea = function(pos, rot, size, filter)\n return returnSearchResult(pos, rot, size, filter)\n end\n\n -- searches the area on an object\n SearchLib.onObject = function(obj, filter)\n pos = obj.getPosition()\n size = obj.getBounds().size:setAt(\"y\", 1)\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches the specified position (a single point)\n SearchLib.atPosition = function(pos, filter)\n size = { 0.1, 2, 0.1 }\n return returnSearchResult(pos, _, size, filter)\n end\n\n -- searches below the specified position (downwards until y = 0)\n SearchLib.belowPosition = function(pos, filter)\n direction = { 0, -1, 0 }\n maxDistance = pos.y\n return returnSearchResult(pos, _, size, filter, direction, maxDistance)\n end\n\n return SearchLib\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"core/OptionPanelApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local OptionPanelApi = {}\n\n -- loads saved options\n ---@param options Table New options table\n OptionPanelApi.loadSettings = function(options)\n return Global.call(\"loadSettings\", options)\n end\n\n -- returns option panel table\n OptionPanelApi.getOptions = function()\n return Global.getTable(\"optionPanel\")\n end\n\n return OptionPanelApi\nend\nend)\n__bundle_register(\"playermat/PlaymatApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local PlaymatApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n local searchLib = require(\"util/SearchLib\")\n\n -- Convenience function to look up a mat's object by color, or get all mats.\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@return array Table Single-element if only single playmat is requested\n local function getMatForColor(matColor)\n if matColor == \"All\" then\n return guidReferenceApi.getObjectsByType(\"Playermat\")\n else\n return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, \"Playermat\") }\n end\n end\n\n -- Returns the color of the closest playmat\n ---@param startPos Table Starting position to get the closest mat from\n PlaymatApi.getMatColorByPosition = function(startPos)\n local result, smallestDistance\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local distance = Vector.between(startPos, mat.getPosition()):magnitude()\n if smallestDistance == nil or distance \u003c smallestDistance then\n smallestDistance = distance\n result = matColor\n end\n end\n return result\n end\n\n -- Returns the color of the player's hand that is seated next to the playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getPlayerColor = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"playerColor\")\n end\n end\n\n -- Returns the color of the playmat that owns the playercolor's hand\n ---@param handColor String Color of the playmat\n PlaymatApi.getMatColor = function(handColor)\n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local playerColor = mat.getVar(\"playerColor\")\n if playerColor == handColor then\n return matColor\n end\n end\n end\n\n -- Returns if there is the card \"Dream-Enhancing Serum\" on the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.isDES = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"isDES\")\n end\n end\n\n -- Performs a search of the deck area of the requested playmat and returns the result as table\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDeckAreaObjects = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getDeckAreaObjects\")\n end\n end\n\n -- Flips the top card of the deck (useful after deck manipulation for Norman Withers)\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.flipTopCardFromDeck = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"flipTopCardFromDeck\")\n end\n end\n\n -- Returns the position of the discard pile of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.getDiscardPosition = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"returnGlobalDiscardPosition\")\n end\n end\n\n -- Transforms a local position into a global position\n ---@param localPos Table Local position to be transformed\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.transformLocalPosition = function(localPos, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.positionToWorld(localPos)\n end\n end\n\n -- Returns the rotation of the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnRotation = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getRotation()\n end\n end\n\n -- Returns a table with spawn data (position and rotation) for a helper object\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param helperName String Name of the helper object\n PlaymatApi.getHelperSpawnData = function(matColor, helperName)\n local resultTable = {}\n local localPositionTable = {\n [\"Hand Helper\"] = {0.05, 0, -1.182},\n [\"Search Assistant\"] = {-0.3, 0, -1.182}\n }\n \n for color, mat in pairs(getMatForColor(matColor)) do\n resultTable[color] = {\n position = mat.positionToWorld(localPositionTable[helperName]),\n rotation = mat.getRotation()\n }\n end\n return resultTable\n end\n\n\n -- Triggers the Upkeep for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param playerColor String Color of the calling player (for messages)\n PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doUpkeepFromHotkey\", playerColor)\n end\n end\n\n -- Handles discarding for the requested playmat for the provided list of objects\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param objList Table List of objects to discard\n PlaymatApi.discardListOfObjects = function(matColor, objList)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"discardListOfObjects\", objList)\n end\n end\n\n -- Returns the active investigator id\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n PlaymatApi.returnInvestigatorId = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.getVar(\"activeInvestigatorId\")\n end\n end\n\n -- Sets the requested playmat's snap points to limit snapping to matching card types or not. If\n -- matchTypes is true, the main card slot snap points will only snap assets, while the\n -- investigator area point will only snap Investigators. If matchTypes is false, snap points will\n -- be reset to snap all cards.\n ---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"setLimitSnapsByType\", matchCardTypes)\n end\n end\n\n -- Sets the requested playmat's draw 1 button to visible\n ---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"showDrawButton\", isDrawButtonVisible)\n end\n end\n\n -- Shows or hides the clickable clue counter for the requested playmat\n ---@param showCounter Boolean Whether the clickable counter should be present or not\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.clickableClues = function(showCounter, matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"clickableClues\", showCounter)\n end\n end\n\n -- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.removeClues = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"removeClues\")\n end\n end\n\n -- Reports the clue count for the requested playmat\n ---@param useClickableCounters Boolean Controls which type of counter is getting checked\n PlaymatApi.getClueCount = function(useClickableCounters, matColor)\n local count = 0\n for _, mat in pairs(getMatForColor(matColor)) do\n count = count + mat.call(\"getClueCount\", useClickableCounters)\n end\n return count\n end\n\n -- updates the specified owned counter\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param type String Counter to target\n ---@param newValue Number Value to set the counter to\n ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier\n PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"updateCounter\", { type = type, newValue = newValue, modifier = modifier })\n end\n end\n\n -- triggers the draw function for the specified playmat\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param number Number Amount of cards to draw\n PlaymatApi.drawCardsWithReshuffle = function(matColor, number)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"drawCardsWithReshuffle\", number)\n end\n end\n\n -- returns the resource counter amount\n ---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support \"All\")\n ---@param type String Counter to target\n PlaymatApi.getCounterValue = function(matColor, type)\n for _, mat in pairs(getMatForColor(matColor)) do\n return mat.call(\"getCounterValue\", type)\n end\n end\n\n -- returns a list of mat colors that have an investigator placed\n PlaymatApi.getUsedMatColors = function()\n local localInvestigatorPosition = { x = -1.17, y = 1, z = -0.01 }\n local usedColors = {}\n \n for matColor, mat in pairs(getMatForColor(\"All\")) do\n local searchPos = mat.positionToWorld(localInvestigatorPosition)\n local searchResult = searchLib.atPosition(searchPos, \"isCardOrDeck\")\n\n if #searchResult \u003e 0 then\n table.insert(usedColors, matColor)\n end\n end\n return usedColors\n end\n\n -- resets the specified skill tracker to \"1, 1, 1, 1\"\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.resetSkillTracker = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"resetSkillTracker\")\n end\n end\n\n -- finds all objects on the playmat and associated set aside zone and returns a table\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n ---@param filter String Name of the filte function (see util/SearchLib)\n PlaymatApi.searchAroundPlaymat = function(matColor, filter)\n local objList = {}\n for _, mat in pairs(getMatForColor(matColor)) do\n for _, obj in ipairs(mat.call(\"searchAroundSelf\", filter)) do\n table.insert(objList, obj)\n end\n end\n return objList\n end\n\n -- Discard a non-hidden card from the corresponding player's hand\n ---@param matColor String Color of the playmat - White, Orange, Green, Red or All\n PlaymatApi.doDiscardOne = function(matColor)\n for _, mat in pairs(getMatForColor(matColor)) do\n mat.call(\"doDiscardOne\")\n end\n end\n\n -- Triggers the metadata sync for all playmats\n PlaymatApi.syncAllCustomizableCards = function()\n for _, mat in pairs(getMatForColor(\"All\")) do\n mat.call(\"syncAllCustomizableCards\")\n end\n end\n\n return PlaymatApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/CampaignImporterExporter\")\nend)\n__bundle_register(\"arkhamdb/DeckImporterApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local DeckImporterApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getDeckImporter()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"DeckImporter\")\n end\n\n -- Returns a table with the full state of the UI, including options and deck IDs.\n -- This can be used to persist via onSave(), or provide values for a load operation\n -- Table values:\n -- redDeck: Deck ID to load for the red player\n -- orangeDeck: Deck ID to load for the orange player\n -- whiteDeck: Deck ID to load for the white player\n -- greenDeck: Deck ID to load for the green player\n -- private: True to load a private deck, false to load a public deck\n -- loadNewest: True if the most upgraded version of the deck should be loaded\n -- investigators: True if investigator cards should be spawned\n DeckImporterApi.getUiState = function()\n local passthroughTable = {}\n for k,v in pairs(getDeckImporter().call(\"getUiState\")) do\n passthroughTable[k] = v\n end\n return passthroughTable\n end\n\n -- Updates the state of the UI based on the provided table. Any values not provided will be left the same.\n ---@param uiStateTable Table of values to update on importer\n -- Table values:\n -- redDeck: Deck ID to load for the red player\n -- orangeDeck: Deck ID to load for the orange player\n -- whiteDeck: Deck ID to load for the white player\n -- greenDeck: Deck ID to load for the green player\n -- private: True to load a private deck, false to load a public deck\n -- loadNewest: True if the most upgraded version of the deck should be loaded\n -- investigators: True if investigator cards should be spawned\n DeckImporterApi.setUiState = function(uiStateTable)\n return getDeckImporter().call(\"setUiState\", uiStateTable)\n end\n\n return DeckImporterApi\nend\nend)\n__bundle_register(\"chaosbag/BlessCurseManagerApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local BlessCurseManagerApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getManager()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"BlessCurseManager\")\n end\n\n -- removes all taken tokens and resets the counts\n BlessCurseManagerApi.removeTakenTokensAndReset = function()\n local BlessCurseManager = getManager()\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Bless\") end, 0.05)\n Wait.time(function() BlessCurseManager.call(\"removeTakenTokens\", \"Curse\") end, 0.10)\n Wait.time(function() BlessCurseManager.call(\"doReset\", \"White\") end, 0.15)\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.sealedToken = function(type, guid)\n getManager().call(\"sealedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.releasedToken = function(type, guid)\n getManager().call(\"releasedToken\", { type = type, guid = guid })\n end\n\n -- updates the internal count (called by cards that seal bless/curse tokens)\n BlessCurseManagerApi.returnedToken = function(type, guid)\n getManager().call(\"returnedToken\", { type = type, guid = guid })\n end\n\n -- broadcasts the current status for bless/curse tokens\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.broadcastStatus = function(playerColor)\n getManager().call(\"broadcastStatus\", playerColor)\n end\n\n -- removes all bless / curse tokens from the chaos bag and play\n ---@param playerColor String Color of the player to show the broadcast to\n BlessCurseManagerApi.removeAll = function(playerColor)\n getManager().call(\"doRemove\", playerColor)\n end\n\n -- adds bless / curse sealing to the hovered card\n ---@param playerColor String Color of the player to show the broadcast to\n ---@param hoveredObject TTSObject Hovered object\n BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)\n getManager().call(\"addMenuOptions\", { playerColor = playerColor, hoveredObject = hoveredObject })\n end\n \n return BlessCurseManagerApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", @@ -198842,7 +201154,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card to the requested position/rotation\n MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {\n pos = pos,\n rotY = rotY,\n alwaysFaceUp = alwaysFaceUp\n })\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n return GUIDReferenceApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/TokenArranger\")\nend)\n__bundle_register(\"accessories/TokenArranger\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\n\n-- common parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.label = \"\"\nbuttonParameters.tooltip = \"Increase / Decrease\"\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.width = 325\nbuttonParameters.height = 325\n\nlocal inputParameters = {}\ninputParameters.function_owner = self\ninputParameters.font_size = 100\ninputParameters.width = 250\ninputParameters.height = inputParameters.font_size + 23\ninputParameters.alignment = 3\ninputParameters.validation = 2\ninputParameters.tab = 2\n\nlocal percentageLabel = {}\npercentageLabel.function_owner = self\npercentageLabel.click_function = \"none\"\npercentageLabel.width = 0\npercentageLabel.height = 0\n\n-- variables with save function\nlocal tokenPrecedence = {}\nlocal percentage = false\nlocal includeDrawnTokens = true\n\n-- variables without save function\nlocal updating = false\nlocal TOKEN_NAMES = {\n \"Elder Sign\",\n \"Skull\",\n \"Cultist\",\n \"Tablet\",\n \"Elder Thing\",\n \"Auto-fail\",\n \"Bless\",\n \"Curse\",\n \"Frost\",\n \"\"\n}\n\n-- saving the precedence settings and information on the most recently loaded data\nfunction onSave()\n return JSON.encode({\n tokenPrecedence = tokenPrecedence,\n percentage = percentage,\n includeDrawnTokens = includeDrawnTokens\n })\nend\n\n-- loading data, button creation and initial layouting\nfunction onLoad(saveState)\n if saveState ~= nil and saveState ~= \"\" then\n local loadedData = JSON.decode(saveState)\n tokenPrecedence = loadedData.tokenPrecedence\n percentage = loadedData.percentage\n includeDrawnTokens = loadedData.includeDrawnTokens\n else\n loadDefaultValues()\n\n -- grab token metadata from mythos area\n Wait.time(function() onTokenDataChanged(mythosAreaApi.returnTokenData()) end, 0.2)\n end\n\n createButtonsAndInputs()\n \n -- maybe trigger layout() to draw percentage buttons\n local objList = getObjectsWithTag(\"tempToken\")\n if #objList \u003e 0 then\n Wait.time(layout, 0.5)\n end\n \n -- context menu items\n self.addContextMenuItem(\"Load default values\", function()\n loadDefaultValues()\n updateUI()\n layout()\n end)\n\n self.addContextMenuItem(\"Include drawn tokens\", function()\n includeDrawnTokens = not includeDrawnTokens\n local text = includeDrawnTokens and \" \" or \" not \"\n broadcastToAll(\"Token Arranger will\" .. text .. \"include currently drawn chaos tokens.\", \"Orange\")\n layout()\n end)\n\n self.addContextMenuItem(\"Toggle percentages\", function()\n if percentage then\n percentage = false\n else\n percentage = \"basic\"\n broadcastToAll(\"Percentages are unreliable when using tokens that draw other tokens (bless or curse for example).\", \"Yellow\")\n end\n layout()\n end)\n\n self.addContextMenuItem(\"Toggle cumulative\", function()\n if percentage == \"cumulative\" then\n percentage = \"basic\"\n else\n percentage = \"cumulative\"\n end\n broadcastToAll(\"Percentages are unreliable when using tokens that draw other tokens (bless or curse for example).\", \"Yellow\")\n layout()\n end)\nend\n\n-- delete temporary tokens when destroyed\nfunction onDestroy() deleteCopiedTokens() end\n\n-- layout tokens when dropped (after 1.5 seconds)\nfunction onDrop() Wait.time(layout, 1.5) end\n\n-- delete temporary tokens when picked up\nfunction onPickUp() deleteCopiedTokens() end\n\n-- click_function for buttons on chaos tokens\nfunction tokenClick(isRightClick, index)\n local change = tonumber(isRightClick and \"-1\" or \"1\")\n tokenPrecedence[TOKEN_NAMES[index]][1] = tokenPrecedence[TOKEN_NAMES[index]][1] + change\n self.editInput({\n index = index - 1,\n value = tokenPrecedence[TOKEN_NAMES[index]][1]\n })\n layout()\nend\n\n-- input_function for input_boxes\nfunction tokenInput(input, selected, index)\n if selected == false then\n local num = tonumber(input)\n if num ~= nil then\n tokenPrecedence[TOKEN_NAMES[index]][1] = num\n end\n layout()\n end\nend\n\n-- loads the default precedence table\nfunction loadDefaultValues()\n -- 1st value: token modifiers for sorting\n -- 2nd value: order for equivalent tokens (starts at 2 because of \"+1\" token)\n tokenPrecedence = {\n [\"Elder Sign\"] = { 100, 2},\n [\"Skull\"] = { -1, 3},\n [\"Cultist\"] = { -2, 4},\n [\"Tablet\"] = { -3, 5},\n [\"Elder Thing\"] = { -4, 6},\n [\"Auto-fail\"] = { -100, 7},\n [\"Bless\"] = { 101, 8},\n [\"Curse\"] = { -101, 9},\n [\"Frost\"] = { -99, 10},\n [\"\"] = { 0, 11}\n }\nend\n\n-- creates buttons and inputs\nfunction createButtonsAndInputs()\n local offset = 0.725\n local pos = { x = { -1.067, 0.377 }, z = -2.175 }\n\n -- button and inputs index 0-9\n for i = 1, 10 do\n if i \u003c 6 then\n buttonParameters.position = { pos.x[1], 0, pos.z + i * offset }\n inputParameters.position = { pos.x[1] + offset, 0.1, pos.z + i * offset }\n else\n buttonParameters.position = { pos.x[2], 0, pos.z + (i - 5) * offset }\n inputParameters.position = { pos.x[2] + offset, 0.1, pos.z + (i - 5) * offset }\n end\n\n buttonParameters.click_function = \"tokenClick\" .. i\n inputParameters.input_function = \"tokenInput\" .. i\n inputParameters.value = tokenPrecedence[TOKEN_NAMES[i]][1]\n\n -- setting click-/inputfunction\n self.setVar(buttonParameters.click_function, function(_, _, isRightClick) tokenClick(isRightClick, i) end)\n self.setVar(inputParameters.input_function, function(_, _, input, selected) tokenInput(input, selected, i) end)\n\n -- button/input creation\n self.createButton(buttonParameters)\n self.createInput(inputParameters)\n end\n\n -- index 10: \"Update / Hide\" button\n self.createButton({\n function_owner = self,\n label = \"Update / Hide\",\n click_function = \"layout\",\n tooltip = \"Left-Click: Update!\\nRight-Click: Hide Tokens!\",\n position = { 0.725, 0.1, 2.025 },\n color = { 1, 1, 1 },\n width = 675,\n height = 175\n })\nend\n\n-- update input fields\nfunction updateUI()\n for i = 1, 10 do\n self.editInput({\n index = i - 1,\n value = tokenPrecedence[TOKEN_NAMES[i]][1]\n })\n end\nend\n\n-- order function for data sorting\nfunction tokenValueComparator(left, right)\n if left.value ~= right.value then\n return left.value \u003e right.value\n elseif left.order ~= right.order then\n return left.order \u003c right.order\n else\n return false\n end\nend\n\n-- deletes previously placed tokens\nfunction deleteCopiedTokens()\n for _, token in ipairs(getObjectsWithTag(\"tempToken\")) do\n token.destruct()\n end\n\n -- this removes the percentage buttons (by index 11+)\n local buttonCount = #self.getButtons()\n if buttonCount \u003c 12 then return end\n\n for i = buttonCount, 12, -1 do\n self.removeButton(i - 1)\n end\nend\n\n-- creates buttons as labels as display for percentage values\nfunction createPercentageButton(tokenCount, valueCount, tokenName)\n local startPos = Vector(2.3, -0.04, 0.875 * valueCount)\n\n if percentage == \"cumulative\" then\n percentageLabel.scale = { 1.5, 1.5, 1.5 }\n percentageLabel.position = startPos - Vector(0, 0, 2.85)\n else\n percentageLabel.scale = { 2, 2, 2 }\n percentageLabel.position = startPos - Vector(0, 0, 2.675)\n end\n\n -- determine font_color\n if tokenName == \"Elder Sign\" then\n percentageLabel.font_color = { 0.35, 0.71, 0.85 }\n elseif tokenName == \"Auto-fail\" then\n percentageLabel.font_color = { 0.86, 0.1, 0.1 }\n -- check if the tokenName contains letters (e.g. symbol token)\n elseif string.match(tokenName, \"%a\") ~= nil then\n percentageLabel.font_color = { 0.68, 0.53, 0.86 }\n else\n percentageLabel.font_color = { 0.85, 0.67, 0.33 }\n end\n\n -- create label for base percentage\n local basePercentage = math.floor((tokenCount.row / tokenCount.total) * 10000) / 100\n percentageLabel.label = string.format(\"%s\", string.format(\"%05.2f\", basePercentage) .. \"%\")\n self.createButton(percentageLabel)\n\n -- optionally create label for cumulative percentage\n if percentage == \"cumulative\" then\n percentageLabel.position = startPos - Vector(0, 0, 2.45)\n percentageLabel.font_color = { 1, 1, 1 }\n\n -- only display one digit for 100%\n if tokenCount.sum == tokenCount.total then\n percentageLabel.label = \"100.0%\"\n else\n local cumulativePercentage = math.floor((tokenCount.sum / tokenCount.total) * 10000) / 100\n percentageLabel.label = string.format(\"%s\", string.format(\"%05.2f\", cumulativePercentage) .. \"%\")\n end\n self.createButton(percentageLabel)\n end\nend\n\n-- main function (delete old tokens, clone chaos bag content, sort it and position it)\nfunction layout(_, _, isRightClick)\n if updating then return end\n updating = true\n deleteCopiedTokens()\n\n -- stop here if right-clicked\n if isRightClick then\n updating = false\n return\n end\n\n -- get ChaosBag and stop if not found\n local chaosBag = chaosBagApi.findChaosBag()\n if not chaosBag then\n updating = false\n return\n end\n\n -- clone tokens from chaos bag (default position above trash can)\n local rawData = chaosBag.getData().ContainedObjects\n\n -- optionally get the data for tokens in play\n if includeDrawnTokens then\n for _, token in pairs(chaosBagApi.getTokensInPlay()) do\n if token ~= nil then table.insert(rawData, token.getData()) end\n end\n end\n\n -- generate layout data\n local data = {}\n for i, objData in ipairs(rawData) do\n objData[\"Tags\"] = { \"tempToken\" }\n local value = tonumber(objData.Nickname)\n local precedence = tokenPrecedence[objData.Nickname]\n\n -- remove GUID to avoid issues for high latency clients\n objData[\"GUID\"] = nil\n\n -- store data with value / precendence\n data[i] = {\n token = objData,\n value = value or precedence[1]\n }\n\n -- order for comparator function\n if precedence ~= nil then\n data[i].order = precedence[2]\n else\n data[i].order = value\n end\n end\n\n -- sort table by value (symbols last if same value)\n table.sort(data, tokenValueComparator)\n\n -- laying out the tokens\n local pos = self.getPosition() + Vector(3.55, -0.05, -3.95)\n if percentage then pos.z = pos.z - 3.05 end\n\n local location = { x = pos.x, y = pos.y, z = pos.z }\n local rotation = self.getRotation()\n local currentValue = data[1].value\n local tokenCount = { row = 0, sum = 0, total = #data }\n local valueCount = 1\n local tokenName = false\n\n for i, item in ipairs(data) do\n -- this is true for the first token in a new row\n if item.value ~= currentValue then\n if percentage then\n tokenCount.sum = tokenCount.sum + tokenCount.row\n createPercentageButton(tokenCount, valueCount, tokenName)\n end\n\n location.x = location.x - 1.75\n location.z = pos.z\n currentValue = item.value\n valueCount = valueCount + 1\n tokenCount.row = 0\n end\n\n spawnObjectData({\n data = item.token,\n position = location,\n rotation = rotation\n })\n tokenName = item.token.Nickname\n location.z = location.z - 1.75\n tokenCount.row = tokenCount.row + 1\n end\n\n -- this is repeated to create the button for the last token\n if percentage then\n tokenCount.sum = tokenCount.sum + tokenCount.row\n createPercentageButton(tokenCount, valueCount, tokenName)\n end\n\n -- introducing a small delay to limit update calls\n Wait.time(function() updating = false end, 0.1)\nend\n\n-- called from outside to set default values for tokens\nfunction onTokenDataChanged(parameters)\n local tokenData = parameters.tokenData or {}\n local currentScenario = parameters.currentScenario or \"\"\n local useFrontData = parameters.useFrontData\n\n -- update token precedence\n for key, table in pairs(tokenData) do\n local modifier = table.modifier\n if modifier == -999 then modifier = 0 end\n tokenPrecedence[key][1] = modifier\n end\n\n updateUI()\n layout()\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/TokenArranger\")\nend)\n__bundle_register(\"accessories/TokenArranger\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\nlocal mythosAreaApi = require(\"core/MythosAreaApi\")\n\n-- common parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.label = \"\"\nbuttonParameters.tooltip = \"Increase / Decrease\"\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.width = 325\nbuttonParameters.height = 325\n\nlocal inputParameters = {}\ninputParameters.function_owner = self\ninputParameters.font_size = 100\ninputParameters.width = 250\ninputParameters.height = inputParameters.font_size + 23\ninputParameters.alignment = 3\ninputParameters.validation = 2\ninputParameters.tab = 2\n\nlocal percentageLabel = {}\npercentageLabel.function_owner = self\npercentageLabel.click_function = \"none\"\npercentageLabel.width = 0\npercentageLabel.height = 0\n\n-- variables with save function\nlocal tokenPrecedence = {}\nlocal percentage = false\nlocal includeDrawnTokens = true\n\n-- variables without save function\nlocal updating = false\nlocal TOKEN_NAMES = {\n \"Elder Sign\",\n \"Skull\",\n \"Cultist\",\n \"Tablet\",\n \"Elder Thing\",\n \"Auto-fail\",\n \"Bless\",\n \"Curse\",\n \"Frost\",\n \"\"\n}\n\n-- saving the precedence settings and information on the most recently loaded data\nfunction onSave()\n return JSON.encode({\n tokenPrecedence = tokenPrecedence,\n percentage = percentage,\n includeDrawnTokens = includeDrawnTokens\n })\nend\n\n-- loading data, button creation and initial layouting\nfunction onLoad(saveState)\n if saveState ~= nil and saveState ~= \"\" then\n local loadedData = JSON.decode(saveState)\n tokenPrecedence = loadedData.tokenPrecedence\n percentage = loadedData.percentage\n includeDrawnTokens = loadedData.includeDrawnTokens\n else\n loadDefaultValues()\n\n -- grab token metadata from mythos area\n Wait.time(function() onTokenDataChanged(mythosAreaApi.returnTokenData()) end, 0.2)\n end\n\n createButtonsAndInputs()\n \n -- maybe trigger layout() to draw percentage buttons\n local objList = getObjectsWithTag(\"tempToken\")\n if #objList \u003e 0 then\n Wait.time(layout, 0.5)\n end\n \n -- context menu items\n self.addContextMenuItem(\"Load default values\", function()\n loadDefaultValues()\n updateUI()\n layout()\n end)\n\n self.addContextMenuItem(\"Include drawn tokens\", function()\n includeDrawnTokens = not includeDrawnTokens\n local text = includeDrawnTokens and \" \" or \" not \"\n broadcastToAll(\"Token Arranger will\" .. text .. \"include currently drawn chaos tokens.\", \"Orange\")\n layout()\n end)\n\n self.addContextMenuItem(\"Toggle percentages\", function()\n if percentage then\n percentage = false\n else\n percentage = \"basic\"\n broadcastToAll(\"Percentages are unreliable when using tokens that draw other tokens (bless or curse for example).\", \"Yellow\")\n end\n layout()\n end)\n\n self.addContextMenuItem(\"Toggle cumulative\", function()\n if percentage == \"cumulative\" then\n percentage = \"basic\"\n else\n percentage = \"cumulative\"\n end\n broadcastToAll(\"Percentages are unreliable when using tokens that draw other tokens (bless or curse for example).\", \"Yellow\")\n layout()\n end)\nend\n\n-- delete temporary tokens when destroyed\nfunction onDestroy() deleteCopiedTokens() end\n\n-- layout tokens when dropped (after 1.5 seconds)\nfunction onDrop() Wait.time(layout, 1.5) end\n\n-- delete temporary tokens when picked up\nfunction onPickUp() deleteCopiedTokens() end\n\n-- click_function for buttons on chaos tokens\nfunction tokenClick(isRightClick, index)\n local change = tonumber(isRightClick and \"-1\" or \"1\")\n tokenPrecedence[TOKEN_NAMES[index]][1] = tokenPrecedence[TOKEN_NAMES[index]][1] + change\n self.editInput({\n index = index - 1,\n value = tokenPrecedence[TOKEN_NAMES[index]][1]\n })\n layout()\nend\n\n-- input_function for input_boxes\nfunction tokenInput(input, selected, index)\n if selected == false then\n local num = tonumber(input)\n if num ~= nil then\n tokenPrecedence[TOKEN_NAMES[index]][1] = num\n end\n layout()\n end\nend\n\n-- loads the default precedence table\nfunction loadDefaultValues()\n -- 1st value: token modifiers for sorting\n -- 2nd value: order for equivalent tokens (starts at 2 because of \"+1\" token)\n tokenPrecedence = {\n [\"Elder Sign\"] = { 100, 2},\n [\"Skull\"] = { -1, 3},\n [\"Cultist\"] = { -2, 4},\n [\"Tablet\"] = { -3, 5},\n [\"Elder Thing\"] = { -4, 6},\n [\"Auto-fail\"] = { -100, 7},\n [\"Bless\"] = { 101, 8},\n [\"Curse\"] = { -101, 9},\n [\"Frost\"] = { -99, 10},\n [\"\"] = { 0, 11}\n }\nend\n\n-- creates buttons and inputs\nfunction createButtonsAndInputs()\n local offset = 0.725\n local pos = { x = { -1.067, 0.377 }, z = -2.175 }\n\n -- button and inputs index 0-9\n for i = 1, 10 do\n if i \u003c 6 then\n buttonParameters.position = { pos.x[1], 0, pos.z + i * offset }\n inputParameters.position = { pos.x[1] + offset, 0.1, pos.z + i * offset }\n else\n buttonParameters.position = { pos.x[2], 0, pos.z + (i - 5) * offset }\n inputParameters.position = { pos.x[2] + offset, 0.1, pos.z + (i - 5) * offset }\n end\n\n buttonParameters.click_function = \"tokenClick\" .. i\n inputParameters.input_function = \"tokenInput\" .. i\n inputParameters.value = tokenPrecedence[TOKEN_NAMES[i]][1]\n\n -- setting click-/inputfunction\n self.setVar(buttonParameters.click_function, function(_, _, isRightClick) tokenClick(isRightClick, i) end)\n self.setVar(inputParameters.input_function, function(_, _, input, selected) tokenInput(input, selected, i) end)\n\n -- button/input creation\n self.createButton(buttonParameters)\n self.createInput(inputParameters)\n end\n\n -- index 10: \"Update / Hide\" button\n self.createButton({\n function_owner = self,\n label = \"Update / Hide\",\n click_function = \"layout\",\n tooltip = \"Left-Click: Update!\\nRight-Click: Hide Tokens!\",\n position = { 0.725, 0.1, 2.025 },\n color = { 1, 1, 1 },\n width = 675,\n height = 175\n })\nend\n\n-- update input fields\nfunction updateUI()\n for i = 1, 10 do\n self.editInput({\n index = i - 1,\n value = tokenPrecedence[TOKEN_NAMES[i]][1]\n })\n end\nend\n\n-- order function for data sorting\nfunction tokenValueComparator(left, right)\n if left.value ~= right.value then\n return left.value \u003e right.value\n elseif left.order ~= right.order then\n return left.order \u003c right.order\n else\n return false\n end\nend\n\n-- deletes previously placed tokens\nfunction deleteCopiedTokens()\n for _, token in ipairs(getObjectsWithTag(\"tempToken\")) do\n token.destruct()\n end\n\n -- this removes the percentage buttons (by index 11+)\n local buttonCount = #self.getButtons()\n if buttonCount \u003c 12 then return end\n\n for i = buttonCount, 12, -1 do\n self.removeButton(i - 1)\n end\nend\n\n-- creates buttons as labels as display for percentage values\nfunction createPercentageButton(tokenCount, valueCount, tokenName)\n local startPos = Vector(2.3, -0.04, 0.875 * valueCount)\n\n if percentage == \"cumulative\" then\n percentageLabel.scale = { 1.5, 1.5, 1.5 }\n percentageLabel.position = startPos - Vector(0, 0, 2.85)\n else\n percentageLabel.scale = { 2, 2, 2 }\n percentageLabel.position = startPos - Vector(0, 0, 2.675)\n end\n\n -- determine font_color\n if tokenName == \"Elder Sign\" then\n percentageLabel.font_color = { 0.35, 0.71, 0.85 }\n elseif tokenName == \"Auto-fail\" then\n percentageLabel.font_color = { 0.86, 0.1, 0.1 }\n -- check if the tokenName contains letters (e.g. symbol token)\n elseif string.match(tokenName, \"%a\") ~= nil then\n percentageLabel.font_color = { 0.68, 0.53, 0.86 }\n else\n percentageLabel.font_color = { 0.85, 0.67, 0.33 }\n end\n\n -- create label for base percentage\n local basePercentage = math.floor((tokenCount.row / tokenCount.total) * 10000) / 100\n percentageLabel.label = string.format(\"%s\", string.format(\"%05.2f\", basePercentage) .. \"%\")\n self.createButton(percentageLabel)\n\n -- optionally create label for cumulative percentage\n if percentage == \"cumulative\" then\n percentageLabel.position = startPos - Vector(0, 0, 2.45)\n percentageLabel.font_color = { 1, 1, 1 }\n\n -- only display one digit for 100%\n if tokenCount.sum == tokenCount.total then\n percentageLabel.label = \"100.0%\"\n else\n local cumulativePercentage = math.floor((tokenCount.sum / tokenCount.total) * 10000) / 100\n percentageLabel.label = string.format(\"%s\", string.format(\"%05.2f\", cumulativePercentage) .. \"%\")\n end\n self.createButton(percentageLabel)\n end\nend\n\n-- main function (delete old tokens, clone chaos bag content, sort it and position it)\nfunction layout(_, _, isRightClick)\n if updating then return end\n updating = true\n deleteCopiedTokens()\n\n -- stop here if right-clicked\n if isRightClick then\n updating = false\n return\n end\n\n -- get ChaosBag and stop if not found\n local chaosBag = chaosBagApi.findChaosBag()\n if not chaosBag then\n updating = false\n return\n end\n\n -- clone tokens from chaos bag (default position above trash can)\n local rawData = chaosBag.getData().ContainedObjects\n\n -- optionally get the data for tokens in play\n if includeDrawnTokens then\n for _, token in pairs(chaosBagApi.getTokensInPlay()) do\n if token ~= nil then table.insert(rawData, token.getData()) end\n end\n end\n\n -- generate layout data\n local data = {}\n for i, objData in ipairs(rawData) do\n objData[\"Tags\"] = { \"tempToken\" }\n local value = tonumber(objData.Nickname)\n local precedence = tokenPrecedence[objData.Nickname]\n\n -- remove GUID to avoid issues for high latency clients\n objData[\"GUID\"] = nil\n\n -- store data with value / precendence\n data[i] = {\n token = objData,\n value = value or precedence[1]\n }\n\n -- order for comparator function\n if precedence ~= nil then\n data[i].order = precedence[2]\n else\n data[i].order = value\n end\n end\n\n -- sort table by value (symbols last if same value)\n table.sort(data, tokenValueComparator)\n\n -- laying out the tokens\n local pos = self.getPosition() + Vector(3.55, -0.05, -3.95)\n if percentage then pos.z = pos.z - 3.05 end\n\n local location = { x = pos.x, y = pos.y, z = pos.z }\n local rotation = self.getRotation()\n local currentValue = data[1].value\n local tokenCount = { row = 0, sum = 0, total = #data }\n local valueCount = 1\n local tokenName = false\n\n for i, item in ipairs(data) do\n -- this is true for the first token in a new row\n if item.value ~= currentValue then\n if percentage then\n tokenCount.sum = tokenCount.sum + tokenCount.row\n createPercentageButton(tokenCount, valueCount, tokenName)\n end\n\n location.x = location.x - 1.75\n location.z = pos.z\n currentValue = item.value\n valueCount = valueCount + 1\n tokenCount.row = 0\n end\n\n spawnObjectData({\n data = item.token,\n position = location,\n rotation = rotation\n })\n tokenName = item.token.Nickname\n location.z = location.z - 1.75\n tokenCount.row = tokenCount.row + 1\n end\n\n -- this is repeated to create the button for the last token\n if percentage then\n tokenCount.sum = tokenCount.sum + tokenCount.row\n createPercentageButton(tokenCount, valueCount, tokenName)\n end\n\n -- introducing a small delay to limit update calls\n Wait.time(function() updating = false end, 0.1)\nend\n\n-- called from outside to set default values for tokens\nfunction onTokenDataChanged(parameters)\n local tokenData = parameters.tokenData or {}\n local currentScenario = parameters.currentScenario or \"\"\n local useFrontData = parameters.useFrontData\n\n -- update token precedence\n for key, table in pairs(tokenData) do\n local modifier = table.modifier\n if modifier == -999 then modifier = 0 end\n tokenPrecedence[key][1] = modifier\n end\n\n updateUI()\n layout()\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"core/MythosAreaApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local MythosAreaApi = {}\n local guidReferenceApi = require(\"core/GUIDReferenceApi\")\n\n local function getMythosArea()\n return guidReferenceApi.getObjectByOwnerAndType(\"Mythos\", \"MythosArea\")\n end\n\n -- returns the chaos token metadata (if provided through scenario reference card)\n MythosAreaApi.returnTokenData = function()\n return getMythosArea().call(\"returnTokenData\")\n end\n \n -- returns an object reference to the encounter deck\n MythosAreaApi.getEncounterDeck = function()\n return getMythosArea().call(\"getEncounterDeck\")\n end\n\n -- draw an encounter card for the requesting mat\n MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)\n getMythosArea().call(\"drawEncounterCard\", {mat = mat, alwaysFaceUp = alwaysFaceUp})\n end\n\n return MythosAreaApi\nend\nend)\n__bundle_register(\"core/GUIDReferenceApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local GUIDReferenceApi = {}\n\n local function getGuidHandler()\n return getObjectFromGUID(\"123456\")\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)\n return getGuidHandler().call(\"getObjectByOwnerAndType\", { owner = owner, type = type })\n end\n\n -- returns all matching objects as a table with references\n ---@param type String Type of object to search for\n GUIDReferenceApi.getObjectsByType = function(type)\n return getGuidHandler().call(\"getObjectsByType\", type)\n end\n\n -- returns all matching objects as a table with references\n ---@param owner String Parent object for this search\n GUIDReferenceApi.getObjectsByOwner = function(owner)\n return getGuidHandler().call(\"getObjectsByOwner\", owner)\n end\n\n -- sends new information to the reference handler to edit the main index\n ---@param owner String Parent of the object\n ---@param type String Type of the object\n ---@param guid String GUID of the object\n GUIDReferenceApi.editIndex = function(owner, type, guid)\n return getGuidHandler().call(\"editIndex\", {\n owner = owner,\n type = type,\n guid = guid\n })\n end\n\n return GUIDReferenceApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "{\"includeDrawnTokens\":true,\"percentage\":false,\"tokenPrecedence\":{\"\":[0,11],\"Auto-fail\":[-100,7],\"Bless\":[101,8],\"Cultist\":[-2,4],\"Curse\":[-101,9],\"Elder Sign\":[100,2],\"Elder Thing\":[-4,6],\"Frost\":[-99,10],\"Skull\":[-1,3],\"Tablet\":[-3,5]}}", "MeasureMovement": false, "Name": "Custom_Token", @@ -198899,7 +201211,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.getTable(\"chaosTokens\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)\n return Global.call(\"drawChaosToken\", {mat, tokenOffset, isRightClick})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/ChaosBagManager\")\nend)\n__bundle_register(\"accessories/ChaosBagManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\n\nlocal TOKEN_IDS = {\n -- first row\n \"p1\", \"0\", \"m1\", \"m2\", \"m3\", \"m4\",\n -- second row\n \"m5\", \"m6\", \"m7\", \"m8\", \"frost\",\n -- third row\n \"blue\", \"skull\", \"cultist\", \"tablet\", \"elder\", \"red\"\n}\n\nlocal BUTTON_TOOLTIP = {\n -- first row\n \"+1\", \"0\", \"-1\", \"-2\", \"-3\", \"-4\",\n -- second row\n \"-5\", \"-6\", \"-7\", \"-8\", \"Frost\",\n -- third row\n \"Elder Sign\", \"Skull\", \"Cultist\", \"Tablet\", \"Elder Thing\", \"Auto-fail\"\n}\n\nlocal BUTTON_POSITION = {\n -- first row\n -1.90, -1.14, -0.38, 0.38, 1.14, 1.90,\n -- second row\n -1.90, -1.14, -0.38, 0.38, 1.90,\n -- third row\n -1.90, -1.14, -0.38, 0.38, 1.14, 1.90\n}\n\n-- common button parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.width = 300\nbuttonParameters.height = 300\n\nlocal name\nlocal tokens = {}\n\nfunction onLoad()\n -- create buttons for tokens\n for i = 1, #BUTTON_POSITION do\n local funcName = \"buttonClick\" .. i\n self.setVar(funcName, function(_, _, isRightClick) buttonClick(i, isRightClick) end)\n\n buttonParameters.click_function = funcName\n buttonParameters.tooltip = BUTTON_TOOLTIP[i]\n buttonParameters.position = { x = BUTTON_POSITION[i], y = 0, z = 0 }\n\n if i \u003c 7 then\n buttonParameters.position.z = -0.778\n elseif i \u003e 11 then\n buttonParameters.position.z = 0.755\n end\n\n self.createButton(buttonParameters)\n end\nend\n\n-- click function for buttons\nfunction buttonClick(index, isRightClick)\n local tokenId = TOKEN_IDS[index]\n\n if isRightClick then\n chaosBagApi.removeChaosToken(tokenId)\n else\n local tokens = {}\n local name = BUTTON_TOOLTIP[index]\n local chaosbag = chaosBagApi.findChaosBag()\n\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == name then table.insert(tokens, v.guid) end\n end\n\n -- spawn token (only 8 frost tokens allowed)\n if tokenId == \"frost\" and #tokens == 8 then\n printToAll(\"The maximum of 8 Frost tokens is already in the bag.\", \"Yellow\")\n return\n end\n\n chaosBagApi.spawnChaosToken(tokenId)\n printToAll(\"Adding \" .. name .. \" token (in bag: \" .. #tokens + 1 .. \")\", \"White\")\n end\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"accessories/ChaosBagManager\")\nend)\n__bundle_register(\"accessories/ChaosBagManager\", function(require, _LOADED, __bundle_register, __bundle_modules)\nlocal chaosBagApi = require(\"chaosbag/ChaosBagApi\")\n\nlocal TOKEN_IDS = {\n -- first row\n \"p1\", \"0\", \"m1\", \"m2\", \"m3\", \"m4\",\n -- second row\n \"m5\", \"m6\", \"m7\", \"m8\", \"frost\",\n -- third row\n \"blue\", \"skull\", \"cultist\", \"tablet\", \"elder\", \"red\"\n}\n\nlocal BUTTON_TOOLTIP = {\n -- first row\n \"+1\", \"0\", \"-1\", \"-2\", \"-3\", \"-4\",\n -- second row\n \"-5\", \"-6\", \"-7\", \"-8\", \"Frost\",\n -- third row\n \"Elder Sign\", \"Skull\", \"Cultist\", \"Tablet\", \"Elder Thing\", \"Auto-fail\"\n}\n\nlocal BUTTON_POSITION = {\n -- first row\n -1.90, -1.14, -0.38, 0.38, 1.14, 1.90,\n -- second row\n -1.90, -1.14, -0.38, 0.38, 1.90,\n -- third row\n -1.90, -1.14, -0.38, 0.38, 1.14, 1.90\n}\n\n-- common button parameters\nlocal buttonParameters = {}\nbuttonParameters.function_owner = self\nbuttonParameters.color = { 0, 0, 0, 0 }\nbuttonParameters.width = 300\nbuttonParameters.height = 300\n\nlocal name\nlocal tokens = {}\n\nfunction onLoad()\n -- create buttons for tokens\n for i = 1, #BUTTON_POSITION do\n local funcName = \"buttonClick\" .. i\n self.setVar(funcName, function(_, _, isRightClick) buttonClick(i, isRightClick) end)\n\n buttonParameters.click_function = funcName\n buttonParameters.tooltip = BUTTON_TOOLTIP[i]\n buttonParameters.position = { x = BUTTON_POSITION[i], y = 0, z = 0 }\n\n if i \u003c 7 then\n buttonParameters.position.z = -0.778\n elseif i \u003e 11 then\n buttonParameters.position.z = 0.755\n end\n\n self.createButton(buttonParameters)\n end\nend\n\n-- click function for buttons\nfunction buttonClick(index, isRightClick)\n local tokenId = TOKEN_IDS[index]\n\n if isRightClick then\n chaosBagApi.removeChaosToken(tokenId)\n else\n local tokens = {}\n local name = BUTTON_TOOLTIP[index]\n local chaosbag = chaosBagApi.findChaosBag()\n\n for _, v in ipairs(chaosbag.getObjects()) do\n if v.name == name then table.insert(tokens, v.guid) end\n end\n\n -- spawn token (only 8 frost tokens allowed)\n if tokenId == \"frost\" and #tokens == 8 then\n printToAll(\"The maximum of 8 Frost tokens is already in the bag.\", \"Yellow\")\n return\n end\n\n chaosBagApi.spawnChaosToken(tokenId)\n printToAll(\"Adding \" .. name .. \" token (in bag: \" .. #tokens + 1 .. \")\", \"White\")\n end\nend\nend)\n__bundle_register(\"chaosbag/ChaosBagApi\", function(require, _LOADED, __bundle_register, __bundle_modules)\ndo\n local ChaosBagApi = {}\n\n -- respawns the chaos bag with a new state of tokens\n ---@param tokenList Table List of chaos token ids\n ChaosBagApi.setChaosBagState = function(tokenList)\n return Global.call(\"setChaosBagState\", tokenList)\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getChaosBagState = function()\n local chaosBagContentsCatcher = Global.call(\"getChaosBagState\")\n local chaosBagContents = {}\n for _, v in ipairs(chaosBagContentsCatcher) do\n table.insert(chaosBagContents, v)\n end\n return chaosBagContents\n end\n\n -- checks scripting zone for chaos bag (also called by a lot of objects!)\n ChaosBagApi.findChaosBag = function()\n return Global.call(\"findChaosBag\")\n end\n\n -- returns a table of object references to the tokens in play (does not include sealed tokens!)\n ChaosBagApi.getTokensInPlay = function()\n return Global.call(\"getChaosTokensinPlay\")\n end\n\n -- returns all sealed tokens on cards to the chaos bag\n ChaosBagApi.releaseAllSealedTokens = function(playerColor)\n return Global.call(\"releaseAllSealedTokens\", playerColor)\n end\n\n -- returns all drawn tokens to the chaos bag\n ChaosBagApi.returnChaosTokens = function(playerColor)\n return Global.call(\"returnChaosTokens\", playerColor)\n end\n\n -- removes the specified chaos token from the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.removeChaosToken = function(id)\n return Global.call(\"removeChaosToken\", id)\n end\n\n -- returns a chaos token to the bag and calls all relevant functions\n ---@param token TTSObject Chaos Token to return\n ChaosBagApi.returnChaosTokenToBag = function(token)\n return Global.call(\"returnChaosTokenToBag\", token)\n end\n\n -- spawns the specified chaos token and puts it into the chaos bag\n ---@param id String ID of the chaos token\n ChaosBagApi.spawnChaosToken = function(id)\n return Global.call(\"spawnChaosToken\", id)\n end\n\n -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens\n -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the\n -- contents of the bag should check this method before doing so.\n -- This method will broadcast a message to all players if the bag is being searched.\n ---@return Boolean. True if the bag is manipulated, false if it should be blocked.\n ChaosBagApi.canTouchChaosTokens = function()\n return Global.call(\"canTouchChaosTokens\")\n end\n\n -- called by playermats (by the \"Draw chaos token\" button)\n ChaosBagApi.drawChaosToken = function(mat, drawAdditional)\n return Global.call(\"drawChaosToken\", {mat = mat, drawAdditional = drawAdditional})\n end\n\n -- returns a Table List of chaos token ids in the current chaos bag\n -- requires copying the data into a new table because TTS is weird about handling table return values in Global\n ChaosBagApi.getIdUrlMap = function()\n return Global.getTable(\"ID_URL_MAP\")\n end\n\n return ChaosBagApi\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", @@ -199003,7 +201315,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\nreturn __bundle_require(\"__root\")", + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/DownloadBox\")\nend)\n__bundle_register(\"core/DownloadBox\", function(require, _LOADED, __bundle_register, __bundle_modules)\nfunction onLoad()\n local notes = self.getGMNotes()\n\n -- default parameters (e.g. scenarios)\n local buttonParameters = {\n label = \"Download\",\n click_function = \"buttonClick_download\",\n function_owner = self,\n position = { x = 0, y = 0.1, z = 2.1 },\n height = 250,\n width = 800,\n font_size = 150,\n color = { 0, 0, 0 },\n font_color = { 1, 1, 1 }\n }\n\n -- return to boxes\n if string.match(notes, \"................\") == \"campaigns/return\" then\n buttonParameters.position.z = 2\n\n -- official campaign boxes\n elseif string.match(notes, \".........\") == \"campaigns\" or self.hasTag(\"LargeBox\") then\n buttonParameters.position.z = 6\n buttonParameters.height = 500\n buttonParameters.width = 1700\n buttonParameters.font_size = 350\n\n -- investigator boxes\n elseif string.match(notes, \".............\") == \"investigators\" then\n buttonParameters.position.z = 7\n buttonParameters.height = 850\n buttonParameters.width = 3400\n buttonParameters.font_size = 700\n end\n\n self.createButton(buttonParameters)\nend\n\nfunction buttonClick_download()\n Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })\nend\nend)\nreturn __bundle_require(\"__root\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Model", @@ -199037,10 +201349,1138 @@ "g": 1, "r": 1 }, - "Description": "Thanks for downloading Arkham SCE 3.4.0!\n\r\n- Revamped the download menu! This is now the primary way to access custom content instead of the container with placeholder boxes.\n- Added Parallel Jim and Parallel Zoey!\n- Added new community content!\n- Added a helper for Subject 5U-21.\r\n- Added a tool to hide unused playermats.\n", + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/uIx8jbY.png", + "WidthScale": 0 + }, + "Description": "", "DragSelectable": true, "GMNotes": "", - "GUID": "964222", + "GUID": "a15273", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_+1", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.545, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/btEtVfd.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "0a8592", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_0", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.845, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/w3XbrCC.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "b644d2", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-1", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.545, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/bfTg2hb.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "8af600", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-2", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.745, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/yfs8gHq.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "a7a9cb", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-3", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 77.999, + "posY": 2.245, + "posZ": -36.001, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/qrgGQRD.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "984eec", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-4", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.845, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/3Ym1IeG.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "1df0a5", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-5", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 77.999, + "posY": 2.145, + "posZ": -36.001, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/c9qdSzS.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "2460df", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-6", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 77.998, + "posY": 1.345, + "posZ": -36.004, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/4WRD42n.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "81a1d7", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-7", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.045, + "posZ": -36.001, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/9t3rPTQ.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "298b5f", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_-8", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.945, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/stbBxtx.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "cc8bbb", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Skull", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.645, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/VzhJJaH.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "7d6103", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Cultist", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.945, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/1plY463.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "1a1506", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Tablet", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.445, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/ttnspKt.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "38609c", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Elder Thing", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.445, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/lns4fhz.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "e31821", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Auto-fail", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.745, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/nEmqjmj.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "0b1aca", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Elder Sign", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.645, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0.04894, + "g": 0.32859, + "r": 0.37456 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778627699/339FB716CB25CA6025C338F13AFDFD9AC6FA8356/", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "8e3aab", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Bless", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 77.999, + "posY": 1.245, + "posZ": -36.002, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0.44425, + "g": 0.00387, + "r": 0.27072 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1655601092778636039/2A25BD38E8C44701D80DD96BF0121DA21843672E/", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "16a9a7", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Curse", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.145, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0.04894, + "g": 0.32859, + "r": 0.37456 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 2 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1858293462583104677/195F93C063A8881B805CE2FD4767A9718B27B6AE/", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "b2b7be", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Tokencache_Frost", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 2.445, + "posZ": -36, + "rotX": 0, + "rotY": 270, + "rotZ": 180, + "scaleX": 0.81, + "scaleY": 1, + "scaleZ": 0.81 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0, + "g": 0, + "r": 0.92647 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "b300d8", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "-- Bundled by luabundle {\"version\":\"1.6.0\"}\nlocal __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)\n\tlocal loadingPlaceholder = {[{}] = true}\n\n\tlocal register\n\tlocal modules = {}\n\n\tlocal require\n\tlocal loaded = {}\n\n\tregister = function(name, body)\n\t\tif not modules[name] then\n\t\t\tmodules[name] = body\n\t\tend\n\tend\n\n\trequire = function(name)\n\t\tlocal loadedModule = loaded[name]\n\n\t\tif loadedModule then\n\t\t\tif loadedModule == loadingPlaceholder then\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\tif not modules[name] then\n\t\t\t\tif not superRequire then\n\t\t\t\t\tlocal identifier = type(name) == 'string' and '\\\"' .. name .. '\\\"' or tostring(name)\n\t\t\t\t\terror('Tried to require ' .. identifier .. ', but no such module has been registered')\n\t\t\t\telse\n\t\t\t\t\treturn superRequire(name)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tloaded[name] = loadingPlaceholder\n\t\t\tloadedModule = modules[name](require, loaded, register, modules)\n\t\t\tloaded[name] = loadedModule\n\t\tend\n\n\t\treturn loadedModule\n\tend\n\n\treturn require, loaded, register, modules\nend)(nil)\n__bundle_register(\"__root\", function(require, _LOADED, __bundle_register, __bundle_modules)\nrequire(\"core/PhysicsDetector\")\nend)\n__bundle_register(\"core/PhysicsDetector\", function(require, _LOADED, __bundle_register, __bundle_modules)\n-- will notify the user to enable physics if it appears to not be fully enabled\n\n-- this event should only fire if physics aren't fully enabled\nfunction onCollisionExit()\n broadcastToAll(\"Physics disabled? Check chat log\", \"Orange\")\n printToAll(\"It seems like you don't have 'Physics' fully enabled. From the top menu bar, open Options \u003e Physics and select 'Full' to experience this mod with all features.\")\nend\nend)\nreturn __bundle_require(\"__root\")", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "BlockSquare", + "Nickname": "Physics Detector", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.645, + "posZ": 16, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" + }, + { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "Description": "Thanks for downloading Arkham SCE 3.5.0!\n\n- Added all officially-previewed Feast of Hemlock Vale player cards!\n- Added Parallel Monterey Jack!\n- The options panel has many new settings available.\n- Added new scripting to Empirical Hypothesis, accessible via right-clicking the card.\n", + "DragSelectable": true, + "GMNotes": "", + "GUID": "2d0dbb", "Grid": true, "GridProjection": false, "Hands": false, @@ -199052,7 +202492,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Notecard", - "Nickname": "Arkham SCE 3.4.0 - 11/18/2023 - Page 1", + "Nickname": "Arkham SCE 3.5.0 - 1/25/2024 - Page 1", "Snap": true, "States": { "2": { @@ -199067,10 +202507,10 @@ "g": 1, "r": 1 }, - "Description": "- Added an image gallery for play area images.\n- Added QoL features for Norman Withers\r.\n\r- Added a discard gamekey.\r\n- Increased readability of master clue counter.\r\n- Cleaned up the option panel.\n- Added default camera states (Shift + 1/2).\n- Fixed bugs with discarding cards from hand, the token arranger, and taboo card widths.\r\n- Misc. metadata fixes.", + "Description": "- The Deck Importer now supports custom cards! Requires using the Additional Player Cards bag and the nearby ArkhamDB instruction generator. Only works with cards with Zoop metadata or an 'id' field in metadata.\n- Added a reshuffle button under the encounter card discard.\n- The Doom Counter now also prints the doom threshold when updated.", "DragSelectable": true, "GMNotes": "", - "GUID": "d7faf7", + "GUID": "313b1d", "Grid": true, "GridProjection": false, "Hands": false, @@ -199082,17 +202522,107 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Notecard", - "Nickname": "Arkham SCE 3.4.0 - 11/18/2023 - Page 2", + "Nickname": "Arkham SCE 3.5.0 - 1/25/2024 - Page 2", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": -23.74739, - "posY": 1.55149889, - "posZ": -57.1334763, - "rotX": 2.26350938e-8, - "rotY": 90.00001, - "rotZ": 2.55191921e-8, + "posX": -6.36890459, + "posY": 1.55641556, + "posZ": -34.33106, + "rotX": 0.0000395979223, + "rotY": 90.00111, + "rotZ": 0.027191259, + "scaleX": 3, + "scaleY": 1, + "scaleZ": 3 + }, + "Value": 0, + "XmlUI": "" + }, + "3": { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "Description": "- Bless/Curse manager has been slimmed down. All cards that would have needed \"take/remove\" have proper right-click menus.\n- Drawing another color's player cards using hotkeys draws them to the corresponding hand.\n- Added hotkeys for changing seats. Only seats with an investigator card present are included.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "3c1fdd", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Notecard", + "Nickname": "Arkham SCE 3.5.0 - 1/25/2024 - Page 3", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": -6.36890554, + "posY": 1.55641556, + "posZ": -34.33106, + "rotX": 0.00003961793, + "rotY": 90.00111, + "rotZ": 0.02719125, + "scaleX": 3, + "scaleY": 1, + "scaleZ": 3 + }, + "Value": 0, + "XmlUI": "" + }, + "4": { + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "Description": "- Campaign Exporter updated with bugfixes and additional features such as support for the new Additional Player Cards bag.\n- Many more miscellaneous bugfixes. Thanks for reporting them!\n\n- Special thanks to everyone helping out others with any questions they have with the mod. We see and appreciate you!", + "DragSelectable": true, + "GMNotes": "", + "GUID": "c677b8", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Notecard", + "Nickname": "Arkham SCE 3.5.0 - 1/25/2024 - Page 4", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": -6.3689065, + "posY": 1.55641556, + "posZ": -34.33106, + "rotX": 0.0000395979223, + "rotY": 90.00111, + "rotZ": 0.0271912515, "scaleX": 3, "scaleY": 1, "scaleZ": 3 @@ -199127,7 +202657,7 @@ 0, 0 ], - "SaveName": "Arkham SCE - 3.4.0", + "SaveName": "Arkham SCE - 3.5.0", "Sky": "Sky_Museum", "SkyURL": "https://i.imgur.com/GkQqaOF.jpg", "SnapPoints": [ @@ -199453,9 +202983,9 @@ }, { "Position": { - "x": 1.598, - "y": 1.583, - "z": -13.746 + "x": -28.643, + "y": 1.481, + "z": -38.649 }, "Rotation": { "x": 0, @@ -199488,6 +203018,18 @@ "y": 1.481, "z": -56.165 } + }, + { + "Position": { + "x": 1.6, + "y": 1.58, + "z": -13.75 + }, + "Rotation": { + "x": 0, + "y": 315, + "z": 0 + } } ], "TabStates": { @@ -199560,5 +203102,5 @@ "Type": 0 }, "VersionNumber": "v13.2.2", - "XmlUI": "\u003c!-- include Global/Global.xml --\u003e\n\u003cDefaults\u003e\n \u003c!-- general stuff --\u003e\n \u003cText color=\"white\"\n fontSize=\"18\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- include Global/BottomBar.xml --\u003e\n\u003cDefaults\u003e\n \u003cButton class=\"navbar\"\n tooltipPosition=\"Left\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n color=\"clear\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- Buttons at the bottom right (height: n * 37 - 2) --\u003e\n\u003cVerticalLayout visibility=\"Admin\"\n color=\"#000000\"\n outlineSize=\"1 1\"\n outline=\"#303030\"\n rectAlignment=\"LowerRight\"\n width=\"35\"\n height=\"72\"\n offsetXY=\"-1 120\"\n spacing=\"2\"\u003e\n \u003cButton class=\"navbar\"\n icon=\"devourer\"\n tooltip=\"Downloadable Content\"\n onClick=\"onClick_toggleUi(downloadWindow)\"/\u003e\n \u003cButton class=\"navbar\"\n icon=\"option-gear\"\n tooltip=\"Options\"\n onClick=\"onClick_toggleUi(optionPanel)\"/\u003e\n\u003c/VerticalLayout\u003e\n\n\u003c!-- Navigation Overlay button (not visibly to Grey and Black) --\u003e\n\u003cPanel visibility=\"White|Brown|Red|Orange|Yellow|Green|Teal|Blue|Purple|Pink\"\n color=\"#000000\"\n outlineSize=\"1 1\"\n outline=\"#303030\"\n rectAlignment=\"LowerRight\"\n width=\"35\"\n height=\"35\"\n offsetXY=\"-1 85\"\u003e\n \u003cButton class=\"navbar\"\n icon=\"NavigationOverlayIcon\"\n tooltip=\"Navigation Overlay\"\n onClick=\"onClick_toggleUi(Navigation Overlay)\"/\u003e\n\u003c/Panel\u003e\n\u003c!-- include Global/BottomBar.xml --\u003e\n\u003c!-- include Global/DownloadWindow.xml --\u003e\n\u003cDefaults\u003e\n \u003cButton class=\"downloadTab\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n onClick=\"onClick_tab\"\n color=\"#888888\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"bGrey\"\n color=\"grey\"/\u003e\n \u003cButton class=\"bWhite\"\n color=\"white\"/\u003e\n \u003cButton class=\"activeTab\"\n color=\"#ffffff\"/\u003e\n \u003cButton class=\"windowButton\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n selectClass=\"bWhite\"\n color=\"#888888\"\n font=\"font_teutonic-arkham\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- window to select downloadable content --\u003e\n\u003cVerticalLayout id=\"downloadWindow\"\n visibility=\"Admin\"\n color=\"black\"\n active=\"false\"\n height=\"800\"\n width=\"900\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\u003e\n\n \u003c!-- window header --\u003e\n \u003cPanel preferredHeight=\"60\"\n padding=\"10 10 5 5\"\n spacing=\"10\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\n color=\"black\"\u003e\n \u003cText fontSize=\"32\"\n font=\"font_teutonic-arkham\"\n preferredWidth=\"600\"\n alignment=\"MiddleLeft\"\u003eDownloadable Content\u003c/Text\u003e\n \u003cButton id=\"downloadAll_button\"\n class=\"windowButton\"\n visibility=\"Black\"\n onClick=\"onClick_downloadAll\"\n height=\"30\"\n preferredWidth=\"110\"\n fontSize=\"20\"\n tooltip=\"Very rough estimate: 400 MB\"\n tooltipPosition=\"Above\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\u003eDownload Everything\u003c/Button\u003e\n \u003cButton id=\"spawnPlaceholder_button\"\n class=\"windowButton\"\n visibility=\"Black\"\n onClick=\"onClick_spawnPlaceholder\"\n height=\"30\"\n preferredWidth=\"110\"\n fontSize=\"20\"\u003eSpawn Placeholder\u003c/Button\u003e\n \u003cPanel preferredWidth=\"50\"\u003e\n \u003cButton rectAlignment=\"MiddleRight\"\n width=\"50\"\n color=\"clear\"\n icon=\"close\"\n tooltip=\"Close\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n onClick=\"onClick_toggleUi(downloadWindow)\"/\u003e\n \u003c/Panel\u003e\n \u003c/Panel\u003e\n\n \u003cHorizontalLayout\u003e\n \u003cVerticalLayout preferredWidth=\"600\"\u003e\n \u003c!-- tab selection --\u003e\n \u003cHorizontalLayout preferredHeight=\"60\"\n padding=\"5\"\n spacing=\"5\"\u003e\n \u003cButton class=\"downloadTab activeTab\"\n id=\"tab1\"\u003eOfficial Campaigns\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab2\"\u003eOfficial Scenarios\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab3\"\u003eFan-Made Campaigns\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab4\"\u003eFan-Made Scenarios\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab5\"\u003eFan-Made Player Cards\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n\n \u003c!-- content list --\u003e\n \u003cVerticalScrollView color=\"transparent\"\n minHeight=\"100\"\n flexibleHeight=\"100\"\n scrollSensitivity=\"27\"\n scrollbarColors=\"grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)\"\n horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n raycastTarget=\"true\"\u003e\n \u003cVerticalLayout id=\"contentList\"\n padding=\"10 25 0 0\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c/VerticalLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- content preview window --\u003e\n \u003cVerticalLayout preferredWidth=\"300\"\n padding=\"15 15 15 5\"\u003e\n\n \u003c!-- header --\u003e\n \u003cVerticalLayout preferredHeight=\"110\"\u003e\n \u003cText id=\"previewTitle\"\n fontSize=\"28\"\n preferredHeight=\"70\"\n font=\"font_teutonic-arkham\"\u003ePreviewTitle\u003c/Text\u003e\n \u003cText id=\"previewAuthor\"\n fontSize=\"20\"\n preferredHeight=\"40\"\n font=\"font_teutonic-arkham\"\u003eby PreviewAuthor\u003c/Text\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- box art --\u003e\n \u003cPanel id=\"previewArtPanel\"\n preferredHeight=\"390\"\u003e\n \u003cMask id=\"previewArtMask\"\u003e\n \u003c!-- image will be set via scripting --\u003e\n \u003cImage id=\"previewArtImage\" /\u003e\n \u003c/Mask\u003e\n \u003c/Panel\u003e\n\n \u003c!-- description --\u003e\n \u003cPanel preferredHeight=\"160\"\u003e\n \u003cText id=\"previewDescription\"\n alignment=\"UpperLeft\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"12\"\n resizeTextMaxSize=\"18\"\u003ePreviewDescription\u003c/Text\u003e\n \u003c/Panel\u003e\n\n \u003c!-- download button / progress bar (visibility handled by lua code)--\u003e\n \u003cPanel preferredHeight=\"60\"\u003e\n \u003c!-- download button --\u003e\n \u003cButton id=\"download_button\"\n class=\"windowButton\"\n onClick=\"onClick_download\"\n height=\"50\"\n width=\"270\"\n fontSize=\"28\"\u003eDownload\u003c/Button\u003e\n \u003c!-- download progress bar --\u003e\n \u003cProgressBar id=\"download_progress\"\n active=\"false\"\n height=\"50\"\n width=\"270\"\n percentage=\"0\"\n color=\"#111111\"\n textColor=\"#aaaaaa\"\n fillImageColor=\"#333333\"/\u003e\n \u003c/Panel\u003e\n \u003c/VerticalLayout\u003e\n \u003c/HorizontalLayout\u003e\n\u003c/VerticalLayout\u003e\n\u003c!-- include Global/DownloadWindow.xml --\u003e\n\u003c!-- include Global/PlayareaGallery.xml --\u003e\n\u003cDefaults\u003e\n \u003c!-- type selection at the top --\u003e\n \u003cButton class=\"imageTab\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n onClick=\"b7b45b/onClick_imageTab\"\n color=\"#888888\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"bGrey\"\n color=\"grey\"/\u003e\n \u003cButton class=\"bWhite\"\n color=\"white\"/\u003e\n\n \u003c!-- image boxes in the grid --\u003e\n \u003cVerticalLayout class=\"imageBox\"\n color=\"black\"\n outline=\"#303030\"\n outlineSize=\"2 2\"\n onClick=\"b7b45b/onClick_image\"/\u003e\n \u003cImage class=\"playareaImage\"\n preferredHeight=\"330\"/\u003e\n \u003cText class=\"imageName\"\n preferredHeight=\"40\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"10\"\n resizeTextMaxSize=\"18\"/\u003e\n\n \u003c!-- item selection on the left --\u003e\n \u003cText class=\"itemText\"\n alignment=\"MiddleLeft\"/\u003e\n \u003cPanel class=\"itemPanel\"\n preferredHeight=\"45\"\n onClick=\"b7b45b/onClick_listItem\"/\u003e\n\n \u003c!-- other --\u003e\n \u003cText class=\"headerText\"\n fontSize=\"35\"/\u003e\n \u003cVerticalLayout childForceExpandHeight=\"false\"/\u003e\n\u003c/Defaults\u003e\n\n\u003cVerticalLayout id=\"playareaGallery\"\n active=\"false\"\n color=\"black\"\n height=\"880\"\n width=\"900\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\u003e\n\n \u003c!-- window header --\u003e\n \u003cPanel preferredHeight=\"60\"\n padding=\"10 10 5 5\"\n spacing=\"10\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\n color=\"black\"\u003e\n \u003cText fontSize=\"32\"\n font=\"font_teutonic-arkham\"\n preferredWidth=\"600\"\n alignment=\"MiddleLeft\"\u003ePlayarea Image Gallery\u003c/Text\u003e\n \u003cPanel preferredWidth=\"50\"\u003e\n \u003cButton rectAlignment=\"MiddleRight\"\n width=\"50\"\n color=\"clear\"\n icon=\"close\"\n tooltip=\"Close\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n onClick=\"onClick_toggleUi(playareaGallery)\"/\u003e\n \u003c/Panel\u003e\n \u003c/Panel\u003e\n\n \u003c!-- tab selection --\u003e\n \u003cHorizontalLayout preferredHeight=\"60\"\n padding=\"5\"\n spacing=\"5\"\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab1\"\u003eOfficial Campaigns\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab2\"\u003eOfficial Scenarios\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab3\"\u003eFan-Made Campaigns\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab4\"\u003eFan-Made Scenarios\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab5\"\u003eOther Images\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n\n \u003cHorizontalLayout preferredHeight=\"760\"\u003e\n \u003c!-- left column: navigation bar --\u003e\n \u003cVerticalLayout id=\"itemSelection\"\n preferredWidth=\"180\"\n padding=\"10 15 0 0\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c!-- \u003cPanel class=\"itemPanel\"\u003e\n \u003cText class=\"itemText\"\u003eItem\u003c/Text\u003e\n \u003c/Panel\u003e --\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- right column: image gallery --\u003e\n \u003cVerticalScrollView color=\"transparent\"\n minHeight=\"100\"\n flexibleHeight=\"100\"\n preferredWidth=\"720\"\n scrollSensitivity=\"380\"\n scrollbarColors=\"grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)\"\n horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n raycastTarget=\"true\"\u003e\n \u003cGridLayout id=\"playareaList\"\n preferredWidth=\"700\"\n padding=\"25 25 5 5\"\n spacing=\"10\"\n cellSize=\"330 370\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c!-- \u003cVerticalLayout class=\"imageBox\"\u003e\n \u003cImage class=\"playareaImage\" image=\"\"/\u003e\n \u003cText class=\"imageName\"\u003eImage Name\u003c/Text\u003e\n \u003c/VerticalLayout\u003e --\u003e\n \u003c/GridLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/HorizontalLayout\u003e\n\u003c/VerticalLayout\u003e\n\u003c!-- include Global/PlayareaGallery.xml --\u003e\n\u003c!-- include Global/TitleSplash.xml --\u003e\n\u003c!-- Title Splash when starting a scenario --\u003e\n\u003cPanel id=\"title_splash\"\n height=\"220\"\n position=\"0 250 0\"\n showAnimation=\"FadeIn\"\n hideAnimation=\"FadeOut\"\n active=\"false\"\n animationDuration=\"2\"\u003e\n \u003cImage id=\"title_gradient\"\n height=\"220\"\n image=\"TitleGradient\" /\u003e\n \u003cText id=\"title_splash_text\"\n width=\"95%\"\n height=\"180\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"100\"\n resizeTextMaxSize=\"150\"\n font=\"font_teutonic-arkham\"\n outline=\"black\"\n outlineSize=\"3 -3\"\n horizontalOverflow=\"Overflow\"\u003e\n \u003c/Text\u003e\n\u003c/Panel\u003e\n\u003c!-- include Global/TitleSplash.xml --\u003e\n\u003c!-- include Global/NavigationOverlay.xml --\u003e\n\u003c!-- Default formatting --\u003e\n\u003cDefaults\u003e\n \u003cText color=\"#FFFFFF\"\n alignment=\"MiddleLeft\" /\u003e\n\n \u003cToggle isOn=\"False\"\n rectAlignment=\"MiddleRight\" /\u003e\n\n \u003cCell dontUseTableCellBackground=\"true\"\n outlineSize=\"0 1\"\n outline=\"grey\" /\u003e\n\n \u003c!-- options --\u003e\n \u003cRow class=\"nav_option-text\"\n preferredHeight=\"45\"/\u003e\n \u003cCell class=\"nav_option-text\"\n color=\"#333333\"/\u003e\n \u003cCell class=\"nav_option-button\"\n color=\"#333333\"/\u003e\n \u003cText class=\"nav_option-header\"\n fontSize=\"20\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cCell class=\"claim\"\n tooltip=\"Clicking this seat in the navigation overlay will now only swap the playercolor for you.\"\n tooltipPosition=\"Right\" /\u003e\n\n \u003c!-- buttons at the bottom --\u003e\n \u003cButton class=\"bottomButtons\"\n hoverClass=\"hover\"\n pressClass=\"press\"\n selectClass=\"select\"\n color=\"#888888\"\n minHeight=\"35\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"hover\"\n color=\"grey\"/\u003e\n \u003cButton class=\"press\"\n color=\"white\"/\u003e\n \u003cButton class=\"select\"\n color=\"white\"/\u003e\n\n \u003c!-- Navigation Panels --\u003e\n \u003cPanel class=\"navPanel\"\n active=\"false\"\n allowDragging=\"true\"\n rectAlignment=\"LowerRight\"\n returnToOriginalPositionWhenReleased=\"false\"\n offsetXY=\"-40 0\"\u003e\n \u003c/Panel\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- full Panel --\u003e\n\u003cPanel id=\"navPanelFull\"\n height=\"358\"\n width=\"455\"\n class=\"navPanel\"\u003e\n\u003c/Panel\u003e\n\n\u003c!-- Play Area only --\u003e\n\u003cPanel id=\"navPanelPlay\"\n height=\"208\"\n width=\"205\"\n class=\"navPanel\"\u003e\n\u003c/Panel\u003e\n\n\u003c!-- Settings --\u003e\n\u003cTableLayout id=\"navPanelSettings\"\n active=\"false\"\n width=\"300\"\n height=\"335\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n rectAlignment=\"MiddleCenter\"\u003e\n\n \u003c!-- Header --\u003e\n \u003cRow preferredHeight=\"60\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 0 0 0\"\u003e\n \u003cText font=\"font_teutonic-arkham\"\n fontSize=\"35\"\u003eNavigation Overlay\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Options --\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cTableLayout columnWidths=\"0 125\"\n autoCalculateHeight=\"1\"\n cellPadding=\"10 0 5 5\"\u003e\n\n \u003c!-- Option: Custom pitch --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eViewing angle in degrees:\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button\"\u003e\n \u003cSlider id=\"sliderPitch\"\n onValueChanged=\"797ede/updatePitch\"\n wholeNumbers=\"true\"\n minValue=\"0\"\n maxValue=\"89\"\n value=\"75\"\n tooltip=\"This controls the camera pitch ('nodding your head').\"\n tooltipPosition=\"Right\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim White --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"White\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimWhite\"\n onValueChanged=\"797ede/claimColor(White)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Orange --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Orange\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimOrange\"\n onValueChanged=\"797ede/claimColor(Orange)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Green --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Green\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimGreen\"\n onValueChanged=\"797ede/claimColor(Green)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Red --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Red\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimRed\"\n onValueChanged=\"797ede/claimColor(Red)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003c/TableLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: Defaults and Close --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"35\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"797ede/loadDefaultSettings\"\u003eLoad defaults\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"797ede/toggleSettings\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/NavigationOverlay.xml --\u003e\n\u003c!-- include Global/OptionPanel.xml --\u003e\n\u003c!-- Default formatting --\u003e\n\u003cDefaults\u003e\n \u003cText color=\"#FFFFFF\"\n alignment=\"MiddleLeft\" /\u003e\n\n \u003cToggle isOn=\"False\"\n rectAlignment=\"MiddleRight\" /\u003e\n\n \u003cDropdown rectAlignment=\"MiddleCenter\" /\u003e\n\n \u003cCell dontUseTableCellBackground=\"true\"\n outlineSize=\"0 1\"\n outline=\"grey\" /\u003e\n\n \u003c!-- main window --\u003e\n \u003cTableLayout class=\"window\"\n width=\"500\"\n height=\"800\"\n active=\"false\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n showAnimation=\"SlideIn_Right\"\n hideAnimation=\"SlideOut_Right\"\n animationDuration=\"0.2\" /\u003e\n\n \u003c!-- group headers --\u003e\n \u003cRow class=\"group-header\"\n preferredHeight=\"54\" /\u003e\n \u003cCell class=\"group-header\"\n columnSpan=\"3\"\n color=\"#222222\" /\u003e\n \u003cPanel class=\"group-header\"\n padding=\"5 0 0 0\" /\u003e\n \u003cText class=\"group-header\"\n fontSize=\"28\"\n font=\"font_teutonic-arkham\" /\u003e\n\n \u003c!-- options --\u003e\n \u003cRow class=\"option-text\"\n preferredHeight=\"50\"\n tooltipPosition=\"Left\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"/\u003e\n \u003cCell class=\"option-text\"\n color=\"#333333\"\n columnSpan=\"2\"/\u003e\n \u003cCell class=\"option-button\"\n color=\"#333333\"/\u003e\n \u003cCell class=\"option-dropdowntext\"\n color=\"#333333\"\n columnSpan=\"1\"/\u003e\n \u003cCell class=\"option-dropdown\"\n color=\"#333333\"\n columnSpan=\"2\"/\u003e\n \u003cPanel class=\"option-wrapper\"\n padding=\"10 0 0 0\"/\u003e\n \u003cText class=\"option-header\"\n fontSize=\"22\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cPanel class=\"dropdown-wrapper\"\n padding=\"0 17 3 3\"/\u003e\n\n \u003c!-- buttons at the bottom --\u003e\n \u003cButton class=\"bottomButtons\"\n hoverClass=\"hover\"\n pressClass=\"press\"\n selectClass=\"select\"\n color=\"#888888\"\n minHeight=\"35\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"hover\"\n color=\"grey\"/\u003e\n \u003cButton class=\"press\"\n color=\"white\"/\u003e\n \u003cButton class=\"select\"\n color=\"white\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- Option Panel --\u003e\n\u003cTableLayout id=\"optionPanel\"\n class=\"window\"\n visibility=\"Admin\"\n rectAlignment=\"LowerRight\"\n offsetXY=\"-50 80\"\n raycastTarget=\"true\"\u003e\n \u003c!-- Header: Options --\u003e\n \u003cRow preferredHeight=\"60\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 0 0 0\"\u003e\n \u003cText font=\"font_teutonic-arkham\"\n fontSize=\"35\"\u003eOptions\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Scrollable part with options --\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cVerticalScrollView horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n scrollSensitivity=\"30\"\n raycastTarget=\"true\"\u003e\n \u003cTableLayout columnWidths=\"0 100 75\"\n autoCalculateHeight=\"1\"\n cellPadding=\"10 10 5 5\"\u003e\n\n \u003c!-- Group: general settings --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_acolyte\"\u003e\n \u003cText class=\"group-header\"\u003eGENERAL SETTINGS\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: card language --\u003e\n \u003c!-- disabled until we have the backend in place\n \u003cRow class=\"option-text\" tooltip=\"Downloading a campaign or importing a deck will use\u0026#xA;this language for cards (NOT FUNCTIONAL YET!).\"\u003e\n \u003cCell class=\"option-dropdowntext\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eCard language\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-dropdown\"\u003e\n \u003cPanel class=\"dropdown-wrapper\"\u003e\n \u003cDropdown id=\"cardLanguage\" onValueChanged=\"languageSelected(selectedIndex)\"\u003e\n \u003cOption\u003e简体中文\u003c/Option\u003e\n \u003cOption\u003e繁體中文\u003c/Option\u003e\n \u003cOption\u003eDeutsch\u003c/Option\u003e\n \u003cOption\u003eEnglish\u003c/Option\u003e\n \u003cOption\u003eEspañol\u003c/Option\u003e\n \u003cOption\u003eFrançais\u003c/Option\u003e\n \u003cOption\u003eItaliano\u003c/Option\u003e\n \u003c/Dropdown\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e --\u003e\n\n \u003c!-- Option: play area snap tags --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Only cards with the tag 'Location' will snap (official cards are supported by default).\u0026#xA;Disable this if you are having issues with custom content.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eEnable snap tags for play area\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"playAreaSnapTags\"\n onValueChanged=\"onClick_toggleOption(playAreaSnapTags)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: splash scenario name on setup --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Fade in the name of the scenario for 2 seconds\u0026#xA;when placing down a scenario.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eShow scenario title on setup\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showTitleSplash\"\n onValueChanged=\"onClick_toggleOption(showTitleSplash)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Group: playermat settings --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_cover\"\u003e\n \u003cText class=\"group-header\"\u003ePLAYERMAT SETTINGS\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: enable snap tags --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Only cards with the tag 'Asset' will snap (official cards are supported by default).\u0026#xA;Disable this if you are having issues with custom content.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eEnable snap tags\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"useSnapTags\"\n onValueChanged=\"onClick_toggleOption(useSnapTags)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show draw 1 button --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Displays a button below the 'Upkeep' button that draws a card from your deck.\u0026#xA;Useful for multi-handed solo play.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eShow \"Draw 1\" button\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showDrawButton\"\n onValueChanged=\"onClick_toggleOption(showDrawButton)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: use clickable clue-counters --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Instead of automatically counting clues in the respective area on your playermat,\u0026#xA;this displays a clickable counter for clues.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eUse clickable clue counters\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"useClueClickers\"\n onValueChanged=\"onClick_toggleOption(useClueClickers)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: use clickable resource counters --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"This enables spawning of clickable resource tokens for player cards.\u0026#xA;(Chef's Selection = assets with 0 uses)\"\u003e\n \u003cCell class=\"option-dropdowntext\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eUse clickable resource tokens\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-dropdown\"\u003e\n \u003cPanel class=\"dropdown-wrapper\"\u003e\n \u003cDropdown id=\"useResourceCounters\"\n onValueChanged=\"resourceCounterSelected(selectedIndex)\"\u003e\n \u003cOption\u003eEnabled\u003c/Option\u003e\n \u003cOption\u003eChef's Selection\u003c/Option\u003e\n \u003cOption\u003eDisabled\u003c/Option\u003e\n \u003c/Dropdown\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Group: fan-made accessories --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_olive\"\u003e\n \u003cText class=\"group-header\"\u003eFAN-MADE ACCESSORIES\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show attachment helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Provides a card-sized bag for cards that are attached to other cards\u0026#xA;(e.g. Backpack).\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eAttachment Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showAttachmentHelper\"\n onValueChanged=\"onClick_toggleOption(showAttachmentHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show clean up helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Useful for campaign-play:\u0026#xA;It resets play areas to allow continuous gameplay in the same savegame.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eClean Up Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showCleanUpHelper\"\n onValueChanged=\"onClick_toggleOption(showCleanUpHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show CYOA campaign guides --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Displays in a 'Choose Your Own Adventure'\u0026#xA;style redesigned campaign guides.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eCYOA Campaign Guides\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showCYOA\"\n onValueChanged=\"onClick_toggleOption(showCYOA)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show displacement tool --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"This allows moving all objects on the main playmat\u0026#xA;in a chosen direction.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eDisplacement Tool\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showDisplacementTool\"\n onValueChanged=\"onClick_toggleOption(showDisplacementTool)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show hand helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Never count your hand cards again! This tool does that for you\u0026#xA;and additionally enables easy discarding of random cards.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eHand Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showHandHelper\"\n onValueChanged=\"onClick_toggleOption(showHandHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show search assistant --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Quickly search 3, 6, 9 or the top X\u0026#xA;cards of your deck!\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"option-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eSearch Assistant\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showSearchAssistant\"\n onValueChanged=\"onClick_toggleOption(showSearchAssistant)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003c/TableLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: Defaults and Close --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"225\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_defaultSettings\"\u003eLoad defaults\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_toggleUi(optionPanel)\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/OptionPanel.xml --\u003e\n\u003c!-- include Global/UpdateNotification.xml --\u003e\n\u003c!-- Default formatting inherented from OptionPanel! --\u003e\n\n\u003c!-- Icon with Finn, which can be clicked --\u003e\n\u003cImage id=\"FinnIcon\"\n active=\"false\"\n showAnimation=\"SlideIn_Top\"\n hideAnimation=\"SlideOut_Top\"\n animationDuration=\"0.2\"\n rectAlignment=\"UpperLeft\"\n offsetXY=\"420 -5\"\n height=\"90\"\n width=\"90\"\n onClick=\"onClick_toggleUi(updateNotification)\"\n image=\"FinnIcon\"\n tooltip=\"Update notification\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"/\u003e\n\n\u003c!-- main notification window --\u003e\n\u003cTableLayout id=\"updateNotification\"\n active=\"false\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n showAnimation=\"SlideIn_Top\"\n hideAnimation=\"SlideOut_Top\"\n animationDuration=\"0.2\"\n rectAlignment=\"UpperLeft\"\n offsetXY=\"60 -5\"\n height=\"225\"\n width=\"350\"\u003e\n\n \u003c!-- Header --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 10 0 0\"\u003e\n \u003c!-- this part will be updated via script --\u003e\n \u003cText id=\"notificationHeader\"\n font=\"font_teutonic-arkham\"\n fontSize=\"30\"\n alignment=\"MiddleCenter\"\u003ePlaceholder\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- patch highlights --\u003e\n \u003cRow id=\"highlightRow\"\n preferredHeight=\"100\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"15 15 0 7\"\u003e\n \u003c!-- this part will be updated via script --\u003e\n \u003cText id=\"releaseHighlightText\"\n resizeTextForBestFit=\"true\"\u003ePlaceholder\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- explanation --\u003e\n \u003cRow preferredHeight=\"25\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"15 15 0 7\"\u003e\n \u003cText resizeTextForBestFit=\"true\"\u003eVisit the usual place to receive this update.\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: \"Don't show again\" and \"Close\" --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"10\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_notification(dontShowAgain)\"\u003eDon't show again\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_notification(close)\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/UpdateNotification.xml --\u003e\n\u003c!-- include Global/Global.xml --\u003e" + "XmlUI": "\u003c!-- include Global/Global.xml --\u003e\n\u003cDefaults\u003e\n \u003c!-- general stuff --\u003e\n \u003cText color=\"white\"\n fontSize=\"18\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- include Global/BottomBar.xml --\u003e\n\u003cDefaults\u003e\n \u003cButton class=\"navbar\"\n tooltipPosition=\"Left\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n color=\"clear\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- Buttons at the bottom right (height: n * 37 - 2) --\u003e\n\u003cVerticalLayout visibility=\"Admin\"\n color=\"#000000\"\n outlineSize=\"1 1\"\n outline=\"#303030\"\n rectAlignment=\"LowerRight\"\n width=\"35\"\n height=\"72\"\n offsetXY=\"-1 120\"\n spacing=\"2\"\u003e\n \u003cButton class=\"navbar\"\n icon=\"devourer\"\n tooltip=\"Downloadable Content\"\n onClick=\"onClick_toggleUi(downloadWindow)\"/\u003e\n \u003cButton class=\"navbar\"\n icon=\"option-gear\"\n tooltip=\"Options\"\n onClick=\"onClick_toggleUi(optionPanel)\"/\u003e\n\u003c/VerticalLayout\u003e\n\n\u003c!-- Navigation Overlay button (not visibly to Grey and Black) --\u003e\n\u003cPanel visibility=\"White|Brown|Red|Orange|Yellow|Green|Teal|Blue|Purple|Pink\"\n color=\"#000000\"\n outlineSize=\"1 1\"\n outline=\"#303030\"\n rectAlignment=\"LowerRight\"\n width=\"35\"\n height=\"35\"\n offsetXY=\"-1 85\"\u003e\n \u003cButton class=\"navbar\"\n icon=\"NavigationOverlayIcon\"\n tooltip=\"Navigation Overlay\"\n onClick=\"onClick_toggleUi(Navigation Overlay)\"/\u003e\n\u003c/Panel\u003e\n\u003c!-- include Global/BottomBar.xml --\u003e\n\u003c!-- include Global/DownloadWindow.xml --\u003e\n\u003cDefaults\u003e\n \u003cButton class=\"downloadTab\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n onClick=\"onClick_tab\"\n color=\"#888888\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"bGrey\"\n color=\"grey\"/\u003e\n \u003cButton class=\"bWhite\"\n color=\"white\"/\u003e\n \u003cButton class=\"activeTab\"\n color=\"#ffffff\"/\u003e\n \u003cButton class=\"windowButton\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n selectClass=\"bWhite\"\n color=\"#888888\"\n font=\"font_teutonic-arkham\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- window to select downloadable content --\u003e\n\u003cVerticalLayout id=\"downloadWindow\"\n visibility=\"Admin\"\n color=\"black\"\n active=\"false\"\n height=\"800\"\n width=\"900\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\u003e\n\n \u003c!-- window header --\u003e\n \u003cPanel preferredHeight=\"60\"\n padding=\"10 10 5 5\"\n spacing=\"10\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\n color=\"black\"\u003e\n \u003cText fontSize=\"32\"\n font=\"font_teutonic-arkham\"\n preferredWidth=\"600\"\n alignment=\"MiddleLeft\"\u003eDownloadable Content\u003c/Text\u003e\n \u003cButton id=\"downloadAll_button\"\n class=\"windowButton\"\n visibility=\"Black\"\n onClick=\"onClick_downloadAll\"\n height=\"30\"\n preferredWidth=\"110\"\n fontSize=\"20\"\n tooltip=\"Very rough estimate: 400 MB\"\n tooltipPosition=\"Above\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\u003eDownload Everything\u003c/Button\u003e\n \u003cButton id=\"spawnPlaceholder_button\"\n class=\"windowButton\"\n visibility=\"Black\"\n onClick=\"onClick_spawnPlaceholder\"\n height=\"30\"\n preferredWidth=\"110\"\n fontSize=\"20\"\u003eSpawn Placeholder\u003c/Button\u003e\n \u003cPanel preferredWidth=\"50\"\u003e\n \u003cButton rectAlignment=\"MiddleRight\"\n width=\"50\"\n color=\"clear\"\n icon=\"close\"\n tooltip=\"Close\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n onClick=\"onClick_toggleUi(downloadWindow)\"/\u003e\n \u003c/Panel\u003e\n \u003c/Panel\u003e\n\n \u003cHorizontalLayout\u003e\n \u003cVerticalLayout preferredWidth=\"600\"\u003e\n \u003c!-- tab selection --\u003e\n \u003cHorizontalLayout preferredHeight=\"60\"\n padding=\"5\"\n spacing=\"5\"\u003e\n \u003cButton class=\"downloadTab activeTab\"\n id=\"tab1\"\u003eOfficial Campaigns\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab2\"\u003eOfficial Scenarios\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab3\"\u003eFan-Made Campaigns\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab4\"\u003eFan-Made Scenarios\u003c/Button\u003e\n \u003cButton class=\"downloadTab\"\n id=\"tab5\"\u003eFan-Made Player Cards\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n\n \u003c!-- content list --\u003e\n \u003cVerticalScrollView color=\"transparent\"\n minHeight=\"100\"\n flexibleHeight=\"100\"\n scrollSensitivity=\"27\"\n scrollbarColors=\"grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)\"\n horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n raycastTarget=\"true\"\u003e\n \u003cVerticalLayout id=\"contentList\"\n padding=\"10 25 0 0\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c/VerticalLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- content preview window --\u003e\n \u003cVerticalLayout preferredWidth=\"300\"\n padding=\"15 15 15 5\"\u003e\n\n \u003c!-- header --\u003e\n \u003cVerticalLayout preferredHeight=\"110\"\u003e\n \u003cText id=\"previewTitle\"\n fontSize=\"28\"\n preferredHeight=\"70\"\n font=\"font_teutonic-arkham\"\u003ePreviewTitle\u003c/Text\u003e\n \u003cText id=\"previewAuthor\"\n fontSize=\"20\"\n preferredHeight=\"40\"\n font=\"font_teutonic-arkham\"\u003eby PreviewAuthor\u003c/Text\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- box art --\u003e\n \u003cPanel id=\"previewArtPanel\"\n preferredHeight=\"390\"\u003e\n \u003cMask id=\"previewArtMask\"\u003e\n \u003c!-- image will be set via scripting --\u003e\n \u003cImage id=\"previewArtImage\" /\u003e\n \u003c/Mask\u003e\n \u003c/Panel\u003e\n\n \u003c!-- description --\u003e\n \u003cPanel preferredHeight=\"160\"\u003e\n \u003cText id=\"previewDescription\"\n alignment=\"UpperLeft\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"12\"\n resizeTextMaxSize=\"18\"\u003ePreviewDescription\u003c/Text\u003e\n \u003c/Panel\u003e\n\n \u003c!-- download button / progress bar (visibility handled by lua code)--\u003e\n \u003cPanel preferredHeight=\"60\"\u003e\n \u003c!-- download button --\u003e\n \u003cButton id=\"download_button\"\n class=\"windowButton\"\n onClick=\"onClick_download\"\n height=\"50\"\n width=\"270\"\n fontSize=\"28\"\u003eDownload\u003c/Button\u003e\n \u003c!-- download progress bar --\u003e\n \u003cProgressBar id=\"download_progress\"\n active=\"false\"\n height=\"50\"\n width=\"270\"\n percentage=\"0\"\n color=\"#111111\"\n textColor=\"#aaaaaa\"\n fillImageColor=\"#333333\"/\u003e\n \u003c/Panel\u003e\n \u003c/VerticalLayout\u003e\n \u003c/HorizontalLayout\u003e\n\u003c/VerticalLayout\u003e\n\u003c!-- include Global/DownloadWindow.xml --\u003e\n\u003c!-- include Global/PlayAreaGallery.xml --\u003e\n\u003cDefaults\u003e\n \u003c!-- type selection at the top --\u003e\n \u003cButton class=\"imageTab\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n onClick=\"b7b45b/onClick_imageTab\"\n color=\"#888888\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"bGrey\"\n color=\"grey\"/\u003e\n \u003cButton class=\"bWhite\"\n color=\"white\"/\u003e\n\n \u003cButton class=\"windowButton\"\n hoverClass=\"bGrey\"\n pressClass=\"bWhite\"\n selectClass=\"bWhite\"\n color=\"#888888\"\n font=\"font_teutonic-arkham\"/\u003e\n\n \u003c!-- image boxes in the grid --\u003e\n \u003cVerticalLayout class=\"imageBox\"\n color=\"black\"\n outline=\"#303030\"\n outlineSize=\"2 2\"\n onClick=\"b7b45b/onClick_image\"/\u003e\n \u003cImage class=\"playareaImage\"\n preferredHeight=\"330\"/\u003e\n \u003cText class=\"imageName\"\n preferredHeight=\"40\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"10\"\n resizeTextMaxSize=\"18\"/\u003e\n\n \u003c!-- item selection on the left --\u003e\n \u003cText class=\"itemText\"\n alignment=\"MiddleLeft\"/\u003e\n \u003cPanel class=\"itemPanel\"\n preferredHeight=\"45\"\n onClick=\"b7b45b/onClick_listItem\"/\u003e\n\n \u003c!-- other --\u003e\n \u003cText class=\"headerText\"\n fontSize=\"35\"/\u003e\n \u003cVerticalLayout childForceExpandHeight=\"false\"/\u003e\n\u003c/Defaults\u003e\n\n\u003cVerticalLayout id=\"playAreaGallery\"\n active=\"false\"\n color=\"black\"\n height=\"880\"\n width=\"900\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\u003e\n\n \u003c!-- window header --\u003e\n \u003cPanel preferredHeight=\"60\"\n padding=\"10 10 5 5\"\n spacing=\"10\"\n outlineSize=\"2 2\"\n outline=\"#303030\"\n color=\"black\"\u003e\n \u003cText fontSize=\"32\"\n font=\"font_teutonic-arkham\"\n preferredWidth=\"600\"\n alignment=\"MiddleLeft\"\u003ePlayarea Image Gallery\u003c/Text\u003e\n \u003cButton id=\"customUrl_button\"\n class=\"windowButton\"\n onClick=\"onClick_customUrl\"\n height=\"30\"\n preferredWidth=\"125\"\n fontSize=\"24\"\u003eUse custom URL\u003c/Button\u003e\n \u003cPanel preferredWidth=\"50\"\u003e\n \u003cButton rectAlignment=\"MiddleRight\"\n width=\"50\"\n color=\"clear\"\n icon=\"close\"\n tooltip=\"Close\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"\n onClick=\"onClick_toggleUi(playAreaGallery)\"/\u003e\n \u003c/Panel\u003e\n \u003c/Panel\u003e\n\n \u003c!-- tab selection --\u003e\n \u003cHorizontalLayout preferredHeight=\"60\"\n padding=\"5\"\n spacing=\"5\"\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab1\"\u003eOfficial Campaigns\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab2\"\u003eOfficial Scenarios\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab3\"\u003eFan-Made Campaigns\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab4\"\u003eFan-Made Scenarios\u003c/Button\u003e\n \u003cButton class=\"imageTab\"\n id=\"imageTab5\"\u003eOther Images\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n\n \u003cHorizontalLayout preferredHeight=\"760\"\u003e\n \u003c!-- left column: navigation bar --\u003e\n \u003cVerticalLayout id=\"itemSelection\"\n preferredWidth=\"180\"\n padding=\"10 15 0 0\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c!-- \u003cPanel class=\"itemPanel\"\u003e\n \u003cText class=\"itemText\"\u003eItem\u003c/Text\u003e\n \u003c/Panel\u003e --\u003e\n \u003c/VerticalLayout\u003e\n\n \u003c!-- right column: image gallery --\u003e\n \u003cVerticalScrollView color=\"transparent\"\n minHeight=\"100\"\n flexibleHeight=\"100\"\n preferredWidth=\"720\"\n scrollSensitivity=\"380\"\n scrollbarColors=\"grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)\"\n horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n raycastTarget=\"true\"\u003e\n \u003cGridLayout id=\"playareaList\"\n preferredWidth=\"700\"\n padding=\"25 25 5 5\"\n spacing=\"10\"\n cellSize=\"330 370\"\u003e\n \u003c!-- this will be filled via scripting --\u003e\n \u003c!-- \u003cVerticalLayout class=\"imageBox\"\u003e\n \u003cImage class=\"playareaImage\" image=\"\"/\u003e\n \u003cText class=\"imageName\"\u003eImage Name\u003c/Text\u003e\n \u003c/VerticalLayout\u003e --\u003e\n \u003c/GridLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/HorizontalLayout\u003e\n\u003c/VerticalLayout\u003e\n\u003c!-- include Global/PlayAreaGallery.xml --\u003e\n\u003c!-- include Global/TitleSplash.xml --\u003e\n\u003c!-- Title Splash when starting a scenario --\u003e\n\u003cPanel id=\"title_splash\"\n height=\"220\"\n position=\"0 250 0\"\n showAnimation=\"FadeIn\"\n hideAnimation=\"FadeOut\"\n active=\"false\"\n animationDuration=\"2\"\u003e\n \u003cImage id=\"title_gradient\"\n height=\"220\"\n image=\"TitleGradient\" /\u003e\n \u003cText id=\"title_splash_text\"\n width=\"95%\"\n height=\"180\"\n resizeTextForBestFit=\"true\"\n resizeTextMinSize=\"100\"\n resizeTextMaxSize=\"150\"\n font=\"font_teutonic-arkham\"\n outline=\"black\"\n outlineSize=\"3 -3\"\n horizontalOverflow=\"Overflow\"\u003e\n \u003c/Text\u003e\n\u003c/Panel\u003e\n\u003c!-- include Global/TitleSplash.xml --\u003e\n\u003c!-- include Global/NavigationOverlay.xml --\u003e\n\u003c!-- Default formatting --\u003e\n\u003cDefaults\u003e\n \u003cText color=\"#FFFFFF\"\n alignment=\"MiddleLeft\" /\u003e\n\n \u003cToggle isOn=\"False\"\n rectAlignment=\"MiddleRight\" /\u003e\n\n \u003cCell dontUseTableCellBackground=\"true\"\n outlineSize=\"0 1\"\n outline=\"grey\" /\u003e\n\n \u003c!-- options --\u003e\n \u003cRow class=\"nav_option-text\"\n preferredHeight=\"45\"/\u003e\n \u003cCell class=\"nav_option-text\"\n color=\"#333333\"/\u003e\n \u003cCell class=\"nav_option-button\"\n color=\"#333333\"/\u003e\n \u003cText class=\"nav_option-header\"\n fontSize=\"20\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cCell class=\"claim\"\n tooltip=\"Clicking this seat in the navigation overlay\u0026#xA;will now only swap the playercolor for you.\"\n tooltipPosition=\"Right\" /\u003e\n\n \u003c!-- buttons at the bottom --\u003e\n \u003cButton class=\"bottomButtons\"\n hoverClass=\"hover\"\n pressClass=\"press\"\n selectClass=\"select\"\n color=\"#888888\"\n minHeight=\"35\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"hover\"\n color=\"grey\"/\u003e\n \u003cButton class=\"press\"\n color=\"white\"/\u003e\n \u003cButton class=\"select\"\n color=\"white\"/\u003e\n\n \u003c!-- Navigation Panels --\u003e\n \u003cPanel class=\"navPanel\"\n active=\"false\"\n allowDragging=\"true\"\n rectAlignment=\"LowerRight\"\n returnToOriginalPositionWhenReleased=\"false\"\n offsetXY=\"-40 0\"\u003e\n \u003c/Panel\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- full Panel --\u003e\n\u003cPanel id=\"navPanelFull\"\n height=\"358\"\n width=\"455\"\n class=\"navPanel\"\u003e\n\u003c/Panel\u003e\n\n\u003c!-- Play Area only --\u003e\n\u003cPanel id=\"navPanelPlay\"\n height=\"208\"\n width=\"205\"\n class=\"navPanel\"\u003e\n\u003c/Panel\u003e\n\n\u003c!-- Settings --\u003e\n\u003cTableLayout id=\"navPanelSettings\"\n active=\"false\"\n width=\"300\"\n height=\"380\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n rectAlignment=\"MiddleCenter\"\u003e\n\n \u003c!-- Header --\u003e\n \u003cRow preferredHeight=\"60\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 0 0 0\"\u003e\n \u003cText font=\"font_teutonic-arkham\"\n fontSize=\"35\"\u003eNavigation Overlay\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Options --\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cTableLayout columnWidths=\"0 125\"\n autoCalculateHeight=\"1\"\n cellPadding=\"10 0 5 5\"\u003e\n\n \u003c!-- Option: Custom pitch --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eViewing angle in degrees:\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button\"\u003e\n \u003cSlider id=\"sliderPitch\"\n onValueChanged=\"797ede/updatePitch\"\n wholeNumbers=\"true\"\n minValue=\"0\"\n maxValue=\"89\"\n value=\"75\"\n tooltip=\"This controls the camera pitch\u0026#xA;('nodding your head').\"\n tooltipPosition=\"Right\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Custom distance --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eViewing distance (relative):\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button\"\u003e\n \u003cSlider id=\"sliderDistance\"\n onValueChanged=\"797ede/updateDistance\"\n wholeNumbers=\"true\"\n minValue=\"50\"\n maxValue=\"200\"\n value=\"100\"\n tooltip=\"This controls the camera distance\u0026#xA;(from 50% to 200% of the default settings).\"\n tooltipPosition=\"Right\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim White --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"White\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimWhite\"\n onValueChanged=\"797ede/claimColor(White)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Orange --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Orange\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimOrange\"\n onValueChanged=\"797ede/claimColor(Orange)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Green --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Green\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimGreen\"\n onValueChanged=\"797ede/claimColor(Green)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: Claim Red --\u003e\n \u003cRow class=\"nav_option-text\"\u003e\n \u003cCell class=\"nav_option-text\"\u003e\n \u003cText class=\"nav_option-header\"\u003eClaim \"Red\" seat\u003c/Text\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"nav_option-button claim\"\u003e\n \u003cToggle id=\"claimRed\"\n onValueChanged=\"797ede/claimColor(Red)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003c/TableLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: Defaults and Close --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"35\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"797ede/loadDefaultSettings\"\u003eLoad defaults\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"797ede/toggleSettings\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/NavigationOverlay.xml --\u003e\n\u003c!-- include Global/OptionPanel.xml --\u003e\n\u003c!-- Default formatting --\u003e\n\u003cDefaults\u003e\n \u003cText color=\"#FFFFFF\"\n alignment=\"MiddleLeft\" /\u003e\n\n \u003cToggle isOn=\"False\"\n rectAlignment=\"MiddleRight\" /\u003e\n\n \u003cDropdown rectAlignment=\"MiddleCenter\" /\u003e\n\n \u003cCell dontUseTableCellBackground=\"true\"\n outlineSize=\"0 1\"\n outline=\"grey\" /\u003e\n\n \u003c!-- main window --\u003e\n \u003cTableLayout class=\"window\"\n width=\"500\"\n height=\"800\"\n active=\"false\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n showAnimation=\"SlideIn_Right\"\n hideAnimation=\"SlideOut_Right\"\n animationDuration=\"0.2\" /\u003e\n\n \u003c!-- group headers --\u003e\n \u003cRow class=\"group-header\"\n preferredHeight=\"44\" /\u003e\n \u003cCell class=\"group-header\"\n padding=\"10 10 0 0\"\n columnSpan=\"3\"\n color=\"#222222\" /\u003e\n \u003cPanel class=\"group-header\"\n padding=\"5 0 0 0\" /\u003e\n \u003cText class=\"group-header\"\n fontSize=\"28\"\n font=\"font_teutonic-arkham\" /\u003e\n\n \u003c!-- options --\u003e\n \u003cRow class=\"option-text\"\n preferredHeight=\"50\"\n tooltipPosition=\"Left\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"/\u003e\n \u003cCell class=\"option-text\"\n padding=\"10 10 5 5\"\n color=\"#333333\"\n columnSpan=\"2\"/\u003e\n \u003cCell class=\"option-button\"\n padding=\"10 10 5 5\"\n color=\"#333333\"/\u003e\n \u003cCell class=\"option-singleColumn\"\n padding=\"10 10 5 5\"\n color=\"#333333\"\n columnSpan=\"1\"/\u003e\n \u003cCell class=\"option-doubleColumn\"\n padding=\"10 10 5 5\"\n color=\"#333333\"\n columnSpan=\"2\"/\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\n padding=\"10 0 0 0\"/\u003e\n \u003cText class=\"option-header\"\n fontSize=\"22\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cPanel class=\"doubleColumn-wrapper\"\n padding=\"0 17 3 3\"/\u003e\n\n \u003c!-- buttons at the bottom --\u003e\n \u003cButton class=\"bottomButtons\"\n hoverClass=\"hover\"\n pressClass=\"press\"\n selectClass=\"select\"\n color=\"#888888\"\n minHeight=\"35\"\n fontSize=\"24\"\n font=\"font_teutonic-arkham\"/\u003e\n \u003cButton class=\"hover\"\n color=\"grey\"/\u003e\n \u003cButton class=\"press\"\n color=\"white\"/\u003e\n \u003cButton class=\"select\"\n color=\"white\"/\u003e\n\u003c/Defaults\u003e\n\n\u003c!-- Option Panel --\u003e\n\u003cTableLayout id=\"optionPanel\"\n class=\"window\"\n visibility=\"Admin\"\n rectAlignment=\"LowerRight\"\n offsetXY=\"-50 80\"\n raycastTarget=\"true\"\u003e\n \u003c!-- Header: Options --\u003e\n \u003cRow preferredHeight=\"60\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 0 0 0\"\u003e\n \u003cText font=\"font_teutonic-arkham\"\n fontSize=\"35\"\u003eOptions\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Scrollable part with options --\u003e\n \u003cRow\u003e\n \u003cCell\u003e\n \u003cVerticalScrollView horizontalScrollbarVisibility=\"AutohideAndExpandViewport\"\n scrollSensitivity=\"30\"\n raycastTarget=\"true\"\u003e\n \u003cTableLayout columnWidths=\"0 100 75\"\n autoCalculateHeight=\"1\"\n useGlobalCellPadding=\"false\"\u003e\n\n \u003c!-- Group: general settings --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_acolyte\"\u003e\n \u003cText class=\"group-header\"\u003eGENERAL SETTINGS\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: card language --\u003e\n \u003c!-- disabled until we have the backend in place\n \u003cRow class=\"option-text\" tooltip=\"Downloading a campaign or importing a deck will use\u0026#xA;this language for cards (NOT FUNCTIONAL YET!).\"\u003e\n \u003cCell class=\"option-singleColumn\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eCard language\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-doubleColumn\"\u003e\n \u003cPanel class=\"doubleColumn-wrapper\"\u003e\n \u003cDropdown id=\"cardLanguage\" onValueChanged=\"languageSelected(selectedIndex)\"\u003e\n \u003cOption\u003e简体中文\u003c/Option\u003e\n \u003cOption\u003e繁體中文\u003c/Option\u003e\n \u003cOption\u003eDeutsch\u003c/Option\u003e\n \u003cOption\u003eEnglish\u003c/Option\u003e\n \u003cOption\u003eEspañol\u003c/Option\u003e\n \u003cOption\u003eFrançais\u003c/Option\u003e\n \u003cOption\u003eItaliano\u003c/Option\u003e\n \u003c/Dropdown\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e --\u003e\n\n \u003c!-- Option: splash scenario name on setup --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Fade in the name of the scenario for 2 seconds\u0026#xA;when placing down a scenario.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eShow scenario title on setup\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showTitleSplash\"\n onValueChanged=\"onClick_toggleOption(showTitleSplash)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Group: play area settings --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_compass\"\u003e\n \u003cText class=\"group-header\"\u003ePLAY AREA SETTINGS\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: play area snap tags --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Only cards with the tag 'Location' will snap (official cards are supported by default).\u0026#xA;Disable this if you are having issues with custom content.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eEnable snap tags\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"playAreaSnapTags\"\n onValueChanged=\"onClick_toggleOption(playAreaSnapTags)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: location connections --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Automatically draw location connections based on card metadata.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eDraw location connections\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"playAreaConnections\"\n onValueChanged=\"onClick_toggleOption(playAreaConnections)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: play area connection color --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"This color will be used to draw lines\u0026#xA;for location connections.\"\u003e\n \u003cCell class=\"option-singleColumn\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eChoose color for location connections\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-doubleColumn\"\u003e\n \u003cPanel class=\"doubleColumn-wrapper\"\u003e\n \u003cButton id=\"playAreaConnectionColor\"\n onClick=\"onClick_playAreaConnectionColor\"\u003e\n \u003c/Button\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: change custom playarea image on setup --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Attempts to set the play area to a fitting image\u0026#xA;from the play area image gallery.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eChange background on setup\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"changePlayAreaImage\"\n onValueChanged=\"onClick_toggleOption(changePlayAreaImage)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Group: playermat settings --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_cover\"\u003e\n \u003cText class=\"group-header\"\u003ePLAYERMAT SETTINGS\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: enable snap tags --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Only cards with the tag 'Asset' will snap (official cards are supported by default).\u0026#xA;Disable this if you are having issues with custom content.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eEnable snap tags\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"useSnapTags\"\n onValueChanged=\"onClick_toggleOption(useSnapTags)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show draw 1 button --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Displays a button below the 'Upkeep' button that draws a card from your deck.\u0026#xA;Useful for multi-handed solo play.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eShow \"Draw 1\" button\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showDrawButton\"\n onValueChanged=\"onClick_toggleOption(showDrawButton)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: use clickable clue-counters --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Instead of automatically counting clues in the respective area on your playermat,\u0026#xA;this displays a clickable counter for clues.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eUse clickable clue counters\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"useClueClickers\"\n onValueChanged=\"onClick_toggleOption(useClueClickers)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: use clickable resource counters --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"This enables spawning of clickable resource tokens for player cards.\u0026#xA;(Chef's Selection = assets with 0 uses)\"\u003e\n \u003cCell class=\"option-singleColumn\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eUse clickable resource tokens\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-doubleColumn\"\u003e\n \u003cPanel class=\"doubleColumn-wrapper\"\u003e\n \u003cDropdown id=\"useResourceCounters\"\n onValueChanged=\"resourceCounterSelected(selectedIndex)\"\u003e\n \u003cOption\u003eEnabled\u003c/Option\u003e\n \u003cOption\u003eChef's Selection\u003c/Option\u003e\n \u003cOption\u003eDisabled\u003c/Option\u003e\n \u003c/Dropdown\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: remove a player mat --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Remove an unused playermat for more table space.\u0026#xA;Displayed are the default colors.\"\u003e\n \u003cCell class=\"option-singleColumn\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eRemove a playermat\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-doubleColumn\"\u003e\n \u003cPanel class=\"doubleColumn-wrapper\"\u003e\n \u003cDropdown id=\"removePlayermat\"\n onValueChanged=\"playermatRemovalSelected(selectedIndex)\"\u003e\n \u003cOption\u003eClick to select\u003c/Option\u003e\n \u003cOption\u003e1: White\u003c/Option\u003e\n \u003cOption\u003e2: Orange\u003c/Option\u003e\n \u003cOption\u003e3: Green\u003c/Option\u003e\n \u003cOption\u003e4: Red\u003c/Option\u003e\n \u003c/Dropdown\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Group: fan-made accessories --\u003e\n \u003cRow class=\"group-header\"\u003e\n \u003cCell class=\"group-header\"\u003e\n \u003cPanel class=\"group-header\"\n image=\"header_olive\"\u003e\n \u003cText class=\"group-header\"\u003eFAN-MADE ACCESSORIES\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show attachment helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Provides a card-sized bag for cards that are attached to other cards\u0026#xA;(e.g. Backpack).\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eAttachment Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showAttachmentHelper\"\n onValueChanged=\"onClick_toggleOption(showAttachmentHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show clean up helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Useful for campaign-play:\u0026#xA;It resets play areas to allow continuous gameplay in the same savegame.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eClean Up Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showCleanUpHelper\"\n onValueChanged=\"onClick_toggleOption(showCleanUpHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show CYOA campaign guides --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Displays in a 'Choose Your Own Adventure'\u0026#xA;style redesigned campaign guides.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eCYOA Campaign Guides\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showCYOA\"\n onValueChanged=\"onClick_toggleOption(showCYOA)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show displacement tool --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"This allows moving all objects on the main play area\u0026#xA;in a chosen direction.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eDisplacement Tool\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showDisplacementTool\"\n onValueChanged=\"onClick_toggleOption(showDisplacementTool)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show hand helper --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Never count your hand cards again! This tool does that for you\u0026#xA;and additionally enables easy discarding of random cards.\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eHand Helper\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showHandHelper\"\n onValueChanged=\"onClick_toggleOption(showHandHelper)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Option: show search assistant --\u003e\n \u003cRow class=\"option-text\"\n tooltip=\"Quickly search 3, 6, 9 or the top X\u0026#xA;cards of your deck!\"\u003e\n \u003cCell class=\"option-text\"\u003e\n \u003cPanel class=\"singleColumn-wrapper\"\u003e\n \u003cText class=\"option-header\"\u003eSearch Assistant\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003cCell class=\"option-button\"\u003e\n \u003cToggle id=\"showSearchAssistant\"\n onValueChanged=\"onClick_toggleOption(showSearchAssistant)\"/\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n \u003c/TableLayout\u003e\n \u003c/VerticalScrollView\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: Defaults and Close --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"225\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_defaultSettings\"\u003eLoad defaults\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_toggleUi(optionPanel)\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/OptionPanel.xml --\u003e\n\u003c!-- include Global/UpdateNotification.xml --\u003e\n\u003c!-- Default formatting inherented from OptionPanel! --\u003e\n\n\u003c!-- Icon with Finn, which can be clicked --\u003e\n\u003cImage id=\"FinnIcon\"\n active=\"false\"\n showAnimation=\"SlideIn_Top\"\n hideAnimation=\"SlideOut_Top\"\n animationDuration=\"0.2\"\n rectAlignment=\"UpperLeft\"\n offsetXY=\"420 -5\"\n height=\"90\"\n width=\"90\"\n onClick=\"onClick_toggleUi(updateNotification)\"\n image=\"FinnIcon\"\n tooltip=\"Update notification\"\n tooltipPosition=\"Right\"\n tooltipBackgroundColor=\"rgba(0,0,0,1)\"/\u003e\n\n\u003c!-- main notification window --\u003e\n\u003cTableLayout id=\"updateNotification\"\n active=\"false\"\n color=\"#000000\"\n outlineSize=\"2 2\"\n outline=\"grey\"\n showAnimation=\"SlideIn_Top\"\n hideAnimation=\"SlideOut_Top\"\n animationDuration=\"0.2\"\n rectAlignment=\"UpperLeft\"\n offsetXY=\"60 -5\"\n height=\"225\"\n width=\"350\"\u003e\n\n \u003c!-- Header --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"10 10 0 0\"\u003e\n \u003c!-- this part will be updated via script --\u003e\n \u003cText id=\"notificationHeader\"\n font=\"font_teutonic-arkham\"\n fontSize=\"30\"\n alignment=\"MiddleCenter\"\u003ePlaceholder\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- patch highlights --\u003e\n \u003cRow id=\"highlightRow\"\n preferredHeight=\"100\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"15 15 0 7\"\u003e\n \u003c!-- this part will be updated via script --\u003e\n \u003cText id=\"releaseHighlightText\"\n resizeTextForBestFit=\"true\"\u003ePlaceholder\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- explanation --\u003e\n \u003cRow preferredHeight=\"25\"\u003e\n \u003cCell\u003e\n \u003cPanel padding=\"15 15 0 7\"\u003e\n \u003cText resizeTextForBestFit=\"true\"\u003eVisit the usual place to receive this update.\u003c/Text\u003e\n \u003c/Panel\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\n \u003c!-- Buttons: \"Don't show again\" and \"Close\" --\u003e\n \u003cRow preferredHeight=\"50\"\u003e\n \u003cCell\u003e\n \u003cHorizontalLayout minHeight=\"55\"\n flexibleHeight=\"0\"\n padding=\"10 10 5 10\"\n spacing=\"10\"\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_notification(dontShowAgain)\"\u003eDon't show again\u003c/Button\u003e\n \u003cButton class=\"bottomButtons\"\n onClick=\"onClick_notification(close)\"\u003eClose\u003c/Button\u003e\n \u003c/HorizontalLayout\u003e\n \u003c/Cell\u003e\n \u003c/Row\u003e\n\u003c/TableLayout\u003e\n\u003c!-- include Global/UpdateNotification.xml --\u003e\n\u003c!-- include Global/Global.xml --\u003e" }