From 7659de4c59b2ab5fa152c12cfb9af4f4f9ec9cbf Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Tue, 8 Aug 2023 02:17:43 -0400 Subject: [PATCH 01/13] Updated ChaosBagApi Utilization Changed all existing references to chaos bag functionality to utilize the new ChaosBagApi --- src/accessories/ChaosBagManager.ttslua | 7 +++--- src/accessories/TokenArranger.ttslua | 4 +++- src/chaosbag/BlessCurseManager.ttslua | 18 ++++++++------- src/chaosbag/ChaosBagApi.ttslua | 26 ++++++++++++++++++++++ src/core/VictoryDisplay.ttslua | 3 ++- src/playercards/CardsThatSealTokens.ttslua | 14 +++++++----- src/playermat/Playmat.ttslua | 6 +++-- 7 files changed, 57 insertions(+), 21 deletions(-) diff --git a/src/accessories/ChaosBagManager.ttslua b/src/accessories/ChaosBagManager.ttslua index 96fdced9..2fc700d7 100644 --- a/src/accessories/ChaosBagManager.ttslua +++ b/src/accessories/ChaosBagManager.ttslua @@ -34,6 +34,7 @@ buttonParameters.height = 300 local name local tokens = {} +local chaosBagApi = require("chaosbag/ChaosBagApi") function onLoad() -- create buttons for tokens @@ -60,11 +61,11 @@ function buttonClick(index, isRightClick) local tokenId = TOKEN_IDS[index] if isRightClick then - Global.call("removeChaosToken", tokenId) + chaosBagApi.removeChaosToken(tokenId) else local tokens = {} local name = BUTTON_TOOLTIP[index] - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() for _, v in ipairs(chaosbag.getObjects()) do if v.name == name then table.insert(tokens, v.guid) end @@ -76,7 +77,7 @@ function buttonClick(index, isRightClick) return end - Global.call("spawnChaosToken", tokenId) + chaosBagApi.spawnChaosToken(tokenId) printToAll("Adding " .. name .. " token (in bag: " .. #tokens + 1 .. ")", "White") end end diff --git a/src/accessories/TokenArranger.ttslua b/src/accessories/TokenArranger.ttslua index ab40d7a2..4b1421cb 100644 --- a/src/accessories/TokenArranger.ttslua +++ b/src/accessories/TokenArranger.ttslua @@ -37,6 +37,8 @@ local TOKEN_NAMES = { "" } +local chaosBagApi = require("chaosbag/ChaosBagApi") + -- saving the precedence settings and information on the most recently loaded data function onSave() return JSON.encode({ @@ -287,7 +289,7 @@ function layout(_, _, isRightClick) return end - local chaosBag = Global.call("findChaosBag") + local chaosBag = chaosBagApi.findChaosBag() local data = {} -- clone tokens from chaos bag (default position above trash can) diff --git a/src/chaosbag/BlessCurseManager.ttslua b/src/chaosbag/BlessCurseManager.ttslua index ce9eafc3..696df8a6 100644 --- a/src/chaosbag/BlessCurseManager.ttslua +++ b/src/chaosbag/BlessCurseManager.ttslua @@ -23,6 +23,8 @@ local FONT_COLOR = { local whitespace = " " local updating +local chaosBagApi = require("chaosbag/ChaosBagApi") + --------------------------------------------------------- -- creating buttons and menus + initializing tables --------------------------------------------------------- @@ -79,7 +81,7 @@ function initializeState() resetTables() -- count tokens in the bag - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() local tokens = {} for _, v in ipairs(chaosbag.getObjects()) do if v.name == "Bless" then @@ -117,7 +119,7 @@ end -- context menu function 1 function doRemove(color) - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() -- remove tokens from chaos bag local count = { Bless = 0, Curse = 0 } @@ -224,7 +226,7 @@ end -- function that is called by click_functions 1+2 and calls the other functions function callFunctions(token, isRightClick) - if not Global.call("canTouchChaosTokens") then + if not chaosBagApi.canTouchChaosTokens() then return end local success @@ -286,11 +288,11 @@ function addToken(type) end numInPlay[type] = numInPlay[type] + 1 printToAll("Adding " .. type .. " token " .. formatTokenCount(type)) - return Global.call("spawnChaosToken", type) + return chaosBagApi.spawnChaosToken(type) end function takeToken(type, remove) - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() if not remove and not SEAL_CARD_MESSAGE then broadcastToColor("For sealing tokens on cards try right-clicking on the card for seal options.", playerColor) SEAL_CARD_MESSAGE = true @@ -335,7 +337,7 @@ function returnToken(type) printToColor("Couldn't find token " .. guid .. ", not returning to bag", playerColor) return 0 end - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() if chaosbag == nil then return 0 end @@ -382,7 +384,7 @@ function addMenuOptions(parameters) end function sealToken(type, playerColor, enemy) - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() if chaosbag == nil then return end local pos = enemy.getPosition() @@ -407,7 +409,7 @@ function sealToken(type, playerColor, enemy) end function releaseToken(type, playerColor, enemy) - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() if chaosbag == nil then return end local tokens = sealedTokens[enemy.getGUID()] if tokens == nil or #tokens == 0 then return end diff --git a/src/chaosbag/ChaosBagApi.ttslua b/src/chaosbag/ChaosBagApi.ttslua index e2d0a1ae..11d3669b 100644 --- a/src/chaosbag/ChaosBagApi.ttslua +++ b/src/chaosbag/ChaosBagApi.ttslua @@ -28,5 +28,31 @@ do return Global.call("releaseAllSealedTokens", playerColor) end + -- removes the specified chaos token from the chaos bag + ---@param id String ID of the chaos token + ChaosBagApi.removeChaosToken = function(id) + return Global.call("removeChaosToken", id) + end + + -- spawns the specified chaos token and puts it into the chaos bag + ---@param id String ID of the chaos token + ChaosBagApi.spawnChaosToken = function(id) + return Global.call("spawnChaosToken", id) + end + + -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens + -- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the + -- contents of the bag should check this method before doing so. + -- This method will broadcast a message to all players if the bag is being searched. + ---@return Boolean. True if the bag is manipulated, false if it should be blocked. + ChaosBagApi.canTouchChaosTokens = function() + return Global.call("canTouchChaosTokens") + end + + -- called by playermats (by the "Draw chaos token" button) + ChaosBagApi.drawChaosToken = function(params) + return Global.call("drawChaosToken", params) + end + return ChaosBagApi end \ No newline at end of file diff --git a/src/core/VictoryDisplay.ttslua b/src/core/VictoryDisplay.ttslua index eaaebac8..ebdb9faf 100644 --- a/src/core/VictoryDisplay.ttslua +++ b/src/core/VictoryDisplay.ttslua @@ -8,6 +8,7 @@ local highlightMissing = false local highlightCounted = false local TRASHCAN local TRASHCAN_GUID = "70b9f6" +local chaosBagApi = require("chaosbag/ChaosBagApi") -- button creation when loading the game function onLoad() @@ -276,7 +277,7 @@ function placeCard(card) if obj.tag == "Deck" or obj.tag == "Card" then -- put chaos tokens back into bag elseif tokenChecker.isChaosToken(obj) then - local chaosBag = Global.call("findChaosBag") + local chaosBag = chaosBagApi.findChaosBag() chaosBag.putObject(obj) elseif obj.memo ~= nil and obj.getLock() == false then TRASHCAN.putObject(obj) diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index 03c09c3a..bdcf7093 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -74,6 +74,8 @@ local sealedTokens = {} local ID_URL_MAP = {} local tokensInBag = {} +local chaosBagApi = require("chaosbag/ChaosBagApi") + function onSave() return JSON.encode(sealedTokens) end function onLoad(savedData) @@ -129,7 +131,7 @@ end -- generates a list of chaos tokens that is in the chaos bag function readBag() - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() tokensInBag = {} for _, token in ipairs(chaosbag.getObjects()) do @@ -148,8 +150,8 @@ end -- seals the named token on this card function sealToken(name, playerColor) - if not Global.call("canTouchChaosTokens") then return end - local chaosbag = Global.call("findChaosBag") + if not chaosBagApi.canTouchChaosTokens() then return end + local chaosbag = chaosBagApi.findChaosBag() for i, obj in ipairs(chaosbag.getObjects()) do if obj.name == name then chaosbag.takeObject({ @@ -174,7 +176,7 @@ end -- release the last sealed token function releaseOneToken(playerColor) - if not Global.call("canTouchChaosTokens") then return end + if not chaosBagApi.canTouchChaosTokens() then return end if #sealedTokens == 0 then printToColor("No sealed token(s) found", playerColor) else @@ -197,7 +199,7 @@ end -- releases all sealed tokens function releaseAllTokens(playerColor) - if not Global.call("canTouchChaosTokens") then return end + if not chaosBagApi.canTouchChaosTokens() then return end if #sealedTokens == 0 then printToColor("No sealed token(s) found", playerColor) else @@ -215,7 +217,7 @@ function putTokenAway(guid) if not token then return end local name = token.getName() - local chaosbag = Global.call("findChaosBag") + local chaosbag = chaosBagApi.findChaosBag() chaosbag.putObject(token) tokenArrangerApi.layout() if name == "Bless" or name == "Curse" then diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index 6091dc4b..387db44a 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -56,6 +56,8 @@ local TRASHCAN local STAT_TRACKER local RESOURCE_COUNTER +local chaosBagApi = require("chaosbag/ChaosBagApi") + -- global variable so it can be reset by the Clean Up Helper activeInvestigatorId = "00000" local isDrawButtonVisible = false @@ -210,7 +212,7 @@ function makeDiscardHandlerFor(searchPosition, discardPosition) end -- put chaos tokens back into bag (e.g. Unrelenting) elseif tokenChecker.isChaosToken(obj) then - local chaosBag = Global.call("findChaosBag") + local chaosBag = chaosBagApi.findChaosBag() chaosBag.putObject(obj) -- don't touch the table or this playmat itself elseif obj.guid ~= "4ee1f2" and obj ~= self then @@ -772,7 +774,7 @@ end --------------------------------------------------------- function drawChaosTokenButton(_, _, isRightClick) - Global.call("drawChaosToken", {self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick}) + chaosBagApi.drawChaosToken({self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick}) end function drawEncountercard(_, _, isRightClick) From 79f7861f1e7a41d233c8b1371b0b9bd29fc8654a Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Tue, 8 Aug 2023 12:49:31 -0400 Subject: [PATCH 02/13] More API Updates Added even more utilization of existing APIs, as well as expanding them a bit to cover a couple of more cases. Also, changed the get/setInvestigatorCount methods to live directly in the PlayAreaApi, since there didn't seem to be any reason to keep them in the PlayArea script. --- src/accessories/CleanUpHelper.ttslua | 3 ++- src/chaosbag/ChaosBagApi.ttslua | 6 +++++ src/core/PlayArea.ttslua | 14 ---------- src/core/PlayAreaApi.ttslua | 30 ++++++++++++++++++++-- src/core/PlayAreaSelector.ttslua | 14 +++++----- src/core/token/TokenManager.ttslua | 21 +++++++-------- src/playercards/AllCardsBagApi.ttslua | 8 ++++++ src/playercards/CardsThatSealTokens.ttslua | 5 ++-- 8 files changed, 64 insertions(+), 37 deletions(-) create mode 100644 src/playercards/AllCardsBagApi.ttslua diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index 031c79f6..dacbc73d 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -8,6 +8,7 @@ local soundCubeApi = require("core/SoundCubeApi") local playmatApi = require("playermat/PlaymatApi") local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") local chaosBagApi = require("chaosbag/ChaosBagApi") +local playAreaAPI = require("core/PlayAreaApi") -- these objects will be ignored local IGNORE_GUIDS = { @@ -231,7 +232,7 @@ end -- gets the GUID of a custom data helper (if present) and adds it to the ignore list function ignoreCustomDataHelper() local playArea = getObjectFromGUID("721ba2") - local customDataHelper = playArea.getVar("customDataHelper") + local customDataHelper = playAreaAPI.getCustomDataHelper() if customDataHelper then table.insert(IGNORE_GUIDS, customDataHelper.getGUID()) end end diff --git a/src/chaosbag/ChaosBagApi.ttslua b/src/chaosbag/ChaosBagApi.ttslua index 11d3669b..4a95830f 100644 --- a/src/chaosbag/ChaosBagApi.ttslua +++ b/src/chaosbag/ChaosBagApi.ttslua @@ -54,5 +54,11 @@ do return Global.call("drawChaosToken", params) end + -- returns a Table List of chaos token ids in the current chaos bag + -- requires copying the data into a new table because TTS is weird about handling table return values in Global + ChaosBagApi.getIdUrlMap = function() + return Global.getTable("ID_URL_MAP") + end + return ChaosBagApi end \ No newline at end of file diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 11934eb3..d182b272 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -504,20 +504,6 @@ function shiftContents(playerColor, direction) Wait.time(drawBaseConnections, 0.1) end --- Returns the current value of the investigator counter from the playmat ----@return. Number of investigators currently set on the counter -function getInvestigatorCount() - local investigatorCounter = getObjectFromGUID("f182ee") - return investigatorCounter.getVar("val") -end - --- Updates the current value of the investigator counter from the playmat ----@param count Number of investigators to set on the counter -function setInvestigatorCount(count) - local investigatorCounter = getObjectFromGUID("f182ee") - return investigatorCounter.call("updateVal", count) -end - -- Check to see if the given object is within the bounds of the play area, based solely on the X and -- Z coordinates, ignoring height ---@param object Object Object to check diff --git a/src/core/PlayAreaApi.ttslua b/src/core/PlayAreaApi.ttslua index 3bbc1be4..ed41b501 100644 --- a/src/core/PlayAreaApi.ttslua +++ b/src/core/PlayAreaApi.ttslua @@ -2,17 +2,18 @@ do local PlayAreaApi = { } local PLAY_AREA_GUID = "721ba2" + local INVESTIGATOR_COUNTER_GUID = "f182ee" -- Returns the current value of the investigator counter from the playmat ---@return Integer. Number of investigators currently set on the counter PlayAreaApi.getInvestigatorCount = function() - return getObjectFromGUID(PLAY_AREA_GUID).call("getInvestigatorCount") + return getObjectFromGUID(INVESTIGATOR_COUNTER_GUID).getVar("val") end -- Updates the current value of the investigator counter from the playmat ---@param count Number of investigators to set on the counter PlayAreaApi.setInvestigatorCount = function(count) - return getObjectFromGUID(PLAY_AREA_GUID).call("setInvestigatorCount", count) + return getObjectFromGUID(INVESTIGATOR_COUNTER_GUID).call("updateVal", count) end -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain @@ -83,5 +84,30 @@ do return getObjectFromGUID(PLAY_AREA_GUID).call("isInPlayArea", object) end + -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the + -- data to the local token manager instance. + ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call + PlayAreaApi.updateLocations = function(args) + getObjectFromGUID(PLAY_AREA_GUID).call("updateLocations", args) + end + + PlayAreaApi.getCustomDataHelper = function() + return getObjectFromGUID(PLAY_AREA_GUID).getVar("customDataHelper") + end + + PlayAreaApi.getCustomObject = function() + return getObjectFromGUID(PLAY_AREA_GUID).getCustomObject() + end + + PlayAreaApi.setCustomObject = function(customInfo) + return getObjectFromGUID(PLAY_AREA_GUID).setCustomObject(customInfo) + end + + PlayAreaApi.reload = function() + return getObjectFromGUID(PLAY_AREA_GUID).reload() + end + + + return PlayAreaApi end diff --git a/src/core/PlayAreaSelector.ttslua b/src/core/PlayAreaSelector.ttslua index 0029c4fb..ac1a7dcb 100644 --- a/src/core/PlayAreaSelector.ttslua +++ b/src/core/PlayAreaSelector.ttslua @@ -1,5 +1,6 @@ local controlActive = false local DEFAULT_URL = "http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/" +local playAreaAPI = require("core/PlayAreaApi") -- parameters for open/close button for reusing local buttonParameters = {} @@ -70,8 +71,7 @@ function none() end -- main function (can be called by other objects) function updateSurface(newURL) - local playArea = getObjectFromGUID("721ba2") - local customInfo = playArea.getCustomObject() + local customInfo = playAreaAPI.getCustomObject() if newURL ~= "" and newURL ~= nil and newURL ~= DEFAULT_URL then customInfo.image = newURL @@ -80,18 +80,18 @@ function updateSurface(newURL) customInfo.image = DEFAULT_URL broadcastToAll("Default Playmat Image Applied", { 0.2, 0.9, 0.2 }) end - - playArea.setCustomObject(customInfo) + + playAreaAPI.setCustomObject(customInfo) -- get custom data helper and call the playarea with it after reloading - local customDataHelper = playArea.getVar("customDataHelper") + local customDataHelper = playAreaAPI.getCustomDataHelper() local guid if customDataHelper then guid = customDataHelper.getGUID() end - playArea = playArea.reload() + playAreaAPI.reload() if guid ~= nil then - Wait.time(function() playArea.call("updateLocations", { guid }) end, 1) + Wait.time(function() playAreaAPI.updateLocations({ guid }) end, 1) end end diff --git a/src/core/token/TokenManager.ttslua b/src/core/token/TokenManager.ttslua index 235e8c58..7a8a2442 100644 --- a/src/core/token/TokenManager.ttslua +++ b/src/core/token/TokenManager.ttslua @@ -1,6 +1,7 @@ do - local tokenSpawnTracker = require("core/token/TokenSpawnTrackerApi") - local playArea = require("core/PlayAreaApi") + local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") + local playAreaApi = require("core/PlayAreaApi") + local optionPanelApi = require("core/OptionPanelApi") local PLAYER_CARD_TOKEN_OFFSETS = { [1] = { @@ -141,7 +142,7 @@ do ---@param extraUses Table A table of = which will modify the number of tokens --- spawned for that type. e.g. Akachi's playmat should pass "Charge"=1 TokenManager.spawnForCard = function(card, extraUses) - if tokenSpawnTracker.hasSpawnedTokens(card.getGUID()) then + if tokenSpawnTrackerApi.hasSpawnedTokens(card.getGUID()) then return end local metadata = JSON.decode(card.getGMNotes()) @@ -161,7 +162,7 @@ do ---@param shiftDown Number An offset for the z-value of this group of tokens ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens TokenManager.spawnTokenGroup = function(card, tokenType, tokenCount, shiftDown, subType) - local optionPanel = Global.getTable("optionPanel") + local optionPanel = optionPanelApi.getOptions() if tokenType == "damage" or tokenType == "horror" then TokenManager.spawnCounterToken(card, tokenType, tokenCount, shiftDown) @@ -303,7 +304,7 @@ do -- callers. ---@param card Object Card object to reset the tokens for TokenManager.resetTokensSpawned = function(card) - tokenSpawnTracker.resetTokensSpawned(card.getGUID()) + tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID()) end -- Pushes new player card data into the local copy of the Data Helper player data. @@ -369,14 +370,14 @@ do type = useInfo.type token = useInfo.token tokenCount = (useInfo.count or 0) - + (useInfo.countPerInvestigator or 0) * playArea.getInvestigatorCount() + + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount() if extraUses ~= nil and extraUses[type] ~= nil then tokenCount = tokenCount + extraUses[type] end -- Shift each spawned group after the first down so they don't pile on each other TokenManager.spawnTokenGroup(card, token, tokenCount, (i - 1) * 0.8, type) end - tokenSpawnTracker.markTokensSpawned(card.getGUID()) + tokenSpawnTrackerApi.markTokensSpawned(card.getGUID()) end -- Spawn tokens for a card based on the data helper data. This will consider the face up/down state @@ -403,7 +404,7 @@ do tokenCount = playerData.tokenCount --log("Spawning data helper tokens for "..card.getName()..'['..card.getDescription()..']: '..tokenCount.."x "..token) TokenManager.spawnTokenGroup(card, token, tokenCount) - tokenSpawnTracker.markTokensSpawned(card.getGUID()) + tokenSpawnTrackerApi.markTokensSpawned(card.getGUID()) end -- Spawn tokens for a location using data retrieved from the Data Helper. @@ -414,7 +415,7 @@ do local clueCount = internal.getClueCountFromData(card, locationData) if clueCount > 0 then TokenManager.spawnTokenGroup(card, "clue", clueCount) - tokenSpawnTracker.markTokensSpawned(card.getGUID()) + tokenSpawnTrackerApi.markTokensSpawned(card.getGUID()) end end @@ -440,7 +441,7 @@ do if locationData.type == 'fixed' then return locationData.value elseif locationData.type == 'perPlayer' then - return locationData.value * playArea.getInvestigatorCount() + return locationData.value * playAreaApi.getInvestigatorCount() end error('unexpected location type: ' .. locationData.type) end diff --git a/src/playercards/AllCardsBagApi.ttslua b/src/playercards/AllCardsBagApi.ttslua new file mode 100644 index 00000000..521b9705 --- /dev/null +++ b/src/playercards/AllCardsBagApi.ttslua @@ -0,0 +1,8 @@ +do + local AllCardsBagApi = {} + local ALL_CARDS_BAG_GUID = "15bb07" + + + + return AllCardsBagApi +end \ No newline at end of file diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index bdcf7093..bc18d9d6 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -70,17 +70,16 @@ Thus it should be implemented like this: local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") local tokenArrangerApi = require("accessories/TokenArrangerApi") +local chaosBagApi = require("chaosbag/ChaosBagApi") local sealedTokens = {} local ID_URL_MAP = {} local tokensInBag = {} -local chaosBagApi = require("chaosbag/ChaosBagApi") - function onSave() return JSON.encode(sealedTokens) end function onLoad(savedData) sealedTokens = JSON.decode(savedData) or {} - ID_URL_MAP = Global.getTable("ID_URL_MAP") + ID_URL_MAP = chaosBagApi.getIdUrlMap() generateContextMenu() self.addTag("CardThatSeals") end From 1213771ef93d0728f53d176c86b80fe624ea6298 Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Tue, 8 Aug 2023 16:32:58 -0400 Subject: [PATCH 03/13] Fixed Take Clue GameKey with Clickable Clues --- src/core/GameKeyHandler.ttslua | 17 +++++++++++------ src/playermat/PlaymatApi.ttslua | 4 ++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index f43ddbea..58452e60 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -1,6 +1,7 @@ local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") local playmatApi = require("playermat/PlaymatApi") local victoryDisplayApi = require("core/VictoryDisplayApi") +local optionPanelApi = require("core/OptionPanelApi") function onLoad() addHotkey("Add Doom to Agenda", addDoomToAgenda) @@ -98,14 +99,18 @@ function takeClueFromLocation(playerColor, hoveredObject) return end + local clickableClues = optionPanelApi.getOptions()["useClueClickers"] local playerName = Player[playerColor].steam_name - local matColor = playmatApi.getMatColor(playerColor) - local pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor) - local rot = playmatApi.returnRotation(matColor) - - if cardName == "" or cardName == nil then - cardName = "nameless card" + local matColor = playmatApi.getMatColor(playerColor) + local pos = nil + if clickableClues then + pos = {x = 0.49, y = 2.66, z = 0.00} + playmatApi.updateClueClicker(playerColor, playmatApi.getClueCount(clickableClues, playerColor) + 1) + else + pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor) end + + local rot = playmatApi.returnRotation(matColor) -- check if found clue is a stack or single token if clue.getQuantity() > 1 then diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 39c51f86..84a1ffd0 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -191,6 +191,10 @@ do end end + PlaymatApi.updateClueClicker = function(playerColor, val) + return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val) + end + -- Convenience function to look up a mat's object by color, or get all mats. ---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also -- accepts "All" as a special value which will return all four mats. From da060703119fb338924f0eb8654cc23053c4d384 Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Wed, 9 Aug 2023 12:37:45 -0400 Subject: [PATCH 04/13] Implemented AllCardsBagApi Caught all (hopefully) references to the AllCardsBag and refactored to utilize the new AllCardsBagApi. --- src/accessories/CleanUpHelper.ttslua | 5 +- src/arkhamdb/ArkhamDb.ttslua | 18 +++---- src/arkhamdb/DeckImporterMain.ttslua | 9 ++-- src/arkhamdb/DeckImporterUi.ttslua | 5 +- src/arkhamdb/HotfixBag.ttslua | 6 ++- src/playercards/AllCardsBagApi.ttslua | 66 +++++++++++++++++++++++++- src/playercards/CardSearch.ttslua | 11 ++--- src/playercards/PlayerCardPanel.ttslua | 25 ++++------ src/playercards/SpawnBag.ttslua | 5 +- 9 files changed, 101 insertions(+), 49 deletions(-) diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index dacbc73d..b621febe 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -8,7 +8,7 @@ local soundCubeApi = require("core/SoundCubeApi") local playmatApi = require("playermat/PlaymatApi") local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") local chaosBagApi = require("chaosbag/ChaosBagApi") -local playAreaAPI = require("core/PlayAreaApi") +local playAreaApi = require("core/PlayAreaApi") -- these objects will be ignored local IGNORE_GUIDS = { @@ -231,8 +231,7 @@ end -- gets the GUID of a custom data helper (if present) and adds it to the ignore list function ignoreCustomDataHelper() - local playArea = getObjectFromGUID("721ba2") - local customDataHelper = playAreaAPI.getCustomDataHelper() + local customDataHelper = playAreaApi.getCustomDataHelper() if customDataHelper then table.insert(IGNORE_GUIDS, customDataHelper.getGUID()) end end diff --git a/src/arkhamdb/ArkhamDb.ttslua b/src/arkhamdb/ArkhamDb.ttslua index 74392dea..6f1957af 100644 --- a/src/arkhamdb/ArkhamDb.ttslua +++ b/src/arkhamdb/ArkhamDb.ttslua @@ -1,5 +1,6 @@ do local playAreaApi = require("core/PlayAreaApi") + local allCardsBagApi = require("playercards/AllCardsBagApi") local ArkhamDb = { } local internal = { } @@ -56,8 +57,7 @@ do callback) -- Get a simple card to see if the bag indexes are complete. If not, abort -- the deck load. The called method will handle player notification. - local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) - local checkCard = allCardsBag.call("getCardById", { id = "01001" }) + local checkCard = allCardsBagApi.getCardById({ id = "01001" }) if (checkCard ~= nil and checkCard.data == nil) then return end @@ -166,7 +166,6 @@ do ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast --- if a weakness is added. internal.maybeDrawRandomWeakness = function(slots, playerColor) - local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) local hasRandomWeakness = false for cardId, cardCount in pairs(slots) do if cardId == RANDOM_WEAKNESS_ID then @@ -175,7 +174,7 @@ do end end if hasRandomWeakness then - local weaknessId = allCardsBag.call("getRandomWeaknessId") + local weaknessId = allCardsBagApi.getRandomWeaknessId() slots[weaknessId] = 1 slots[RANDOM_WEAKNESS_ID] = nil internal.maybePrint("Random basic weakness added to deck", playerColor) @@ -240,10 +239,9 @@ do ---@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 internal.maybeAddCustomizeUpgradeSheets = function(slots) - local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) for cardId, _ in pairs(slots) do -- upgrade sheets for customizable cards - local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" }) + local upgradesheet = allCardsBagApi.getCardById({ id = cardId .. "-c" }) if upgradesheet ~= nil then slots[cardId .. "-c"] = 1 end @@ -280,12 +278,11 @@ do -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list. ---@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 internal.extractBondedCards = function(slots) - local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) -- Create a list of bonded cards first so we don't modify slots while iterating local bondedCards = { } local bondedList = { } for cardId, cardCount in pairs(slots) do - local card = allCardsBag.call("getCardById", { id = cardId }) + local card = allCardsBagApi.getCardById({ id = cardId }) if (card ~= nil and card.metadata.bonded ~= nil) then for _, bond in ipairs(card.metadata.bonded) do bondedCards[bond.id] = bond.count @@ -309,15 +306,14 @@ do ---@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 internal.checkTaboos = function(tabooId, slots, playerColor) if tabooId then - local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) for cardId, _ in pairs(tabooList[tabooId].cards) do if slots[cardId] ~= nil then -- Make sure there's a taboo version of the card before we replace it -- SCED only maintains the most recent taboo cards. If a deck is using -- an older taboo list it's possible the card isn't a taboo any more - local tabooCard = allCardsBag.call("getCardById", { id = cardId .. "-t" }) + local tabooCard = allCardsBagApi.getCardById({ id = cardId .. "-t" }) if tabooCard == nil then - local basicCard = allCardsBag.call("getCardById", { id = cardId }) + local basicCard = allCardsBagApi.getCardById({ id = cardId }) internal.maybePrint("Taboo version for " .. basicCard.data.Nickname .. " is not available. Using standard version", playerColor) else slots[cardId .. "-t"] = slots[cardId] diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index 1d69787c..3bd4f069 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -3,11 +3,10 @@ require("playercards/PlayerCardSpawner") local playmatApi = require("playermat/PlaymatApi") local playAreaApi = require("core/PlayAreaApi") +local allCardsBagApi = require("playercards/AllCardsBagApi") local arkhamDb = require("arkhamdb/ArkhamDb") local zones = require("playermat/Zones") -local ALL_CARDS_GUID = "15bb07" - function onLoad(script_state) initializeUi(JSON.decode(script_state)) math.randomseed(os.time()) @@ -72,11 +71,10 @@ end ---@param loadAltInvestigator String Contains the name of alternative art for the investigator ("normal", "revised" or "promo") function loadCards(slots, investigatorId, bondedList, customizations, playerColor, loadAltInvestigator) function coinside() - local allCardsBag = getObjectFromGUID(ALL_CARDS_GUID) local yPos = {} local cardsToSpawn = {} for cardId, cardCount in pairs(slots) do - local card = allCardsBag.call("getCardById", { id = cardId }) + local card = allCardsBagApi.getCardById({ id = cardId }) if card ~= nil then local cardZone = getDefaultCardZone(card.metadata, bondedList) for i = 1, cardCount do @@ -185,8 +183,7 @@ end -- Returns the simple name of a card given its ID. This will find the card and strip any trailing -- SCED-specific suffixes such as (Taboo) or (Level) function getCardName(cardId) - local allCardsBag = getObjectFromGUID(ALL_CARDS_GUID) - local card = allCardsBag.call("getCardById", { id = cardId }) + local card = allCardsBagApi.getCardById({ id = cardId }) if (card ~= nil) then local name = card.data.Nickname if (string.find(name, " %(")) then diff --git a/src/arkhamdb/DeckImporterUi.ttslua b/src/arkhamdb/DeckImporterUi.ttslua index e227588b..4c9b8f08 100644 --- a/src/arkhamdb/DeckImporterUi.ttslua +++ b/src/arkhamdb/DeckImporterUi.ttslua @@ -23,6 +23,8 @@ local privateDeck = true local loadNewestDeck = true local loadInvestigators = false +local allCardsBagApi = require("playercards/AllCardsBagApi") + -- Returns a table with the full state of the UI, including options and deck IDs. -- This can be used to persist via onSave(), or provide values for a load operation -- Table values: @@ -218,8 +220,7 @@ function loadDecks() -- Method in DeckImporterMain, visible due to inclusion -- TODO: Make this use the configuration ID for the all cards bag - local allCardsBag = getObjectFromGUID("15bb07") - local indexReady = allCardsBag.call("isIndexReady") + local indexReady = allCardsBagApi.isIndexReady() if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return diff --git a/src/arkhamdb/HotfixBag.ttslua b/src/arkhamdb/HotfixBag.ttslua index 6d6c53bd..cbbb9088 100644 --- a/src/arkhamdb/HotfixBag.ttslua +++ b/src/arkhamdb/HotfixBag.ttslua @@ -6,7 +6,9 @@ -- Tells the All Cards Bag to recreate its indexes. The All Cards Bag may -- ignore this request; see the rebuildIndexForHotfix() method in the All Cards -- Bag for details. + +local allCardsBagApi = require("playercards/AllCardsBagApi") + function onLoad() - local allCardsBag = getObjectFromGUID("15bb07") - allCardsBag.call("rebuildIndexForHotfix") + allCardsBagApi.rebuildIndexForHotfix() end diff --git a/src/playercards/AllCardsBagApi.ttslua b/src/playercards/AllCardsBagApi.ttslua index 521b9705..8cfa95b0 100644 --- a/src/playercards/AllCardsBagApi.ttslua +++ b/src/playercards/AllCardsBagApi.ttslua @@ -2,7 +2,71 @@ do local AllCardsBagApi = {} local ALL_CARDS_BAG_GUID = "15bb07" - + -- Returns a specific card from the bag, based on ArkhamDB ID + -- @param table: + -- id: String ID of the card to retrieve + -- @return: If the indexes are still being constructed, an empty table is + -- returned. Otherwise, a single table with the following fields + -- cardData: TTS object data, suitable for spawning the card + -- cardMetadata: Table of parsed metadata + AllCardsBagApi.getCardById = function(params) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardById", params) + end + + -- Gets a random basic weakness from the bag. Once a given ID has been returned + -- it will be removed from the list and cannot be selected again until a reload + -- occurs or the indexes are rebuilt, which will refresh the list to include all + -- weaknesses. + -- @return: String ID of the selected weakness. + AllCardsBagApi.getRandomWeaknessId = function() + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getRandomWeaknessId") + end + + AllCardsBagApi.isIndexReady = function() + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("isIndexReady") + end + + -- Called by Hotfix bags when they load. If we are still loading indexes, then + -- the all cards and hotfix bags are being loaded together, and we can ignore + -- this call as the hotfix will be included in the initial indexing. If it is + -- called once indexing is complete it means the hotfix bag has been added + -- later, and we should rebuild the index to integrate the hotfix bag. + AllCardsBagApi.rebuildIndexForHotfix = function() + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("rebuildIndexForHotfix") + end + + -- Searches the bag for cards which match the given name and returns a list. Note that this is + -- an O(n) search without index support. It may be slow. + -- @param array must contain these fields to define the search: + -- name String or string fragment to search for names + -- exact Whether the name match should be exact + AllCardsBagApi.getCardsByName = function(params) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByName", params) + end + + AllCardsBagApi.isBagPresent = function() + return getObjectFromGUID(ALL_CARDS_BAG_GUID) and true + end + + -- Returns a list of cards from the bag matching a class and level (0 or upgraded) + -- @param table: + -- class: String class to retrieve ("Guardian", "Seeker", etc) + -- isUpgraded: true for upgraded cards (Level 1-5), false for Level 0 + -- @return: If the indexes are still being constructed, returns an empty table. + -- Otherwise, a list of tables, each with the following fields + -- cardData: TTS object data, suitable for spawning the card + -- cardMetadata: Table of parsed metadata + AllCardsBagApi.getCardsByClassAndLevel = function(params) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByClassAndLevel", params) + end + + AllCardsBagApi.getCardsByCycle = function(cycle) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByCycle", cycle) + end + + AllCardsBagApi.getUniqueWeaknesses = function() + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getUniqueWeaknesses") + end return AllCardsBagApi end \ No newline at end of file diff --git a/src/playercards/CardSearch.ttslua b/src/playercards/CardSearch.ttslua index 9c179f1d..43ce8d0c 100644 --- a/src/playercards/CardSearch.ttslua +++ b/src/playercards/CardSearch.ttslua @@ -8,6 +8,8 @@ information = { require("playercards/PlayerCardSpawner") +local allCardsBagApi = require("playercards/AllCardsBagApi") + local buttonParameters = {} buttonParameters.function_owner = self buttonParameters.height = 200 @@ -32,8 +34,6 @@ inputParameters.width = 1200 inputParameters.height = 130 inputParameters.font_size = 107 -local ALL_CARDS_GUID = "15bb07" - -- main code function onSave() return JSON.encode({ spawnAll, searchExact, inputParameters.value }) end @@ -101,15 +101,14 @@ function search() printToAll("Please enter a longer search string.", "Yellow") return end - - local allCardsBag = getObjectFromGUID(ALL_CARDS_GUID) - if allCardsBag == nil then + + if not allCardsBagApi.isBagPresent() then printToAll("Player card bag couldn't be found.", "Red") return end -- search all objects in bag - local cardList = allCardsBag.call("getCardsByName", { name = inputParameters.value, exact = searchExact }) + local cardList = allCardsBagApi.getCardsByName({ name = inputParameters.value, exact = searchExact }) if cardList == nil or #cardList == 0 then printToAll("No match found.", "Red") return diff --git a/src/playercards/PlayerCardPanel.ttslua b/src/playercards/PlayerCardPanel.ttslua index 90e58924..5d0f55d8 100644 --- a/src/playercards/PlayerCardPanel.ttslua +++ b/src/playercards/PlayerCardPanel.ttslua @@ -1,6 +1,7 @@ require("playercards/PlayerCardPanelData") local spawnBag = require("playercards/SpawnBag") local arkhamDb = require("arkhamdb/ArkhamDb") +local allCardsBagApi = require("playercards/AllCardsBagApi") -- Size and position information for the three rows of class buttons local CIRCLE_BUTTON_SIZE = 250 @@ -21,8 +22,6 @@ local CYCLE_COLUMN_COUNT = 3 local CYCLE_BUTTONS_X_OFFSET = 0.267 local CYCLE_BUTTONS_Z_OFFSET = 0.2665 -local ALL_CARDS_BAG_GUID = "15bb07" - local STARTER_DECK_MODE_SELECTED_COLOR = { 0.2, 0.2, 0.2, 0.8 } local TRANSPARENT = { 0, 0, 0, 0 } local STARTER_DECK_MODE_STARTERS = "starters" @@ -579,19 +578,18 @@ end ---@param cardClass String. Class to place ("Guardian", "Seeker", etc) ---@param isUpgraded Boolean. If true, spawn the Level 1-5 cards. Otherwise, Level 0. function placeClassCards(cardClass, isUpgraded) - local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) - local indexReady = allCardsBag.call("isIndexReady") + local indexReady = allCardsBagApi.isIndexReady() if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return end - local cardIdList = allCardsBag.call("getCardsByClassAndLevel", {class = cardClass, upgraded = isUpgraded}) + local cardIdList = allCardsBagApi.getCardsByClassAndLevel({class = cardClass, upgraded = isUpgraded}) local skillList = { } local eventList = { } local assetList = { } for _, cardId in ipairs(cardIdList) do - local cardMetadata = allCardsBag.call("getCardById", { id = cardId }).metadata + local cardMetadata = allCardsBagApi.getCardById({ id = cardId }).metadata if (cardMetadata.type == "Skill") then table.insert(skillList, cardId) elseif (cardMetadata.type == "Event") then @@ -640,13 +638,12 @@ end function spawnCycle(cycle) prepareToPlaceCards() spawnInvestigators(cycle) - local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) - local indexReady = allCardsBag.call("isIndexReady") + local indexReady = allCardsBagApi.isIndexReady() if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return end - local cycleCardList = allCardsBag.call("getCardsByCycle", cycle) + local cycleCardList = allCardsBagApi.getCardsByCycle(cycle) local copiedList = { } for i, id in ipairs(cycleCardList) do copiedList[i] = id @@ -694,17 +691,16 @@ end -- Clears the current cards, and places all basic weaknesses on the table. function spawnWeaknesses() prepareToPlaceCards() - local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) - local indexReady = allCardsBag.call("isIndexReady") + local indexReady = allCardsBagApi.isIndexReady() if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return end - local weaknessIdList = allCardsBag.call("getUniqueWeaknesses") + local weaknessIdList = allCardsBagApi.getUniqueWeaknesses() local basicWeaknessList = { } local otherWeaknessList = { } for i, id in ipairs(weaknessIdList) do - local cardMetadata = allCardsBag.call("getCardById", { id = id }).metadata + local cardMetadata = allCardsBagApi.getCardById({ id = id }).metadata if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount > 0 then table.insert(basicWeaknessList, id) elseif excludedNonBasicWeaknesses[id] == nil then @@ -742,8 +738,7 @@ end function spawnRandomWeakness() prepareToPlaceCards() - local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) - local weaknessId = allCardsBag.call("getRandomWeaknessId") + local weaknessId = allCardsBagApi.getRandomWeaknessId() if (weaknessId == nil) then broadcastToAll("All basic weaknesses are in play!", {0.9, 0.2, 0.2}) return diff --git a/src/playercards/SpawnBag.ttslua b/src/playercards/SpawnBag.ttslua index d6cf00c6..1042c037 100644 --- a/src/playercards/SpawnBag.ttslua +++ b/src/playercards/SpawnBag.ttslua @@ -29,7 +29,7 @@ do -- To assist debugging, will draw a box around the recall zone when it's set up local SHOW_RECALL_ZONE = false - local ALL_CARDS_GUID = "15bb07" + local allCardsBagApi = require("playercards/AllCardsBagApi") -- Distance to expand the recall zone around any added object. local RECALL_BUFFER_X = 0.9 @@ -90,10 +90,9 @@ do return end local cardsToSpawn = { } - local allCardsBag = getObjectFromGUID(ALL_CARDS_GUID) local cardList = spawnSpec.cards for _, cardId in ipairs(cardList) do - local cardData = allCardsBag.call("getCardById", { id = cardId }) + local cardData = allCardsBagApi.getCardById({ id = cardId }) if (cardData ~= nil) then table.insert(cardsToSpawn, cardData) else From b8bcd04b0f5155923731f04d5b759f001cd16dce Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Thu, 24 Aug 2023 20:04:14 -0400 Subject: [PATCH 05/13] Addressed PR Suggestions --- src/arkhamdb/ArkhamDb.ttslua | 10 ++++---- src/arkhamdb/DeckImporterMain.ttslua | 4 ++-- src/arkhamdb/DeckImporterUi.ttslua | 1 - src/chaosbag/ChaosBagApi.ttslua | 4 ++-- src/core/PlayArea.ttslua | 25 +++++++++++++++++++ src/core/PlayAreaApi.ttslua | 16 +------------ src/core/PlayAreaSelector.ttslua | 33 ++++---------------------- src/playercards/AllCardsBagApi.ttslua | 18 +++++++------- src/playercards/CardSearch.ttslua | 2 +- src/playercards/PlayerCardPanel.ttslua | 6 ++--- src/playercards/SpawnBag.ttslua | 2 +- src/playermat/Playmat.ttslua | 2 +- 12 files changed, 55 insertions(+), 68 deletions(-) diff --git a/src/arkhamdb/ArkhamDb.ttslua b/src/arkhamdb/ArkhamDb.ttslua index 6f1957af..286f58f1 100644 --- a/src/arkhamdb/ArkhamDb.ttslua +++ b/src/arkhamdb/ArkhamDb.ttslua @@ -57,7 +57,7 @@ do callback) -- Get a simple card to see if the bag indexes are complete. If not, abort -- the deck load. The called method will handle player notification. - local checkCard = allCardsBagApi.getCardById({ id = "01001" }) + local checkCard = allCardsBagApi.getCardById("01001") if (checkCard ~= nil and checkCard.data == nil) then return end @@ -241,7 +241,7 @@ do internal.maybeAddCustomizeUpgradeSheets = function(slots) for cardId, _ in pairs(slots) do -- upgrade sheets for customizable cards - local upgradesheet = allCardsBagApi.getCardById({ id = cardId .. "-c" }) + local upgradesheet = allCardsBagApi.getCardById(cardId .. "-c") if upgradesheet ~= nil then slots[cardId .. "-c"] = 1 end @@ -282,7 +282,7 @@ do local bondedCards = { } local bondedList = { } for cardId, cardCount in pairs(slots) do - local card = allCardsBagApi.getCardById({ id = cardId }) + local card = allCardsBagApi.getCardById(cardId) if (card ~= nil and card.metadata.bonded ~= nil) then for _, bond in ipairs(card.metadata.bonded) do bondedCards[bond.id] = bond.count @@ -311,9 +311,9 @@ do -- Make sure there's a taboo version of the card before we replace it -- SCED only maintains the most recent taboo cards. If a deck is using -- an older taboo list it's possible the card isn't a taboo any more - local tabooCard = allCardsBagApi.getCardById({ id = cardId .. "-t" }) + local tabooCard = allCardsBagApi.getCardById(cardId .. "-t") if tabooCard == nil then - local basicCard = allCardsBagApi.getCardById({ id = cardId }) + local basicCard = allCardsBagApi.getCardById(cardId) internal.maybePrint("Taboo version for " .. basicCard.data.Nickname .. " is not available. Using standard version", playerColor) else slots[cardId .. "-t"] = slots[cardId] diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index 3bd4f069..8c0cfb2f 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -74,7 +74,7 @@ function loadCards(slots, investigatorId, bondedList, customizations, playerColo local yPos = {} local cardsToSpawn = {} for cardId, cardCount in pairs(slots) do - local card = allCardsBagApi.getCardById({ id = cardId }) + local card = allCardsBagApi.getCardById(cardId) if card ~= nil then local cardZone = getDefaultCardZone(card.metadata, bondedList) for i = 1, cardCount do @@ -183,7 +183,7 @@ end -- Returns the simple name of a card given its ID. This will find the card and strip any trailing -- SCED-specific suffixes such as (Taboo) or (Level) function getCardName(cardId) - local card = allCardsBagApi.getCardById({ id = cardId }) + local card = allCardsBagApi.getCardById(cardId) if (card ~= nil) then local name = card.data.Nickname if (string.find(name, " %(")) then diff --git a/src/arkhamdb/DeckImporterUi.ttslua b/src/arkhamdb/DeckImporterUi.ttslua index 4c9b8f08..59ad1ac8 100644 --- a/src/arkhamdb/DeckImporterUi.ttslua +++ b/src/arkhamdb/DeckImporterUi.ttslua @@ -219,7 +219,6 @@ function loadDecks() -- testLoadLotsOfDecks() -- Method in DeckImporterMain, visible due to inclusion - -- TODO: Make this use the configuration ID for the all cards bag local indexReady = allCardsBagApi.isIndexReady() if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) diff --git a/src/chaosbag/ChaosBagApi.ttslua b/src/chaosbag/ChaosBagApi.ttslua index 4a95830f..e0252266 100644 --- a/src/chaosbag/ChaosBagApi.ttslua +++ b/src/chaosbag/ChaosBagApi.ttslua @@ -50,8 +50,8 @@ do end -- called by playermats (by the "Draw chaos token" button) - ChaosBagApi.drawChaosToken = function(params) - return Global.call("drawChaosToken", params) + ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick) + return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick}) end -- returns a Table List of chaos token ids in the current chaos bag diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index d182b272..54e09d5a 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -28,6 +28,8 @@ local collisionEnabled = false -- used for recreating the link to a custom data helper after image change customDataHelper = nil +local DEFAULT_URL = "http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/" + local SHIFT_OFFSETS = { left = { x = 0.00, y = 0, z = 7.67 }, right = { x = 0.00, y = 0, z = -7.67 }, @@ -94,6 +96,29 @@ function updateLocations(args) end end +function updateSurface(newURL) + local customInfo = self.getCustomObject() + + if newURL ~= "" and newURL ~= nil and newURL ~= DEFAULT_URL then + customInfo.image = newURL + broadcastToAll("New Playmat Image Applied", { 0.2, 0.9, 0.2 }) + else + customInfo.image = DEFAULT_URL + broadcastToAll("Default Playmat Image Applied", { 0.2, 0.9, 0.2 }) + end + + self.setCustomObject(customInfo) + + local guid = nil + + if customDataHelper then guid = customDataHelper.getGUID() end + self.reload() + + if guid ~= nil then + Wait.time(function() updateLocations({ guid }) end, 1) + end +end + function onCollisionEnter(collisionInfo) local obj = collisionInfo.collision_object local objType = obj.name diff --git a/src/core/PlayAreaApi.ttslua b/src/core/PlayAreaApi.ttslua index d262aa17..66784904 100644 --- a/src/core/PlayAreaApi.ttslua +++ b/src/core/PlayAreaApi.ttslua @@ -4,8 +4,6 @@ do local PLAY_AREA_GUID = "721ba2" local INVESTIGATOR_COUNTER_GUID = "f182ee" - local IMAGE_SWAPPER = "b7b45b" - -- Returns the current value of the investigator counter from the playmat ---@return Integer. Number of investigators currently set on the counter PlayAreaApi.getInvestigatorCount = function() @@ -91,7 +89,7 @@ do end PlayAreaApi.updateSurface = function(url) - return getObjectFromGUID(IMAGE_SWAPPER).call("updateSurface", url) + return getObjectFromGUID(PLAY_AREA_GUID).call("updateSurface", url) end -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the @@ -105,17 +103,5 @@ do return getObjectFromGUID(PLAY_AREA_GUID).getVar("customDataHelper") end - PlayAreaApi.getCustomObject = function() - return getObjectFromGUID(PLAY_AREA_GUID).getCustomObject() - end - - PlayAreaApi.setCustomObject = function(customInfo) - return getObjectFromGUID(PLAY_AREA_GUID).setCustomObject(customInfo) - end - - PlayAreaApi.reload = function() - return getObjectFromGUID(PLAY_AREA_GUID).reload() - end - return PlayAreaApi end diff --git a/src/core/PlayAreaSelector.ttslua b/src/core/PlayAreaSelector.ttslua index ac1a7dcb..e5958102 100644 --- a/src/core/PlayAreaSelector.ttslua +++ b/src/core/PlayAreaSelector.ttslua @@ -1,5 +1,4 @@ local controlActive = false -local DEFAULT_URL = "http://cloud-3.steamusercontent.com/ugc/998015670465071049/FFAE162920D67CF38045EFBD3B85AD0F916147B2/" local playAreaAPI = require("core/PlayAreaApi") -- parameters for open/close button for reusing @@ -63,38 +62,16 @@ end -- click function for apply button function click_applySurface(_, _, isRightClick) - updateSurface(isRightClick and "" or self.getInputs()[1].value) + playAreaAPI.updateSurface(isRightClick and "" or self.getInputs()[1].value) +end + +function updateSurface(newURL) + playAreaAPI.updateSurface(newURL) end -- input function for the input box function none() end --- main function (can be called by other objects) -function updateSurface(newURL) - local customInfo = playAreaAPI.getCustomObject() - - if newURL ~= "" and newURL ~= nil and newURL ~= DEFAULT_URL then - customInfo.image = newURL - broadcastToAll("New Playmat Image Applied", { 0.2, 0.9, 0.2 }) - else - customInfo.image = DEFAULT_URL - broadcastToAll("Default Playmat Image Applied", { 0.2, 0.9, 0.2 }) - end - - playAreaAPI.setCustomObject(customInfo) - - -- get custom data helper and call the playarea with it after reloading - local customDataHelper = playAreaAPI.getCustomDataHelper() - local guid - - if customDataHelper then guid = customDataHelper.getGUID() end - playAreaAPI.reload() - - if guid ~= nil then - Wait.time(function() playAreaAPI.updateLocations({ guid }) end, 1) - end -end - -- creates the main button function createOpenCloseButton() buttonParameters.tooltip = (controlActive and "Close" or "Open") .. " Playmat Panel" diff --git a/src/playercards/AllCardsBagApi.ttslua b/src/playercards/AllCardsBagApi.ttslua index 8cfa95b0..c9223331 100644 --- a/src/playercards/AllCardsBagApi.ttslua +++ b/src/playercards/AllCardsBagApi.ttslua @@ -9,8 +9,8 @@ do -- returned. Otherwise, a single table with the following fields -- cardData: TTS object data, suitable for spawning the card -- cardMetadata: Table of parsed metadata - AllCardsBagApi.getCardById = function(params) - return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardById", params) + AllCardsBagApi.getCardById = function(id) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardById", {id = id}) end -- Gets a random basic weakness from the bag. Once a given ID has been returned @@ -37,11 +37,11 @@ do -- Searches the bag for cards which match the given name and returns a list. Note that this is -- an O(n) search without index support. It may be slow. - -- @param array must contain these fields to define the search: + -- @param -- name String or string fragment to search for names -- exact Whether the name match should be exact - AllCardsBagApi.getCardsByName = function(params) - return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByName", params) + AllCardsBagApi.getCardsByName = function(name, exact) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByName", {name = name, exact = exact}) end AllCardsBagApi.isBagPresent = function() @@ -49,15 +49,15 @@ do end -- Returns a list of cards from the bag matching a class and level (0 or upgraded) - -- @param table: + -- @param -- class: String class to retrieve ("Guardian", "Seeker", etc) - -- isUpgraded: true for upgraded cards (Level 1-5), false for Level 0 + -- upgraded: true for upgraded cards (Level 1-5), false for Level 0 -- @return: If the indexes are still being constructed, returns an empty table. -- Otherwise, a list of tables, each with the following fields -- cardData: TTS object data, suitable for spawning the card -- cardMetadata: Table of parsed metadata - AllCardsBagApi.getCardsByClassAndLevel = function(params) - return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByClassAndLevel", params) + AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded) + return getObjectFromGUID(ALL_CARDS_BAG_GUID).call("getCardsByClassAndLevel", {class = class, upgraded = upgraded}) end AllCardsBagApi.getCardsByCycle = function(cycle) diff --git a/src/playercards/CardSearch.ttslua b/src/playercards/CardSearch.ttslua index 43ce8d0c..fd4f7e3d 100644 --- a/src/playercards/CardSearch.ttslua +++ b/src/playercards/CardSearch.ttslua @@ -108,7 +108,7 @@ function search() end -- search all objects in bag - local cardList = allCardsBagApi.getCardsByName({ name = inputParameters.value, exact = searchExact }) + local cardList = allCardsBagApi.getCardsByName(inputParameters.value, searchExact) if cardList == nil or #cardList == 0 then printToAll("No match found.", "Red") return diff --git a/src/playercards/PlayerCardPanel.ttslua b/src/playercards/PlayerCardPanel.ttslua index 5d0f55d8..135699ab 100644 --- a/src/playercards/PlayerCardPanel.ttslua +++ b/src/playercards/PlayerCardPanel.ttslua @@ -583,13 +583,13 @@ function placeClassCards(cardClass, isUpgraded) broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return end - local cardIdList = allCardsBagApi.getCardsByClassAndLevel({class = cardClass, upgraded = isUpgraded}) + local cardIdList = allCardsBagApi.getCardsByClassAndLevel(cardClass, isUpgraded) local skillList = { } local eventList = { } local assetList = { } for _, cardId in ipairs(cardIdList) do - local cardMetadata = allCardsBagApi.getCardById({ id = cardId }).metadata + local cardMetadata = allCardsBagApi.getCardById(cardId).metadata if (cardMetadata.type == "Skill") then table.insert(skillList, cardId) elseif (cardMetadata.type == "Event") then @@ -700,7 +700,7 @@ function spawnWeaknesses() local basicWeaknessList = { } local otherWeaknessList = { } for i, id in ipairs(weaknessIdList) do - local cardMetadata = allCardsBagApi.getCardById({ id = id }).metadata + local cardMetadata = allCardsBagApi.getCardById(id).metadata if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount > 0 then table.insert(basicWeaknessList, id) elseif excludedNonBasicWeaknesses[id] == nil then diff --git a/src/playercards/SpawnBag.ttslua b/src/playercards/SpawnBag.ttslua index 1042c037..5591ec53 100644 --- a/src/playercards/SpawnBag.ttslua +++ b/src/playercards/SpawnBag.ttslua @@ -92,7 +92,7 @@ do local cardsToSpawn = { } local cardList = spawnSpec.cards for _, cardId in ipairs(cardList) do - local cardData = allCardsBagApi.getCardById({ id = cardId }) + local cardData = allCardsBagApi.getCardById(cardId) if (cardData ~= nil) then table.insert(cardsToSpawn, cardData) else diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index 387db44a..0c99d6a2 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -774,7 +774,7 @@ end --------------------------------------------------------- function drawChaosTokenButton(_, _, isRightClick) - chaosBagApi.drawChaosToken({self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick}) + chaosBagApi.drawChaosToken(self, DRAWN_CHAOS_TOKEN_OFFSET, isRightClick) end function drawEncountercard(_, _, isRightClick) From c4379776473d1df695ce7d09c56a270498eb8d25 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 26 Aug 2023 01:13:39 +0200 Subject: [PATCH 06/13] addition of player cards --- objects/AllPlayerCards.15bb07.json | 14 ++++- .../ChemistrySet.da9727.gmnotes | 10 +++ .../ChemistrySet.da9727.json | 62 +++++++++++++++++++ .../DrCharlesWestIII.72efed.gmnotes | 11 ++++ .../DrCharlesWestIII.72efed.json | 62 +++++++++++++++++++ .../LongShot.dc8c4d.gmnotes | 8 +++ .../LongShot.dc8c4d.json | 61 ++++++++++++++++++ .../Microscope.48be49.gmnotes | 10 +++ .../Microscope.48be49.json | 62 +++++++++++++++++++ .../Pitchfork.45a724.gmnotes | 11 ++++ .../Pitchfork.45a724.json | 62 +++++++++++++++++++ .../PushedtotheLimit.e0f396.gmnotes | 11 ++++ .../PushedtotheLimit.e0f396.json | 61 ++++++++++++++++++ .../RavenousMyconid.0aa967.gmnotes | 16 +++++ .../RavenousMyconid.0aa967.json | 62 +++++++++++++++++++ .../SparrowMask.975d79.gmnotes | 11 ++++ .../SparrowMask.975d79.json | 62 +++++++++++++++++++ .../StallforTime.7b6ed1.gmnotes | 11 ++++ .../StallforTime.7b6ed1.json | 61 ++++++++++++++++++ .../UncannyGrowth.6543e6.gmnotes | 9 +++ .../UncannyGrowth.6543e6.json | 61 ++++++++++++++++++ .../Well-Funded.96fbfa.gmnotes | 9 +++ .../Well-Funded.96fbfa.json | 61 ++++++++++++++++++ .../WrongPlaceRightTime.d5944e.gmnotes | 12 ++++ .../WrongPlaceRightTime.d5944e.json | 61 ++++++++++++++++++ objects/PlayerCards.2d30ee.json | 4 +- src/playercards/PlayerCardPanel.ttslua | 6 +- src/playercards/PlayerCardPanelData.ttslua | 4 ++ 28 files changed, 891 insertions(+), 4 deletions(-) create mode 100644 objects/AllPlayerCards.15bb07/ChemistrySet.da9727.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json create mode 100644 objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json create mode 100644 objects/AllPlayerCards.15bb07/LongShot.dc8c4d.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json create mode 100644 objects/AllPlayerCards.15bb07/Microscope.48be49.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/Microscope.48be49.json create mode 100644 objects/AllPlayerCards.15bb07/Pitchfork.45a724.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/Pitchfork.45a724.json create mode 100644 objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json create mode 100644 objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json create mode 100644 objects/AllPlayerCards.15bb07/SparrowMask.975d79.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/SparrowMask.975d79.json create mode 100644 objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json create mode 100644 objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json create mode 100644 objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json create mode 100644 objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json diff --git a/objects/AllPlayerCards.15bb07.json b/objects/AllPlayerCards.15bb07.json index 624b34d8..6224bc3b 100644 --- a/objects/AllPlayerCards.15bb07.json +++ b/objects/AllPlayerCards.15bb07.json @@ -1534,7 +1534,19 @@ "InspectorFlint.8247a5", "AgentAriQuinn.d61c6a", "DeckofPossibilities.fefdfa", - "IsamaraOrdoez.860cd7" + "IsamaraOrdoez.860cd7", + "LongShot.dc8c4d", + "ChemistrySet.da9727", + "PushedtotheLimit.e0f396", + "UncannyGrowth.6543e6", + "Microscope.48be49", + "Well-Funded.96fbfa", + "DrCharlesWestIII.72efed", + "RavenousMyconid.0aa967", + "StallforTime.7b6ed1", + "WrongPlaceRightTime.d5944e", + "SparrowMask.975d79", + "Pitchfork.45a724" ], "ContainedObjects_path": "AllPlayerCards.15bb07", "Description": "", diff --git a/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.gmnotes b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.gmnotes new file mode 100644 index 00000000..854650dd --- /dev/null +++ b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.gmnotes @@ -0,0 +1,10 @@ +{ + "id": "10040", + "type": "Asset", + "class": "Seeker", + "cost": 2, + "level": 0, + "traits": "Item. Tool. Science.", + "intellectIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json new file mode 100644 index 00000000..e051278c --- /dev/null +++ b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 102, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/ChemistrySet.da9727.gmnotes", + "GUID": "da9727", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Chemistry Set", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.209, + "posZ": 20.574, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.gmnotes b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.gmnotes new file mode 100644 index 00000000..be7373ac --- /dev/null +++ b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.gmnotes @@ -0,0 +1,11 @@ +{ + "id": "10041", + "type": "Asset", + "class": "Seeker", + "cost": 3, + "level": 0, + "traits": "Ally. Science.", + "intellectIcons": 1, + "combatIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json new file mode 100644 index 00000000..c926fbd4 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 105, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Knows His Purpose", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/DrCharlesWestIII.72efed.gmnotes", + "GUID": "72efed", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Dr. Charles West III", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.209, + "posZ": 18.322, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.gmnotes b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.gmnotes new file mode 100644 index 00000000..dd2197b2 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.gmnotes @@ -0,0 +1,8 @@ +{ + "id": "10116", + "type": "Skill", + "class": "Survivor", + "level": 0, + "traits": "Practiced.", + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json new file mode 100644 index 00000000..19945fe5 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 106, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/LongShot.dc8c4d.gmnotes", + "GUID": "dc8c4d", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Long Shot", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.22, + "posZ": 27.331, + "rotX": 359, + "rotY": 270, + "rotZ": 359, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/Microscope.48be49.gmnotes b/objects/AllPlayerCards.15bb07/Microscope.48be49.gmnotes new file mode 100644 index 00000000..84397f26 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Microscope.48be49.gmnotes @@ -0,0 +1,10 @@ +{ + "id": "10042", + "type": "Asset", + "class": "Seeker", + "cost": 2, + "level": 0, + "traits": "Item. Tool. Science.", + "intellectIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/Microscope.48be49.json b/objects/AllPlayerCards.15bb07/Microscope.48be49.json new file mode 100644 index 00000000..1d6f15ff --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Microscope.48be49.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 103, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/Microscope.48be49.gmnotes", + "GUID": "48be49", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Microscope", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.468, + "posY": 3.209, + "posZ": 20.574, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/Pitchfork.45a724.gmnotes b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.gmnotes new file mode 100644 index 00000000..2d57b356 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.gmnotes @@ -0,0 +1,11 @@ +{ + "id": "10110", + "type": "Asset", + "class": "Survivor", + "cost": 3, + "level": 0, + "traits": "Item. Tool. Weapon. Melee.", + "combatIcons": 1, + "agilityIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json new file mode 100644 index 00000000..02259a9c --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 111, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/Pitchfork.45a724.gmnotes", + "GUID": "45a724", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Pitchfork", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.468, + "posY": 3.209, + "posZ": 25.078, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.gmnotes b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.gmnotes new file mode 100644 index 00000000..54d7bbb9 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.gmnotes @@ -0,0 +1,11 @@ +{ + "id": "10113", + "type": "Event", + "class": "Survivor", + "cost": 2, + "level": 0, + "traits": "Tactic. Improvised.", + "willpowerIcons": 1, + "combatIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json new file mode 100644 index 00000000..c7c9947d --- /dev/null +++ b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 109, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/PushedtotheLimit.e0f396.gmnotes", + "GUID": "e0f396", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Pushed to the Limit", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.468, + "posY": 3.209, + "posZ": 27.331, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.gmnotes b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.gmnotes new file mode 100644 index 00000000..184c5697 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.gmnotes @@ -0,0 +1,16 @@ +{ + "id": "10044", + "type": "Asset", + "class": "Seeker", + "cost": 2, + "level": 0, + "traits": "Creature. Monster. Flora. Science.", + "bonded": [ + { + "count": 1, + "id": "10045" + } + ], + "agilityIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json new file mode 100644 index 00000000..73d4fe29 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 104, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "Unidentified", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/RavenousMyconid.0aa967.gmnotes", + "GUID": "0aa967", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Ravenous Myconid", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.209, + "posZ": 22.826, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/SparrowMask.975d79.gmnotes b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.gmnotes new file mode 100644 index 00000000..10f7d8fc --- /dev/null +++ b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.gmnotes @@ -0,0 +1,11 @@ +{ + "id": "10111", + "type": "Asset", + "class": "Survivor", + "cost": 1, + "level": 0, + "traits": "Item. Charm. Mask.", + "willpowerIcons": 1, + "agilityIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json new file mode 100644 index 00000000..ce3cd094 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json @@ -0,0 +1,62 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 110, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "The Wanderer's Companion", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/SparrowMask.975d79.gmnotes", + "GUID": "975d79", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Sparrow 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": "" +} diff --git a/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.gmnotes b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.gmnotes new file mode 100644 index 00000000..d7219781 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.gmnotes @@ -0,0 +1,11 @@ +{ + "id": "10114", + "type": "Event", + "class": "Survivor", + "cost": 1, + "level": 0, + "traits": "Tactic. Trick.", + "willpowerIcons": 1, + "intellectIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json new file mode 100644 index 00000000..e0bf2e4b --- /dev/null +++ b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 108, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/StallforTime.7b6ed1.gmnotes", + "GUID": "7b6ed1", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Stall for Time", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.209, + "posZ": 25.078, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.gmnotes b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.gmnotes new file mode 100644 index 00000000..ba4856dd --- /dev/null +++ b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.gmnotes @@ -0,0 +1,9 @@ +{ + "id": "10045", + "type": "Event", + "class": "Seeker", + "cost": 1, + "level": 0, + "traits": "Insight. Science.", + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json new file mode 100644 index 00000000..5628fb68 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 101, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/UncannyGrowth.6543e6.gmnotes", + "GUID": "6543e6", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Uncanny Growth", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.468, + "posY": 3.209, + "posZ": 22.826, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.gmnotes b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.gmnotes new file mode 100644 index 00000000..f9bb7eb6 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.gmnotes @@ -0,0 +1,9 @@ +{ + "id": "10051", + "type": "Skill", + "class": "Seeker", + "level": 0, + "traits": "Fortune.", + "wildIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json new file mode 100644 index 00000000..103677f3 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 100, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/Well-Funded.96fbfa.gmnotes", + "GUID": "96fbfa", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Well-Funded", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 79.306, + "posY": 3.209, + "posZ": 16.069, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.gmnotes b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.gmnotes new file mode 100644 index 00000000..7719f59c --- /dev/null +++ b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.gmnotes @@ -0,0 +1,12 @@ +{ + "id": "10115", + "type": "Event", + "class": "Survivor", + "cost": 0, + "level": 0, + "traits": "Spirit. Double.", + "willpowerIcons": 1, + "agilityIcons": 1, + "wildIcons": 1, + "cycle": "The Feast of Hemlock Vale" +} diff --git a/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json new file mode 100644 index 00000000..7f61d268 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json @@ -0,0 +1,61 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "CardID": 107, + "ColorDiffuse": { + "b": 0.71324, + "g": 0.71324, + "r": 0.71324 + }, + "CustomDeck": { + "1": { + "BackIsHidden": false, + "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", + "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", + "NumHeight": 2, + "NumWidth": 6, + "Type": 0, + "UniqueBack": false + } + }, + "Description": "", + "DragSelectable": true, + "GMNotes_path": "AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.gmnotes", + "GUID": "d5944e", + "Grid": true, + "GridProjection": false, + "Hands": true, + "HideWhenFaceDown": true, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Card", + "Nickname": "Wrong Place, Right Time", + "SidewaysCard": false, + "Snap": true, + "Sticky": true, + "Tags": [ + "PlayerCard" + ], + "Tooltip": true, + "Transform": { + "posX": 82.469, + "posY": 3.209, + "posZ": 16.069, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/PlayerCards.2d30ee.json b/objects/PlayerCards.2d30ee.json index 89da47eb..94839147 100644 --- a/objects/PlayerCards.2d30ee.json +++ b/objects/PlayerCards.2d30ee.json @@ -18,8 +18,8 @@ "Type": 3 }, "ImageScalar": 1, - "ImageSecondaryURL": "https://i.imgur.com/s5H1THb.jpg", - "ImageURL": "https://i.imgur.com/s5H1THb.jpg", + "ImageSecondaryURL": "", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641075457/C12E95AE17A6C6043118449CB8012F8509828325/", "WidthScale": 0 }, "Description": "", diff --git a/src/playercards/PlayerCardPanel.ttslua b/src/playercards/PlayerCardPanel.ttslua index 90e58924..0eda8cf2 100644 --- a/src/playercards/PlayerCardPanel.ttslua +++ b/src/playercards/PlayerCardPanel.ttslua @@ -88,6 +88,7 @@ local CYCLE_LIST = { "The Innsmouth Conspiracy", "Edge of the Earth", "The Scarlet Keys", + "The Feast of Hemlock Vale", "Investigator Packs" } @@ -280,8 +281,11 @@ function createCycleButtons() colCount = 0 buttonPos.z = buttonPos.z + CYCLE_BUTTONS_Z_OFFSET * rowCount if rowCount == 3 then - -- Account for centered button on the final row + -- Account for two centered buttons on the final row + buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET / 2 + --[[ Account for centered button on the final row buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET + ]] end else buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET diff --git a/src/playercards/PlayerCardPanelData.ttslua b/src/playercards/PlayerCardPanelData.ttslua index dbe5bdc6..28e5b2db 100644 --- a/src/playercards/PlayerCardPanelData.ttslua +++ b/src/playercards/PlayerCardPanelData.ttslua @@ -13,6 +13,7 @@ BONDED_CARD_LIST = { "06033", -- Augur "06331", -- Dream Parasite "06015a", -- Dream-Gate + "10045" -- Uncanny Growth } UPGRADE_SHEET_LIST = { @@ -184,6 +185,9 @@ INVESTIGATOR_GROUPS = { "Amina Zidane", "Darrell Simmons", "Charlie Kane" + }, + ["The Feast of Hemlock Vale"] = { + -- placeholder for future addition of investigators once we have their backs } } From 2fd312c651a954c4b19a8d3cd1c4d2257eea8ea3 Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Sat, 26 Aug 2023 17:39:52 -0400 Subject: [PATCH 07/13] Fix variable typo --- src/core/PlayAreaSelector.ttslua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/PlayAreaSelector.ttslua b/src/core/PlayAreaSelector.ttslua index e5958102..84749458 100644 --- a/src/core/PlayAreaSelector.ttslua +++ b/src/core/PlayAreaSelector.ttslua @@ -1,5 +1,5 @@ local controlActive = false -local playAreaAPI = require("core/PlayAreaApi") +local playAreaApi = require("core/PlayAreaApi") -- parameters for open/close button for reusing local buttonParameters = {} @@ -62,11 +62,11 @@ end -- click function for apply button function click_applySurface(_, _, isRightClick) - playAreaAPI.updateSurface(isRightClick and "" or self.getInputs()[1].value) + playAreaApi.updateSurface(isRightClick and "" or self.getInputs()[1].value) end function updateSurface(newURL) - playAreaAPI.updateSurface(newURL) + playAreaApi.updateSurface(newURL) end -- input function for the input box From c21f0f2cea3be875a01a66b644ea2477c7e1e458 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 28 Aug 2023 11:04:33 +0200 Subject: [PATCH 08/13] removal of hemlock cards from spoiler box --- objects/LeakedItems.42cd6e.json | 12 ---- .../ChemistrySet.da9727.gmnotes | 10 --- .../ChemistrySet.da9727.json | 62 ------------------- .../DrCharlesWestIII.72efed.gmnotes | 11 ---- .../DrCharlesWestIII.72efed.json | 62 ------------------- .../LongShot.dc8c4d.gmnotes | 8 --- .../LeakedItems.42cd6e/LongShot.dc8c4d.json | 61 ------------------ .../Microscope.48be49.gmnotes | 10 --- .../LeakedItems.42cd6e/Microscope.48be49.json | 62 ------------------- .../Pitchfork.45a724.gmnotes | 11 ---- .../LeakedItems.42cd6e/Pitchfork.45a724.json | 62 ------------------- .../PushedtotheLimit.e0f396.gmnotes | 11 ---- .../PushedtotheLimit.e0f396.json | 61 ------------------ .../RavenousMyconid.0aa967.gmnotes | 16 ----- .../RavenousMyconid.0aa967.json | 62 ------------------- .../SparrowMask.975d79.gmnotes | 11 ---- .../SparrowMask.975d79.json | 62 ------------------- .../StallforTime.7b6ed1.gmnotes | 11 ---- .../StallforTime.7b6ed1.json | 61 ------------------ .../UncannyGrowth.6543e6.gmnotes | 9 --- .../UncannyGrowth.6543e6.json | 61 ------------------ .../Well-Funded.96fbfa.gmnotes | 9 --- .../Well-Funded.96fbfa.json | 61 ------------------ .../WrongPlaceRightTime.d5944e.gmnotes | 12 ---- .../WrongPlaceRightTime.d5944e.json | 61 ------------------ 25 files changed, 879 deletions(-) delete mode 100644 objects/LeakedItems.42cd6e/ChemistrySet.da9727.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/ChemistrySet.da9727.json delete mode 100644 objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.json delete mode 100644 objects/LeakedItems.42cd6e/LongShot.dc8c4d.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/LongShot.dc8c4d.json delete mode 100644 objects/LeakedItems.42cd6e/Microscope.48be49.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/Microscope.48be49.json delete mode 100644 objects/LeakedItems.42cd6e/Pitchfork.45a724.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/Pitchfork.45a724.json delete mode 100644 objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.json delete mode 100644 objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.json delete mode 100644 objects/LeakedItems.42cd6e/SparrowMask.975d79.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/SparrowMask.975d79.json delete mode 100644 objects/LeakedItems.42cd6e/StallforTime.7b6ed1.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/StallforTime.7b6ed1.json delete mode 100644 objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.json delete mode 100644 objects/LeakedItems.42cd6e/Well-Funded.96fbfa.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/Well-Funded.96fbfa.json delete mode 100644 objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.gmnotes delete mode 100644 objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.json diff --git a/objects/LeakedItems.42cd6e.json b/objects/LeakedItems.42cd6e.json index a46edb73..36275b3f 100644 --- a/objects/LeakedItems.42cd6e.json +++ b/objects/LeakedItems.42cd6e.json @@ -14,18 +14,6 @@ "r": 1 }, "ContainedObjects_order": [ - "Well-Funded.96fbfa", - "UncannyGrowth.6543e6", - "RavenousMyconid.0aa967", - "Microscope.48be49", - "DrCharlesWestIII.72efed", - "ChemistrySet.da9727", - "PushedtotheLimit.e0f396", - "SparrowMask.975d79", - "Pitchfork.45a724", - "LongShot.dc8c4d", - "WrongPlaceRightTime.d5944e", - "StallforTime.7b6ed1", "AliceLuxley2.94f23b", "DragonPole3.a20aef", "FineClothes3.5cb973", diff --git a/objects/LeakedItems.42cd6e/ChemistrySet.da9727.gmnotes b/objects/LeakedItems.42cd6e/ChemistrySet.da9727.gmnotes deleted file mode 100644 index 854650dd..00000000 --- a/objects/LeakedItems.42cd6e/ChemistrySet.da9727.gmnotes +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "10040", - "type": "Asset", - "class": "Seeker", - "cost": 2, - "level": 0, - "traits": "Item. Tool. Science.", - "intellectIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/ChemistrySet.da9727.json b/objects/LeakedItems.42cd6e/ChemistrySet.da9727.json deleted file mode 100644 index d8936927..00000000 --- a/objects/LeakedItems.42cd6e/ChemistrySet.da9727.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 102, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/ChemistrySet.da9727.gmnotes", - "GUID": "da9727", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Chemistry Set", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -101.422, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.gmnotes b/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.gmnotes deleted file mode 100644 index be7373ac..00000000 --- a/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.gmnotes +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "10041", - "type": "Asset", - "class": "Seeker", - "cost": 3, - "level": 0, - "traits": "Ally. Science.", - "intellectIcons": 1, - "combatIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.json b/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.json deleted file mode 100644 index 50eb01b7..00000000 --- a/objects/LeakedItems.42cd6e/DrCharlesWestIII.72efed.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 105, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "Knows His Purpose", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/DrCharlesWestIII.72efed.gmnotes", - "GUID": "72efed", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Dr. Charles West III", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -103.674, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/LongShot.dc8c4d.gmnotes b/objects/LeakedItems.42cd6e/LongShot.dc8c4d.gmnotes deleted file mode 100644 index dd2197b2..00000000 --- a/objects/LeakedItems.42cd6e/LongShot.dc8c4d.gmnotes +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "10116", - "type": "Skill", - "class": "Survivor", - "level": 0, - "traits": "Practiced.", - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/LongShot.dc8c4d.json b/objects/LeakedItems.42cd6e/LongShot.dc8c4d.json deleted file mode 100644 index 3b162bbe..00000000 --- a/objects/LeakedItems.42cd6e/LongShot.dc8c4d.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 106, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/LongShot.dc8c4d.gmnotes", - "GUID": "dc8c4d", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Long Shot", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -105.927, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/Microscope.48be49.gmnotes b/objects/LeakedItems.42cd6e/Microscope.48be49.gmnotes deleted file mode 100644 index 84397f26..00000000 --- a/objects/LeakedItems.42cd6e/Microscope.48be49.gmnotes +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "10042", - "type": "Asset", - "class": "Seeker", - "cost": 2, - "level": 0, - "traits": "Item. Tool. Science.", - "intellectIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/Microscope.48be49.json b/objects/LeakedItems.42cd6e/Microscope.48be49.json deleted file mode 100644 index ed85ac32..00000000 --- a/objects/LeakedItems.42cd6e/Microscope.48be49.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 103, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/Microscope.48be49.gmnotes", - "GUID": "48be49", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Microscope", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -105.927, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/Pitchfork.45a724.gmnotes b/objects/LeakedItems.42cd6e/Pitchfork.45a724.gmnotes deleted file mode 100644 index 2d57b356..00000000 --- a/objects/LeakedItems.42cd6e/Pitchfork.45a724.gmnotes +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "10110", - "type": "Asset", - "class": "Survivor", - "cost": 3, - "level": 0, - "traits": "Item. Tool. Weapon. Melee.", - "combatIcons": 1, - "agilityIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/Pitchfork.45a724.json b/objects/LeakedItems.42cd6e/Pitchfork.45a724.json deleted file mode 100644 index f7c9c28c..00000000 --- a/objects/LeakedItems.42cd6e/Pitchfork.45a724.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 111, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/Pitchfork.45a724.gmnotes", - "GUID": "45a724", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Pitchfork", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -108.179, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.gmnotes b/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.gmnotes deleted file mode 100644 index 54d7bbb9..00000000 --- a/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.gmnotes +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "10113", - "type": "Event", - "class": "Survivor", - "cost": 2, - "level": 0, - "traits": "Tactic. Improvised.", - "willpowerIcons": 1, - "combatIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.json b/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.json deleted file mode 100644 index 3a803fa4..00000000 --- a/objects/LeakedItems.42cd6e/PushedtotheLimit.e0f396.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 109, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/PushedtotheLimit.e0f396.gmnotes", - "GUID": "e0f396", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Pushed to the Limit", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -112.683, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.gmnotes b/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.gmnotes deleted file mode 100644 index 184c5697..00000000 --- a/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.gmnotes +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "10044", - "type": "Asset", - "class": "Seeker", - "cost": 2, - "level": 0, - "traits": "Creature. Monster. Flora. Science.", - "bonded": [ - { - "count": 1, - "id": "10045" - } - ], - "agilityIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.json b/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.json deleted file mode 100644 index 4c311883..00000000 --- a/objects/LeakedItems.42cd6e/RavenousMyconid.0aa967.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 104, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "Unidentified", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/RavenousMyconid.0aa967.gmnotes", - "GUID": "0aa967", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Ravenous Myconid", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -108.179, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/SparrowMask.975d79.gmnotes b/objects/LeakedItems.42cd6e/SparrowMask.975d79.gmnotes deleted file mode 100644 index 10f7d8fc..00000000 --- a/objects/LeakedItems.42cd6e/SparrowMask.975d79.gmnotes +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "10111", - "type": "Asset", - "class": "Survivor", - "cost": 1, - "level": 0, - "traits": "Item. Charm. Mask.", - "willpowerIcons": 1, - "agilityIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/SparrowMask.975d79.json b/objects/LeakedItems.42cd6e/SparrowMask.975d79.json deleted file mode 100644 index 5fdfaef2..00000000 --- a/objects/LeakedItems.42cd6e/SparrowMask.975d79.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 110, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "The Wanderer's Companion", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/SparrowMask.975d79.gmnotes", - "GUID": "975d79", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Sparrow Mask", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "Asset", - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -110.431, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.gmnotes b/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.gmnotes deleted file mode 100644 index d7219781..00000000 --- a/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.gmnotes +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "10114", - "type": "Event", - "class": "Survivor", - "cost": 1, - "level": 0, - "traits": "Tactic. Trick.", - "willpowerIcons": 1, - "intellectIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.json b/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.json deleted file mode 100644 index 1a203c62..00000000 --- a/objects/LeakedItems.42cd6e/StallforTime.7b6ed1.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 108, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/StallforTime.7b6ed1.gmnotes", - "GUID": "7b6ed1", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Stall for Time", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -101.422, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.gmnotes b/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.gmnotes deleted file mode 100644 index ba4856dd..00000000 --- a/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.gmnotes +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "10045", - "type": "Event", - "class": "Seeker", - "cost": 1, - "level": 0, - "traits": "Insight. Science.", - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.json b/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.json deleted file mode 100644 index 2191aaa9..00000000 --- a/objects/LeakedItems.42cd6e/UncannyGrowth.6543e6.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 101, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/UncannyGrowth.6543e6.gmnotes", - "GUID": "6543e6", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Uncanny Growth", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -110.431, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.gmnotes b/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.gmnotes deleted file mode 100644 index f9bb7eb6..00000000 --- a/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.gmnotes +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "10051", - "type": "Skill", - "class": "Seeker", - "level": 0, - "traits": "Fortune.", - "wildIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.json b/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.json deleted file mode 100644 index 41285147..00000000 --- a/objects/LeakedItems.42cd6e/Well-Funded.96fbfa.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 100, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/Well-Funded.96fbfa.gmnotes", - "GUID": "96fbfa", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Well-Funded", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -44.346, - "posY": 3.23, - "posZ": -112.683, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.gmnotes b/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.gmnotes deleted file mode 100644 index 7719f59c..00000000 --- a/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.gmnotes +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "10115", - "type": "Event", - "class": "Survivor", - "cost": 0, - "level": 0, - "traits": "Spirit. Double.", - "willpowerIcons": 1, - "agilityIcons": 1, - "wildIcons": 1, - "cycle": "The Feast of Hemlock Vale" -} diff --git a/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.json b/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.json deleted file mode 100644 index 56ade903..00000000 --- a/objects/LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "CardID": 107, - "ColorDiffuse": { - "b": 0.71324, - "g": 0.71324, - "r": 0.71324 - }, - "CustomDeck": { - "1": { - "BackIsHidden": false, - "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", - "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", - "NumHeight": 2, - "NumWidth": 6, - "Type": 0, - "UniqueBack": false - } - }, - "Description": "", - "DragSelectable": true, - "GMNotes_path": "LeakedItems.42cd6e/WrongPlaceRightTime.d5944e.gmnotes", - "GUID": "d5944e", - "Grid": true, - "GridProjection": false, - "Hands": true, - "HideWhenFaceDown": true, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Card", - "Nickname": "Wrong Place, Right Time", - "SidewaysCard": false, - "Snap": true, - "Sticky": true, - "Tags": [ - "PlayerCard" - ], - "Tooltip": true, - "Transform": { - "posX": -41.183, - "posY": 3.23, - "posZ": -103.674, - "rotX": 0, - "rotY": 270, - "rotZ": 0, - "scaleX": 1, - "scaleY": 1, - "scaleZ": 1 - }, - "Value": 0, - "XmlUI": "" -} From 7f58638ef8672b5254f91df2c62674e3781d05bd Mon Sep 17 00:00:00 2001 From: bankey Date: Tue, 29 Aug 2023 15:56:12 -0400 Subject: [PATCH 09/13] adds context menu option to 'Well Connected' player cards to display skill boost value right on the card --- .../WellConnected.66b7d5.json | 2 +- .../WellConnected3.170127.json | 2 +- src/playercards/cards/WellConnected.ttslua | 52 +++++++++++++++++++ src/playercards/cards/WellConnected3.ttslua | 52 +++++++++++++++++++ src/playermat/Playmat.ttslua | 5 ++ src/playermat/PlaymatApi.ttslua | 9 ++++ 6 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 src/playercards/cards/WellConnected.ttslua create mode 100644 src/playercards/cards/WellConnected3.ttslua diff --git a/objects/AllPlayerCards.15bb07/WellConnected.66b7d5.json b/objects/AllPlayerCards.15bb07/WellConnected.66b7d5.json index bbfc74cf..c2484b7a 100644 --- a/objects/AllPlayerCards.15bb07/WellConnected.66b7d5.json +++ b/objects/AllPlayerCards.15bb07/WellConnected.66b7d5.json @@ -33,7 +33,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "", + "LuaScript": "require(\"playercards/cards/WellConnected\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", diff --git a/objects/AllPlayerCards.15bb07/WellConnected3.170127.json b/objects/AllPlayerCards.15bb07/WellConnected3.170127.json index e9dadd28..7f2975ca 100644 --- a/objects/AllPlayerCards.15bb07/WellConnected3.170127.json +++ b/objects/AllPlayerCards.15bb07/WellConnected3.170127.json @@ -33,7 +33,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "", + "LuaScript": "require(\"playercards/cards/WellConnected3\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", diff --git a/src/playercards/cards/WellConnected.ttslua b/src/playercards/cards/WellConnected.ttslua new file mode 100644 index 00000000..9a6a8d45 --- /dev/null +++ b/src/playercards/cards/WellConnected.ttslua @@ -0,0 +1,52 @@ +local playmatApi = require("playermat/PlaymatApi") + +local display = false +local count = 0 +local modValue = 5 +local loopId = nil + +local b_display = { + index = 0, + click_function = 'none', + function_owner = self, + position = {-0.25,1,-0.75}, + font_color = {1,1,1,100}, + font_size = 250, + width = 0, + height = 0 +} + +function onLoad() + self.addContextMenuItem('Toggle Counter', toggleCounter) +end + +function toggleCounter() + display = not display + + if display then + createUpdateDisplay() + loopId = Wait.time(|| createUpdateDisplay(), 2, -1) + else + Wait.stop(loopId) + self.clearButtons() + loopId = nil + end +end + +function createUpdateDisplay() + count = math.max(math.floor(getPlayerResources() / modValue), 0) + + b_display.label = tostring(count) + + if loopId == nil then + self.createButton(b_display) + else + self.editButton(b_display) + end +end + +function getPlayerResources() + local matColor = playmatApi.getMatColorByPosition(self.getPosition()) + + return playmatApi.getResourceCount(matColor) +end \ No newline at end of file diff --git a/src/playercards/cards/WellConnected3.ttslua b/src/playercards/cards/WellConnected3.ttslua new file mode 100644 index 00000000..f412610a --- /dev/null +++ b/src/playercards/cards/WellConnected3.ttslua @@ -0,0 +1,52 @@ +local playmatApi = require("playermat/PlaymatApi") + +local display = false +local count = 0 +local modValue = 4 +local loopId = nil + +local b_display = { + index = 0, + click_function = 'none', + function_owner = self, + position = {-0.25,1,-0.75}, + font_color = {1,1,1,100}, + font_size = 250, + width = 0, + height = 0 +} + +function onLoad() + self.addContextMenuItem('Toggle Counter', toggleCounter) +end + +function toggleCounter() + display = not display + + if display then + createUpdateDisplay() + loopId = Wait.time(|| createUpdateDisplay(), 2, -1) + else + Wait.stop(loopId) + self.clearButtons() + loopId = nil + end +end + +function createUpdateDisplay() + count = math.max(math.floor(getPlayerResources() / modValue), 0) + + b_display.label = tostring(count) + + if loopId == nil then + self.createButton(b_display) + else + self.editButton(b_display) + end +end + +function getPlayerResources() + local matColor = playmatApi.getMatColorByPosition(self.getPosition()) + + return playmatApi.getResourceCount(matColor) +end \ No newline at end of file diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index ca349567..bcc65c47 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -361,6 +361,11 @@ function gainResources(amount) RESOURCE_COUNTER.call("updateVal", count + add) end +-- returns the resource counter amount +function getResourceCount() + return RESOURCE_COUNTER.getVar("val") +end + -- function for "draw 1 button" (that can be added via option panel) function doDrawOne(_, color) -- send messages to player who clicked button if no seated player found diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 84a1ffd0..2866f39d 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -178,6 +178,15 @@ do end end + -- Returns the resource counter amount for the requested playermat + PlaymatApi.getResourceCount = function(matColor) + local resources = 0 + for _, mat in ipairs(internal.getMatForColor(matColor)) do + resources = resources + mat.call("getResourceCount") + end + return resources + end + -- Discard a non-hidden card from the corresponding player's hand PlaymatApi.doDiscardOne = function(matColor) for _, mat in ipairs(internal.getMatForColor(matColor)) do From c678537581fda2982908bb5aa5ba8d6c9658f024 Mon Sep 17 00:00:00 2001 From: bankey Date: Wed, 30 Aug 2023 09:37:23 -0400 Subject: [PATCH 10/13] both Well Connected 0 and Well Connected 3 now share the same script, removes unecessary index from button, updates getResourceCount playmat api function, adds onSave() function, updates button look and position --- .../WellConnected3.170127.json | 2 +- src/playercards/cards/WellConnected.ttslua | 38 ++++++++++---- src/playercards/cards/WellConnected3.ttslua | 52 ------------------- src/playermat/PlaymatApi.ttslua | 7 +-- 4 files changed, 31 insertions(+), 68 deletions(-) delete mode 100644 src/playercards/cards/WellConnected3.ttslua diff --git a/objects/AllPlayerCards.15bb07/WellConnected3.170127.json b/objects/AllPlayerCards.15bb07/WellConnected3.170127.json index 7f2975ca..1c99a2e6 100644 --- a/objects/AllPlayerCards.15bb07/WellConnected3.170127.json +++ b/objects/AllPlayerCards.15bb07/WellConnected3.170127.json @@ -33,7 +33,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "require(\"playercards/cards/WellConnected3\")", + "LuaScript": "require(\"playercards/cards/WellConnected\")", "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", diff --git a/src/playercards/cards/WellConnected.ttslua b/src/playercards/cards/WellConnected.ttslua index 9a6a8d45..bde1ae32 100644 --- a/src/playercards/cards/WellConnected.ttslua +++ b/src/playercards/cards/WellConnected.ttslua @@ -1,23 +1,41 @@ +-- this script is shared between both the level 0 and the upgraded level 3 version of the card local playmatApi = require("playermat/PlaymatApi") local display = false local count = 0 -local modValue = 5 +local modValue = 5 -- level 0 Well Connected local loopId = nil local b_display = { - index = 0, - click_function = 'none', + click_function = "toggleCounter", function_owner = self, - position = {-0.25,1,-0.75}, - font_color = {1,1,1,100}, - font_size = 250, - width = 0, - height = 0 + position = {0.88,0.5,-1.33}, + font_size = 150, + width = 175, + height = 175 } -function onLoad() - self.addContextMenuItem('Toggle Counter', toggleCounter) +function onLoad(saved_data) + local notes = JSON.decode(self.getGMNotes()) + + if notes.id == "54006" then -- hardcoded card id for upgraded Well Connected (3) + modValue = 4 -- Well Connected (3) + end + + if saved_data != '' then + local loaded_data = JSON.decode(saved_data) + display = not loaded_data.saved_display + + toggleCounter() + end + + self.addContextMenuItem('Toggle Counter', toggleCounter) +end + +function onSave() + local data_to_save = {saved_display = display} + local saved_data = JSON.encode(data_to_save) + return saved_data end function toggleCounter() diff --git a/src/playercards/cards/WellConnected3.ttslua b/src/playercards/cards/WellConnected3.ttslua deleted file mode 100644 index f412610a..00000000 --- a/src/playercards/cards/WellConnected3.ttslua +++ /dev/null @@ -1,52 +0,0 @@ -local playmatApi = require("playermat/PlaymatApi") - -local display = false -local count = 0 -local modValue = 4 -local loopId = nil - -local b_display = { - index = 0, - click_function = 'none', - function_owner = self, - position = {-0.25,1,-0.75}, - font_color = {1,1,1,100}, - font_size = 250, - width = 0, - height = 0 -} - -function onLoad() - self.addContextMenuItem('Toggle Counter', toggleCounter) -end - -function toggleCounter() - display = not display - - if display then - createUpdateDisplay() - loopId = Wait.time(|| createUpdateDisplay(), 2, -1) - else - Wait.stop(loopId) - self.clearButtons() - loopId = nil - end -end - -function createUpdateDisplay() - count = math.max(math.floor(getPlayerResources() / modValue), 0) - - b_display.label = tostring(count) - - if loopId == nil then - self.createButton(b_display) - else - self.editButton(b_display) - end -end - -function getPlayerResources() - local matColor = playmatApi.getMatColorByPosition(self.getPosition()) - - return playmatApi.getResourceCount(matColor) -end \ No newline at end of file diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 2866f39d..9df18be2 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -180,11 +180,8 @@ do -- Returns the resource counter amount for the requested playermat PlaymatApi.getResourceCount = function(matColor) - local resources = 0 - for _, mat in ipairs(internal.getMatForColor(matColor)) do - resources = resources + mat.call("getResourceCount") - end - return resources + local mat = getObjectFromGUID(MAT_IDS[matColor]) + return mat.call("getResourceCount") end -- Discard a non-hidden card from the corresponding player's hand From 54bf39d9b060081d6be5b23e3eac1e2fb0fb10b0 Mon Sep 17 00:00:00 2001 From: Entrox-Licher Date: Wed, 30 Aug 2023 18:10:42 -0400 Subject: [PATCH 11/13] Update CODEOWNERS --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 4bbdafce..531f9510 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,3 @@ # Finn considered to be code owner of all files # until Finn gets added as a github user, argonui will serve as code owner -* @argonui @Chr1Z93 @Tikatoy @BootleggerFinn +* @argonui @Chr1Z93 @Tikatoy @BootleggerFinn @Entrox-Licher From ab49fa3a9fd889b8e67f164b72d2251dd6628c4f Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 31 Aug 2023 00:24:36 +0200 Subject: [PATCH 12/13] fixed hidden back --- objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json | 2 +- objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json | 2 +- objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json | 2 +- objects/AllPlayerCards.15bb07/Microscope.48be49.json | 2 +- objects/AllPlayerCards.15bb07/Pitchfork.45a724.json | 2 +- objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json | 2 +- objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json | 2 +- objects/AllPlayerCards.15bb07/SparrowMask.975d79.json | 2 +- objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json | 2 +- objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json | 2 +- objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json | 2 +- objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json index e051278c..f41d6063 100644 --- a/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json +++ b/objects/AllPlayerCards.15bb07/ChemistrySet.da9727.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json index c926fbd4..be167994 100644 --- a/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json +++ b/objects/AllPlayerCards.15bb07/DrCharlesWestIII.72efed.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json index 19945fe5..9196b3ce 100644 --- a/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json +++ b/objects/AllPlayerCards.15bb07/LongShot.dc8c4d.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/Microscope.48be49.json b/objects/AllPlayerCards.15bb07/Microscope.48be49.json index 1d6f15ff..8f7a98d6 100644 --- a/objects/AllPlayerCards.15bb07/Microscope.48be49.json +++ b/objects/AllPlayerCards.15bb07/Microscope.48be49.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json index 02259a9c..c55abb25 100644 --- a/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json +++ b/objects/AllPlayerCards.15bb07/Pitchfork.45a724.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json index c7c9947d..582d47ba 100644 --- a/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json +++ b/objects/AllPlayerCards.15bb07/PushedtotheLimit.e0f396.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json index 73d4fe29..34568923 100644 --- a/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json +++ b/objects/AllPlayerCards.15bb07/RavenousMyconid.0aa967.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json index ce3cd094..c1648150 100644 --- a/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json +++ b/objects/AllPlayerCards.15bb07/SparrowMask.975d79.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json index e0bf2e4b..2b6f8a66 100644 --- a/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json +++ b/objects/AllPlayerCards.15bb07/StallforTime.7b6ed1.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json index 5628fb68..d1abfe7c 100644 --- a/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json +++ b/objects/AllPlayerCards.15bb07/UncannyGrowth.6543e6.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json index 103677f3..22159c9b 100644 --- a/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json +++ b/objects/AllPlayerCards.15bb07/Well-Funded.96fbfa.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, diff --git a/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json index 7f61d268..eb58eb96 100644 --- a/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json +++ b/objects/AllPlayerCards.15bb07/WrongPlaceRightTime.d5944e.json @@ -13,7 +13,7 @@ }, "CustomDeck": { "1": { - "BackIsHidden": false, + "BackIsHidden": true, "BackURL": "https://i.imgur.com/EcbhVuh.jpg/", "FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607169641060708/B263E98D28E301D8EF45EB001FEBCE98DA25354B/", "NumHeight": 2, From 1ef635fcfe4b807511f79c23e285994f8c03b72c Mon Sep 17 00:00:00 2001 From: bankey Date: Fri, 1 Sep 2023 15:51:47 -0400 Subject: [PATCH 13/13] fixes issue where saving and loading would cause an error when the display is not enabled, minor code cleanup --- src/playercards/cards/WellConnected.ttslua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/playercards/cards/WellConnected.ttslua b/src/playercards/cards/WellConnected.ttslua index bde1ae32..7e7fda73 100644 --- a/src/playercards/cards/WellConnected.ttslua +++ b/src/playercards/cards/WellConnected.ttslua @@ -26,6 +26,7 @@ function onLoad(saved_data) local loaded_data = JSON.decode(saved_data) display = not loaded_data.saved_display + self.clearButtons() toggleCounter() end @@ -33,9 +34,7 @@ function onLoad(saved_data) end function onSave() - local data_to_save = {saved_display = display} - local saved_data = JSON.encode(data_to_save) - return saved_data + return JSON.encode({saved_display = display}) end function toggleCounter() @@ -45,7 +44,10 @@ function toggleCounter() createUpdateDisplay() loopId = Wait.time(|| createUpdateDisplay(), 2, -1) else - Wait.stop(loopId) + if loopId ~= nil then + Wait.stop(loopId) + end + self.clearButtons() loopId = nil end