diff --git a/config.json b/config.json index 34a4e973..cba85d5a 100644 --- a/config.json +++ b/config.json @@ -245,7 +245,7 @@ 0, 0 ], - "SaveName": "Arkham SCE - 4.0.2", + "SaveName": "Arkham SCE - 4.0.3", "Sky": "Sky_Museum", "SkyURL": "https://i.imgur.com/GkQqaOF.jpg", "SnapPoints_path": "SnapPoints.json", diff --git a/objects/PatchNotes.f47225.luascriptstate b/objects/PatchNotes.f47225.luascriptstate index c954022c..8fd6b615 100644 --- a/objects/PatchNotes.f47225.luascriptstate +++ b/objects/PatchNotes.f47225.luascriptstate @@ -85,7 +85,7 @@ }, "tooltip": "None", "value": [ - "Arkham Horror LCG SCE 4.0.2 - 11/21/2024" + "Arkham Horror LCG SCE 4.0.3 - 11/21/2024" ] }, { @@ -124,7 +124,7 @@ }, "tooltip": "None", "value": [ - "Changes from 4.0.2\n- added ability for 'number typing' to the chaos token draw button\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n" + "Changes from 4.0.3\n- added ability for 'number typing' to the chaos token draw button\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n" ] } ], diff --git a/src/core/Constants.ttslua b/src/core/Constants.ttslua index 2e0f6b4a..19accae4 100644 --- a/src/core/Constants.ttslua +++ b/src/core/Constants.ttslua @@ -34,6 +34,6 @@ ENCOUNTER_DECK_POS = Vector(-3.93, 1.5, 5.76) ENCOUNTER_DISCARD_POSITION = Vector(-3.85, 1.5, 10.38) -- online functionality related variables -MOD_VERSION = "4.0.2" +MOD_VERSION = "4.0.3" SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/latest/download/" --SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/download/v1.0.1/" diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 5a1ff71d..bfa5d381 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -85,7 +85,7 @@ function takeCardIntoThreatArea(playerColor, hoveredObject) -- work out the new rotation local matRotation = playermatApi.returnRotation(matColor) - local newCardRot = cardRot:setAt("y", matRotation.y + cardRot.y - ownerRotation.y) + local newCardRot = cardRot:setAt("y", roundToMultiple(matRotation.y + cardRot.y - ownerRotation.y, 45)) -- move the main card to threat area GlobalApi.moveCardWithTokens(hoveredObject, threatAreaPos, newCardRot) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 141c0ebb..8bb6ac04 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -221,7 +221,8 @@ function onObjectEnterZone(zone, object) not tokenChecker.isChaosToken(object) and object.type == "Tile" and object.getMemo() and - not object.getLock() then + not object.getLock() and + object.interactable == true then local matcolor = playermatApi.getMatColorByPosition(object.getPosition()) local trash = guidReferenceApi.getObjectByOwnerAndType(matcolor, "Trash") trash.putObject(object) @@ -303,6 +304,10 @@ function onPlayerAction(player, action, targets) end end +function onObjectPickUp(_, object) + stopTokenTransformUpdating(object) +end + --------------------------------------------------------- -- chaos token drawing --------------------------------------------------------- @@ -1590,8 +1595,8 @@ end -- first hit is the table surface, additional hits means something is there ---@return boolean: True if empty function checkPositionForContentSpawn(checkPos) - local searchResult = searchLib.atPosition(checkPos) - return #searchResult == 1 + local searchResult = searchLib.atPosition(checkPos, "isInteractable") + return #searchResult == 0 end -- downloading of the library file @@ -2846,9 +2851,8 @@ function moveCardWithTokens(params) local position = params.position local rotation = params.rotation - if not cardTokens[card] then - storeTokenTransform(card) - end + stopTokenTransformUpdating(card) + storeTokenTransform(card) if rotation then card.setRotation(rotation) @@ -2912,7 +2916,9 @@ function stopTokenTransformUpdating(card) end end cardTokens[card] = nil - card.use_hands = true + if card ~= nil then + card.use_hands = true + end end -- removes tokens from the provided card/deck @@ -2948,7 +2954,8 @@ function removeTokensFromObject(params) elseif obj.getGUID() ~= "4ee1f2" and -- table obj ~= self and obj.memo ~= nil and - obj.getLock() == false then + obj.getLock() == false and + obj.interactable == true then trash.putObject(obj) end end diff --git a/src/mythos/VictoryDisplay.ttslua b/src/mythos/VictoryDisplay.ttslua index d5ebe31b..2dda5d6e 100644 --- a/src/mythos/VictoryDisplay.ttslua +++ b/src/mythos/VictoryDisplay.ttslua @@ -303,7 +303,7 @@ function placeCard(card) -- put chaos tokens back into bag local chaosBag = chaosBagApi.findChaosBag() chaosBag.putObject(obj) - elseif obj.memo ~= nil and obj.getLock() == false then + elseif obj.memo ~= nil and obj.getLock() == false and obj.interactable == true then trash.putObject(obj) end end diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 76f04bae..fb3450fd 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -297,7 +297,7 @@ function discardListOfObjects(objList) elseif tokenChecker.isChaosToken(obj) then -- put chaos tokens back into bag (e.g. Unrelenting) chaosBagApi.returnChaosTokenToBag(obj, false) - elseif not obj.getLock() and not obj.hasTag("DontDiscard") then + elseif not obj.getLock() and not obj.hasTag("DontDiscard") and obj.interactable == true then -- don't touch locked objects (like the table etc.) or specific objects (like key tokens) ownedObjects.Trash.putObject(obj) end diff --git a/src/util/SearchLib.ttslua b/src/util/SearchLib.ttslua index 0e37a870..f5606901 100644 --- a/src/util/SearchLib.ttslua +++ b/src/util/SearchLib.ttslua @@ -6,6 +6,7 @@ do isCardOrDeck = function(x) return x.type == "Card" or x.type == "Deck" end, isClue = function(x) return x.memo == "clueDoom" and x.is_face_down == false end, isDoom = function(x) return x.memo == "clueDoom" and x.is_face_down == true end, + isInteractable = function(x) return x.interactable end, isTileOrToken = function(x) return x.type == "Tile" or x.type == "Generic" end, isUniversalToken = function(x) return x.getMemo() == "universalActionAbility" end, } @@ -31,7 +32,7 @@ do -- filter the result for matching objects local objList = {} for _, v in ipairs(searchResult) do - if (not filter or filterFunc(v.hit_object)) and v.hit_object.interactable then + if (not filter or filterFunc(v.hit_object)) then table.insert(objList, v.hit_object) end end