From 8a320ff842f06ab88f1f4522b95d8fa060c55e2c Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 9 Nov 2024 22:13:33 +0100 Subject: [PATCH 01/16] added myriad's side scenarios and desk --- src/core/PlayAreaImageData.ttslua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/PlayAreaImageData.ttslua b/src/core/PlayAreaImageData.ttslua index 9198a4ef..53144815 100644 --- a/src/core/PlayAreaImageData.ttslua +++ b/src/core/PlayAreaImageData.ttslua @@ -901,10 +901,18 @@ PLAYAREA_IMAGE_DATA = { Name = "Consternation on the Constellation", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725512402/37F34A14CEEA9D2F889F7B97B065C0193F268FE1/" }, + { + Name = "Return to Consternation on the Constellation", + URL = "https://github.com/ArkhamDotCards/returntoconsternationontheconstellation/blob/main/product/enUS/constellation-playmat.png?raw=true" + }, { Name = "Monstrosity from the Ravenwoods", URL = "https://i.imgur.com/U9J6zm8.jpeg" }, + { + Name = "Return to the Wendigo", + URL = "https://github.com/ArkhamDotCards/returntothewendigo/blob/main/product/enUS/wendigo-playmat.png?raw=true" + }, { Name = "Symphony of Erich Zann", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725512613/B23EA91E9489E0DDE250DD33F9AF1A12EEE52E0C/" @@ -913,6 +921,10 @@ PLAYAREA_IMAGE_DATA = { }, ["Other Images"] = { ["Arkham Locations"] = { + { + Name = "Desk (by pi.ontheline)", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198340495003/80A6E3F7D53775717B909D62473B3C7CA06DBF85/" + }, { Name = "Downtown 1", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725516086/53F48F8AA9CFE4BF544BF03A616AC12A5344615C/" From 31a90fdb68c0f2f0312b3e42647b89c83dba5b19 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 9 Nov 2024 22:17:05 +0100 Subject: [PATCH 02/16] removed LITAS duplicate --- src/core/PlayAreaImageData.ttslua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/PlayAreaImageData.ttslua b/src/core/PlayAreaImageData.ttslua index 53144815..2aa4ee8b 100644 --- a/src/core/PlayAreaImageData.ttslua +++ b/src/core/PlayAreaImageData.ttslua @@ -109,14 +109,10 @@ PLAYAREA_IMAGE_DATA = { }, { Name = "VII - Lost in Time and Space 1", - URL = "https://i.ibb.co/rtTpbDx/Dunwich-8-Lost-in-Time-amp-Space.jpg" - }, - { - Name = "VII - Lost in Time and Space 2", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725405746/771BAE40F98BB16F8D011FA794E4AC0095131AF1/" }, { - Name = "VII - Lost in Time and Space 3", + Name = "VII - Lost in Time and Space 2", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725406148/D15D56EA34F27C651D7E7AC202DA4DEBE395E310/" } }, From 93d052d3404d4e0bb4aa646ccbe6967d22d8bef9 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 10 Nov 2024 15:19:07 +0100 Subject: [PATCH 03/16] updated build task --- .vscode/tasks.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ce3e11f5..eb666fac 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,14 +2,14 @@ "version": "2.0.0", "tasks": [ { - "label": "Build with TTS Mod Manager", + "label": "Build Arkham SCE", "type": "shell", "command": "go", "args": [ "run", "main.go", - "--moddir=C:\\git\\SCED", - "--modfile=${env:USERPROFILE}\\Documents\\My Games\\Tabletop Simulator\\Saves\\composed.json" + "--moddir=${workspaceFolder}", + "--modfile=${env:USERPROFILE}\\Documents\\My Games\\Tabletop Simulator\\Saves\\ArkhamSCE.json" ], "options": { "cwd": "C:\\git\\TTSModManager" From 9aac5cecaa1ac95ceacf7583c3a5dfc99bffe26e Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 10 Nov 2024 15:22:39 +0100 Subject: [PATCH 04/16] added decompose task --- .vscode/tasks.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index eb666fac..1eac327d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,7 +2,7 @@ "version": "2.0.0", "tasks": [ { - "label": "Build Arkham SCE", + "label": "Arkham SCE: Build", "type": "shell", "command": "go", "args": [ @@ -19,6 +19,22 @@ "kind": "build", "isDefault": true } + }, + { + "label": "Arkham SCE: Decompose", + "type": "shell", + "command": "go", + "args": [ + "run", + "main.go", + "--moddir=${workspaceFolder}", + "--modfile=${env:USERPROFILE}\\Documents\\My Games\\Tabletop Simulator\\Saves\\ArkhamSCE.json", + "--reverse" + ], + "options": { + "cwd": "C:\\git\\TTSModManager" + }, + "problemMatcher": [] } ] } \ No newline at end of file From 108ed9cf05604614f7c0ca35d80594deb9afdd73 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 10 Nov 2024 15:24:08 +0100 Subject: [PATCH 05/16] end of file new line --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1eac327d..0ee27f79 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,4 +37,4 @@ "problemMatcher": [] } ] -} \ No newline at end of file +} From b70ca1275a089550a1f077328091bef2238dd656 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 11 Nov 2024 00:28:08 +0100 Subject: [PATCH 06/16] more mats --- src/core/PlayAreaImageData.ttslua | 38 ++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/core/PlayAreaImageData.ttslua b/src/core/PlayAreaImageData.ttslua index 2aa4ee8b..a5b55d6e 100644 --- a/src/core/PlayAreaImageData.ttslua +++ b/src/core/PlayAreaImageData.ttslua @@ -633,6 +633,12 @@ PLAYAREA_IMAGE_DATA = { Name = "59-Z Congress of the Keys 2", URL = "https://steamusercontent-a.akamaihd.net/ugc/2038485431566444690/B01A1FEAB57473D9B6DF11B92D62C214AA1C2C02/" } + }, + ["The Feast of Hemlock Vale"] = { + { + Name = "Fate of the Vale", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817770/64468AFF13A9D511AEACA20C84681A046FC259EC/" + } } }, ["Official Scenarios"] = { @@ -917,10 +923,6 @@ PLAYAREA_IMAGE_DATA = { }, ["Other Images"] = { ["Arkham Locations"] = { - { - Name = "Desk (by pi.ontheline)", - URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198340495003/80A6E3F7D53775717B909D62473B3C7CA06DBF85/" - }, { Name = "Downtown 1", URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725516086/53F48F8AA9CFE4BF544BF03A616AC12A5344615C/" @@ -1006,13 +1008,37 @@ PLAYAREA_IMAGE_DATA = { }, ["Unsorted"] = { { - Name = "Kingsport", - URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725522594/1EA2C0AF5D4D346AD3FFDC38215BB20AAA72CE8D/" + Name = "Abstract 1", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817641/27488D73455DEEB9B9D3B349A842DBE9518E8613/" + }, + { + Name = "Abstract 2", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817667/8CD7AFCD7159CBB2CD9073BD032EEFEDB778501A/" + }, + { + Name = "Abstract 3", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817697/DC68C8E534517072E25F9E3E818779CD99BE6D0C/" + }, + { + Name = "Cthulhu 1", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817720/D55AA2560082DE929763DC960140443C1845B905/" + }, + { + Name = "Cthulhu 2", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198342817745/95FACB0C8BFF5CB58DA7A67220E8128E670B7570/" + }, + { + Name = "Desk (by pi.ontheline)", + URL = "https://steamusercontent-a.akamaihd.net/ugc/62581198340495003/80A6E3F7D53775717B909D62473B3C7CA06DBF85/" }, { Name = "Devil", URL = "https://steamusercontent-a.akamaihd.net/ugc/2115062479282248687/DD84A3CB3C4A475A5D093CB413A16A5CEA5FBF79/" }, + { + Name = "Kingsport", + URL = "https://steamusercontent-a.akamaihd.net/ugc/2279446315725522594/1EA2C0AF5D4D346AD3FFDC38215BB20AAA72CE8D/" + }, { Name = "Mystic Board", URL = "https://steamusercontent-a.akamaihd.net/ugc/2115062479282248488/EC27B1215F558A39954C27477D8B4F916CA211E5/" From 25f0c45272c2042c9f961c2bda078d76e5c7077b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 12 Nov 2024 23:29:20 +0100 Subject: [PATCH 07/16] fixed missing cycles and added to official cycle list --- .../SerpentsofYig.678392.gmnotes | 2 +- .../TheCodexofAges.df9810.gmnotes | 2 +- src/playercards/AllCardsBag.ttslua | 61 ++++++++++--------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/SerpentsofYig.678392.gmnotes b/objects/AllPlayerCards.15bb07/SerpentsofYig.678392.gmnotes index a13b0a6a..17b6fb9a 100644 --- a/objects/AllPlayerCards.15bb07/SerpentsofYig.678392.gmnotes +++ b/objects/AllPlayerCards.15bb07/SerpentsofYig.678392.gmnotes @@ -4,5 +4,5 @@ "class": "Neutral", "traits": "Humanoid. Monster. Serpent.", "weakness": true, - "cycle": "" + "cycle": "Aura of Faith" } diff --git a/objects/AllPlayerCards.15bb07/TheCodexofAges.df9810.gmnotes b/objects/AllPlayerCards.15bb07/TheCodexofAges.df9810.gmnotes index 3fb7cb99..7f1f7bee 100644 --- a/objects/AllPlayerCards.15bb07/TheCodexofAges.df9810.gmnotes +++ b/objects/AllPlayerCards.15bb07/TheCodexofAges.df9810.gmnotes @@ -8,5 +8,5 @@ "intellectIcons": 1, "willpowerIcons": 1, "wildIcons": 1, - "cycle": "" + "cycle": "Aura of Faith" } diff --git a/src/playercards/AllCardsBag.ttslua b/src/playercards/AllCardsBag.ttslua index f01ae11a..d29faeff 100644 --- a/src/playercards/AllCardsBag.ttslua +++ b/src/playercards/AllCardsBag.ttslua @@ -30,36 +30,37 @@ local classesInOrder = { "Survivor", "Neutral" } -local OFFICIAL_CYCLE_LIST = { - -- campaigns - ["investigator packs"] = true, - ["core"] = true, - ["the dunwich legacy"] = true, - ["the path to carcosa"] = true, - ["the forgotten age"] = true, - ["the circle undone"] = true, - ["the dream-eaters"] = true, - ["the innsmouth conspiracy"] = true, - ["edge of the earth"] = true, - ["the scarlet keys"] = true, - ["the feast of hemlock vale"] = true, - ["the drowned city"] = true, - -- standalones / parallels etc. - ["standalone"] = true, - ["the blob that ate everything else"] = true, - ["all or nothing"] = true, - ["bad blood"] = true, - ["read or die"] = true, - ["by the book"] = true, - ["red tide rising"] = true, - ["on the road again"] = true, - ["laid to rest"] = true, - ["path of the righteous"] = true, - ["relics of the past"] = true, - ["hunting for answers"] = true, - ["pistols and pearls"] = true, - ["beta"] = true, - ["promo"] = true +local OFFICIAL_CYCLE_LIST = { + -- campaigns + ["investigator packs"] = true, + ["core"] = true, + ["the dunwich legacy"] = true, + ["the path to carcosa"] = true, + ["the forgotten age"] = true, + ["the circle undone"] = true, + ["the dream-eaters"] = true, + ["the innsmouth conspiracy"] = true, + ["edge of the earth"] = true, + ["the scarlet keys"] = true, + ["the feast of hemlock vale"] = true, + ["the drowned city"] = true, + -- standalones / parallels etc. + ["standalone"] = true, + ["the blob that ate everything else"] = true, + ["all or nothing"] = true, + ["bad blood"] = true, + ["read or die"] = true, + ["by the book"] = true, + ["red tide rising"] = true, + ["on the road again"] = true, + ["laid to rest"] = true, + ["path of the righteous"] = true, + ["relics of the past"] = true, + ["hunting for answers"] = true, + ["pistols and pearls"] = true, + ["aura of faith"] = true, + ["beta"] = true, + ["promo"] = true } -- conversion tables to simplify type sorting local typeConversion = { From a9c31630f00f18b1896c548f6017be6551bcf018 Mon Sep 17 00:00:00 2001 From: Zerino Date: Wed, 13 Nov 2024 12:25:39 -0300 Subject: [PATCH 08/16] edit slots by dropping Charisma/Relic Hunter --- src/playermat/Playermat.ttslua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 5cac623d..828dbc38 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1177,6 +1177,33 @@ function resetSlotSymbols() updateSlotSymbols() end +function modifySlot(newSlot, cardPosition) + local slotSnaps = {} + local snaps = self.getSnapPoints() + for i, snap in ipairs(snaps) do + if inArea(snap.position, MAIN_PLAY_AREA) then + table.insert(slotSnaps, snap) + end + end + cardPosition.x = tonumber(string.format("%.3f", cardPosition.x)) + cardPosition.z = tonumber(string.format("%.3f", cardPosition.z)) + for snapId, snap in ipairs(slotSnaps) do + local snapPosX = tonumber(string.format("%.3f", snap.position.x)) + local snapPosZ = tonumber(string.format("%.3f", snap.position.z)) + if snapPosX == cardPosition.x and snapPosZ == cardPosition.z then + slotData[snapId] = newSlot + if Player[playerColor].seated then + printToColor(newSlot .. " slot added to player mat", playerColor, Color.fromString(playerColor)) + else + local hostColor = Player.getPlayers()[1].color + printToColor(newSlot .. " slot added to player mat", hostColor, Color.fromString(hostColor)) + end + end + end + updateSave() + updateSlotSymbols() +end + --------------------------------------------------------- -- playermat token spawning --------------------------------------------------------- @@ -1255,6 +1282,11 @@ function onCollisionEnter(collisionInfo) -- main uses spawning if inArea(localCardPos, MAIN_PLAY_AREA) and (md.type == "Asset" or md.type == "Event") then spawnTokensOrShowHelper(object) + if md.id == "02158" or id == "01694" then + modifySlot("Ally", localCardPos) + elseif md.id == "02157" or id == "01695" then + modifySlot("Accessory", localCardPos) + end end -- encounter types / committed skill cards in the threat area From 59f64415d4659efc598323ecc1a2b8c07b8467ab Mon Sep 17 00:00:00 2001 From: YumiWhellie <126528338+YumiWhellie@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:07:31 -0300 Subject: [PATCH 09/16] updated vector comparison Co-authored-by: Chr1Z <97286811+Chr1Z93@users.noreply.github.com> --- src/playermat/Playermat.ttslua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 828dbc38..37622ab8 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1185,12 +1185,10 @@ function modifySlot(newSlot, cardPosition) table.insert(slotSnaps, snap) end end - cardPosition.x = tonumber(string.format("%.3f", cardPosition.x)) - cardPosition.z = tonumber(string.format("%.3f", cardPosition.z)) + cardPosition.y = 0 for snapId, snap in ipairs(slotSnaps) do - local snapPosX = tonumber(string.format("%.3f", snap.position.x)) - local snapPosZ = tonumber(string.format("%.3f", snap.position.z)) - if snapPosX == cardPosition.x and snapPosZ == cardPosition.z then + local snapPosition = Vector(snap.position.x, 0, snap.position.z) + if snapPosition == cardPosition then slotData[snapId] = newSlot if Player[playerColor].seated then printToColor(newSlot .. " slot added to player mat", playerColor, Color.fromString(playerColor)) From 5dad64ae98d47a8f725bff278eea0cce05380937 Mon Sep 17 00:00:00 2001 From: Zerino Date: Wed, 13 Nov 2024 18:02:04 -0300 Subject: [PATCH 10/16] updated modifySlot --- src/playermat/Playermat.ttslua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 828dbc38..37622ab8 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1185,12 +1185,10 @@ function modifySlot(newSlot, cardPosition) table.insert(slotSnaps, snap) end end - cardPosition.x = tonumber(string.format("%.3f", cardPosition.x)) - cardPosition.z = tonumber(string.format("%.3f", cardPosition.z)) + cardPosition.y = 0 for snapId, snap in ipairs(slotSnaps) do - local snapPosX = tonumber(string.format("%.3f", snap.position.x)) - local snapPosZ = tonumber(string.format("%.3f", snap.position.z)) - if snapPosX == cardPosition.x and snapPosZ == cardPosition.z then + local snapPosition = Vector(snap.position.x, 0, snap.position.z) + if snapPosition == cardPosition then slotData[snapId] = newSlot if Player[playerColor].seated then printToColor(newSlot .. " slot added to player mat", playerColor, Color.fromString(playerColor)) From 67abfbcc16dd6ea1f6d8abc61c9623a74973632d Mon Sep 17 00:00:00 2001 From: Zerino Date: Wed, 13 Nov 2024 18:47:52 -0300 Subject: [PATCH 11/16] updated customizable textfield size --- src/playercards/customizable/UpgradeSheetLibrary.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playercards/customizable/UpgradeSheetLibrary.ttslua b/src/playercards/customizable/UpgradeSheetLibrary.ttslua index 448cfd2d..b9716df7 100644 --- a/src/playercards/customizable/UpgradeSheetLibrary.ttslua +++ b/src/playercards/customizable/UpgradeSheetLibrary.ttslua @@ -166,12 +166,12 @@ function createRowTextField(rowIndex) position = actualPosition, alignment = "UpperLeft", width = textField.width, - height = (inputFontsize + 15), + height = (inputFontsize + 20), fontSize = inputFontsize, resizeTextForBestFit = true, fontStyle = "Bold", rotation = "0 0 180", - scale = "0.2 0.2 0.2", + scale = "0.21 0.2 0.2", color = "#FFFFFF", } } From 52e5ec01f425b38724c55ee56b45e39b107df8b4 Mon Sep 17 00:00:00 2001 From: Zerino Date: Wed, 13 Nov 2024 21:08:52 -0300 Subject: [PATCH 12/16] updated upkeep hotkey, removed upkeep (multihanded) hotkey --- src/core/GameKeyHandler.ttslua | 39 ++++++++++++++-------------------- src/core/PlayArea.ttslua | 7 +++++- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index c045c928..d94f7635 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -9,6 +9,8 @@ local searchLib = require("util/SearchLib") local tokenChecker = require("core/token/TokenChecker") local victoryDisplayApi = require("core/VictoryDisplayApi") +local sentMessage = false + function onLoad() addHotkey("Add doom to agenda", addDoomToAgenda) addHotkey("Add Bless/Curse context menu", addBlurseSealingMenu) @@ -27,39 +29,30 @@ function onLoad() addHotkey("Take clue from location (Green)", takeClueFromLocationGreen) addHotkey("Take clue from location (Red)", takeClueFromLocationRed) addHotkey("Upkeep", triggerUpkeep) - addHotkey("Upkeep (Multi-handed)", triggerUpkeepMultihanded) end -- triggers the "Upkeep" function of the calling player's playermat function triggerUpkeep(playerColor) - if playerColor == "Black" then - broadcastToColor("Triggering 'Upkeep (Multihanded)' instead", playerColor, "Yellow") - triggerUpkeepMultihanded(playerColor) + if playerColor == "Black" and not sentMessage then + broadcastToColor("It is recommended to sit on a player mat", playerColor, "Yellow") + sentMessage = true + end + if #Player.getPlayers() == 1 then + local colors = Player.getAvailableColors() + for _, handColor in ipairs(colors) do + local matColor = playermatApi.getMatColor(handColor) + local data = playermatApi.getActiveInvestigatorData(matColor) + if data.id ~= "00000" then + playermatApi.doUpkeepFromHotkey(matColor, playerColor) + end + end + playAreaApi.readyCards() return end local matColor = playermatApi.getMatColor(playerColor) playermatApi.doUpkeepFromHotkey(matColor, playerColor) end --- triggers the "Upkeep" function of the calling player's playermat AND --- for all playermats that don't have a seated player, but an investigator card -function triggerUpkeepMultihanded(playerColor) - if playerColor ~= "Black" then - triggerUpkeep(playerColor) - end - local colors = Player.getAvailableColors() - for _, handColor in ipairs(colors) do - local matColor = playermatApi.getMatColor(handColor) - local data = playermatApi.getActiveInvestigatorData(matColor) - if data.id ~= "00000" and Player[handColor].seated == false then - playermatApi.doUpkeepFromHotkey(matColor, playerColor) - end - end - - -- also trigger the PlayArea's "Ready Cards" function - playAreaApi.readyCards() -end - -- adds 1 doom to the agenda function addDoomToAgenda() local doomCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomCounter") diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index e80fceac..567ff802 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -514,7 +514,12 @@ end -- Readies all cards in the main playarea (both player cards, treacheries and enemies) function readyCards(player, clickType) - local playerColor = player.color + if player ~= nil then + local playerColor = player.color + else + local existingPlayer = Player.getPlayers()[1] + playerColor = existingPlayer.color + end -- when right-clicked if clickType == "-2" then From 77f320e18885a43b21d960170aefb804e31a516d Mon Sep 17 00:00:00 2001 From: Zerino Date: Wed, 13 Nov 2024 21:42:27 -0300 Subject: [PATCH 13/16] fixed a local, made code even smaller --- src/core/GameKeyHandler.ttslua | 10 +++------- src/core/PlayArea.ttslua | 3 ++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index d94f7635..761d86ed 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -38,13 +38,9 @@ function triggerUpkeep(playerColor) sentMessage = true end if #Player.getPlayers() == 1 then - local colors = Player.getAvailableColors() - for _, handColor in ipairs(colors) do - local matColor = playermatApi.getMatColor(handColor) - local data = playermatApi.getActiveInvestigatorData(matColor) - if data.id ~= "00000" then - playermatApi.doUpkeepFromHotkey(matColor, playerColor) - end + local usedMats = playermatApi.getUsedMatColors() + for _, matColor in ipairs(usedMats) do + playermatApi.doUpkeepFromHotkey(matColor, playerColor) end playAreaApi.readyCards() return diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 567ff802..34f2778f 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -514,8 +514,9 @@ end -- Readies all cards in the main playarea (both player cards, treacheries and enemies) function readyCards(player, clickType) + local playerColor if player ~= nil then - local playerColor = player.color + playerColor = player.color else local existingPlayer = Player.getPlayers()[1] playerColor = existingPlayer.color From 64a7509500262d3d04fc3bd052916d059bfd8d8a Mon Sep 17 00:00:00 2001 From: Zerino Date: Thu, 14 Nov 2024 10:30:41 -0300 Subject: [PATCH 14/16] added Blursed icon slot for Occult Reliquary dropping --- src/playermat/Playermat.ttslua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 37622ab8..0021a3bf 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -121,7 +121,8 @@ local slotNameToChar = { ["Hand (right)"] = "M", ["Hand (left)"] = "M", ["Hand x2"] = "N", - ["Tarot"] = "A" + ["Tarot"] = "A", + ["Blursed"] = "zy" } -- slot symbol for the respective slot (from top left to bottom right) - intentionally global! @@ -773,7 +774,7 @@ function createXML() raycastTarget = "false", -- this disables the click function temporarily onClick = "slotClickFunction", scale = "0.1 0.1 1", - width = "175", + width = "350", height = "175", position = x .. " " .. y .. " -11" }, @@ -1280,10 +1281,12 @@ function onCollisionEnter(collisionInfo) -- main uses spawning if inArea(localCardPos, MAIN_PLAY_AREA) and (md.type == "Asset" or md.type == "Event") then spawnTokensOrShowHelper(object) - if md.id == "02158" or id == "01694" then + if md.id == "02158" or md.id == "01694" then modifySlot("Ally", localCardPos) - elseif md.id == "02157" or id == "01695" then + elseif md.id == "02157" or md.id == "01695" then modifySlot("Accessory", localCardPos) + elseif md.id == "10132" then + modifySlot("Blursed", localCardPos) end end From 16d26dcbbb64ea2b96941bccbeb636920fc6fa36 Mon Sep 17 00:00:00 2001 From: Zerino Date: Thu, 14 Nov 2024 10:46:53 -0300 Subject: [PATCH 15/16] added Blursed slot icon for Occult Reliquary --- src/playermat/Playermat.ttslua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 0021a3bf..16297d03 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1286,7 +1286,7 @@ function onCollisionEnter(collisionInfo) elseif md.id == "02157" or md.id == "01695" then modifySlot("Accessory", localCardPos) elseif md.id == "10132" then - modifySlot("Blursed", localCardPos) + modifySlot("Blursed", localCardPos); end end From 1640b72bacfe307252bdd13cb5871e53088dd497 Mon Sep 17 00:00:00 2001 From: Zerino Date: Thu, 14 Nov 2024 10:48:49 -0300 Subject: [PATCH 16/16] added Directive and Miskatonic Archaeology Funding to modifySlot() --- src/playermat/Playermat.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 16297d03..b6901c9b 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1281,12 +1281,12 @@ function onCollisionEnter(collisionInfo) -- main uses spawning if inArea(localCardPos, MAIN_PLAY_AREA) and (md.type == "Asset" or md.type == "Event") then spawnTokensOrShowHelper(object) - if md.id == "02158" or md.id == "01694" then + if md.id == "02158" or md.id == "01694" or md.id == "90027" or md.id == "60232" then modifySlot("Ally", localCardPos) elseif md.id == "02157" or md.id == "01695" then modifySlot("Accessory", localCardPos) elseif md.id == "10132" then - modifySlot("Blursed", localCardPos); + modifySlot("Blursed", localCardPos) end end