From 414006270641bf0dc366a6f388b06e0c9996be4c Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 26 Aug 2023 10:27:23 +0200 Subject: [PATCH] spawn reality acid sheet dynamically --- .../RealityAcidReference.858b0a.gmnotes | 7 +++++++ .../RealityAcidReference.858b0a.json | 2 +- src/arkhamdb/ArkhamDb.ttslua | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.gmnotes diff --git a/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.gmnotes b/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.gmnotes new file mode 100644 index 00000000..06069c32 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "89005", + "type": "Story", + "class": "Neutral", + "permanent": true, + "cycle": "Standalone" +} diff --git a/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.json b/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.json index 9dd6fe0c..614b104a 100644 --- a/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.json +++ b/objects/AllPlayerCards.15bb07/RealityAcidReference.858b0a.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\r\n \"id\": \"89005\",\r\n \"type\": \"Story\",\r\n \"cycle\": \"Standalone\"\r\n}\r", + "GMNotes_path": "AllPlayerCards.15bb07/RealityAcidReference.858b0a.gmnotes", "GUID": "858b0a", "Grid": true, "GridProjection": false, diff --git a/src/arkhamdb/ArkhamDb.ttslua b/src/arkhamdb/ArkhamDb.ttslua index 7b8e266e..9cdd456c 100644 --- a/src/arkhamdb/ArkhamDb.ttslua +++ b/src/arkhamdb/ArkhamDb.ttslua @@ -146,6 +146,7 @@ do internal.maybeAddCustomizeUpgradeSheets(slots) internal.maybeAddSummonedServitor(slots) internal.maybeAddOnTheMend(slots, playerColor) + internal.maybeAddRealityAcidReference(slots) local bondList = internal.extractBondedCards(slots) internal.checkTaboos(deck.taboo_id, slots, playerColor) @@ -280,6 +281,15 @@ do end end + -- Process the card list looking for Reality Acid and adds the reference sheet when needed + ---@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.maybeAddRealityAcidReference = function(slots) + if slots["89004"] ~= nil then + slots["89005"] = 1 + end + end + -- 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)