diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ce3e11f5..0ee27f79 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": "Arkham SCE: Build", "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" @@ -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 +} 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/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index c045c928..761d86ed 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,26 @@ 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 usedMats = playermatApi.getUsedMatColors() + for _, matColor in ipairs(usedMats) do + playermatApi.doUpkeepFromHotkey(matColor, playerColor) + 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..34f2778f 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -514,7 +514,13 @@ end -- Readies all cards in the main playarea (both player cards, treacheries and enemies) function readyCards(player, clickType) - local playerColor = player.color + local playerColor + if player ~= nil then + playerColor = player.color + else + local existingPlayer = Player.getPlayers()[1] + playerColor = existingPlayer.color + end -- when right-clicked if clickType == "-2" then diff --git a/src/core/PlayAreaImageData.ttslua b/src/core/PlayAreaImageData.ttslua index 9198a4ef..a5b55d6e 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/" } }, @@ -637,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"] = { @@ -901,10 +903,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/" @@ -998,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/" 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 = { 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", } } diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 5cac623d..b6901c9b 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" }, @@ -1177,6 +1178,31 @@ 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.y = 0 + for snapId, snap in ipairs(slotSnaps) do + 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)) + 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 +1281,13 @@ 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" 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) + end end -- encounter types / committed skill cards in the threat area