From c8cec711094b01535d0df2794a6e87b1f01f9d10 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Tue, 13 Dec 2022 02:15:16 -0800 Subject: [PATCH] Handle review comments --- src/arkhamdb/DeckImporterMain.ttslua | 8 ++++++-- src/core/PlayArea.ttslua | 17 +++-------------- src/core/PlayAreaApi.ttslua | 17 +++-------------- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index 88989e68..4d568269 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -151,7 +151,7 @@ local function onDeckResult(deck, playerColor, configuration) maybeAddInvestigatorCards(deck, slots) maybeAddCustomizeUpgradeSheets(slots, configuration) maybeAddSummonedServitor(slots) - maybeAddOnTheMend(slots) + maybeAddOnTheMend(slots, playerColor) extractBondedCards(slots, configuration) checkTaboos(deck.taboo_id, slots, playerColor, configuration) @@ -257,11 +257,15 @@ end -- the count based on the investigator count ---@param slots: The slot list for cards in this deck. Table key is the cardId, value is the number -- of those cards which will be spawned -function maybeAddOnTheMend(slots) +---@param playerColor: Color name of the player this deck is being loaded for. Used for broadcast if an error occurs +function maybeAddOnTheMend(slots, playerColor) if slots["09006"] ~= nil then local investigatorCount = playAreaApi.getInvestigatorCount() if investigatorCount ~= nil then slots["09006"] = investigatorCount + else + debugPrint("Something went wrong with the load, adding 4 copies of On the Mend", Priority.INFO, playerColor) + slots["09006"] = 4 end end end diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 1216e429..adf67ee9 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -136,34 +136,23 @@ function onCollisionEnter(collision_info) end end --- Move all contents on the play area (cards, tokens, etc) one row up. Certain fixed objects will --- be ignored, as will anything the player has tagged with 'displacement_excluded' +-- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain +-- fixed objects will be ignored, as will anything the player has tagged with +-- 'displacement_excluded' ---@param playerColor Color of the player requesting the shift. Used solely to send an error --- message in the unlikely case that the scripting zone has been deleted function shiftContentsUp(playerColor) shiftContents(playerColor, "up") end --- Move all contents on the play area (cards, tokens, etc) one row down. Certain fixed objects --- will be ignored, as will anything the player has tagged with 'displacement_excluded' ----@param playerColor Color of the player requesting the shift. Used solely to send an error ---- message in the unlikely case that the scripting zone has been deleted function shiftContentsDown(playerColor) shiftContents(playerColor, "down") end --- Move all contents on the play area (cards, tokens, etc) one column left. Certain fixed objects --- will be ignored, as will anything the player has tagged with 'displacement_excluded' ----@param playerColor Color of the player requesting the shift. Used solely to send an error ---- message in the unlikely case that the scripting zone has been deleted function shiftContentsLeft(playerColor) shiftContents(playerColor, "left") end --- Move all contents on the play area (cards, tokens, etc) one column right. Certain fixed --- objects will be ignored, as will anything the player has tagged with 'displacement_excluded' ----@param playerColor Color of the player requesting the shift. Used solely to send an error ---- message in the unlikely case that the scripting zone has been deleted function shiftContentsRight(playerColor) shiftContents(playerColor, "right") end diff --git a/src/core/PlayAreaApi.ttslua b/src/core/PlayAreaApi.ttslua index 0107085d..1fd9d54a 100644 --- a/src/core/PlayAreaApi.ttslua +++ b/src/core/PlayAreaApi.ttslua @@ -9,34 +9,23 @@ do return getObjectFromGUID(PLAY_AREA_GUID).call("getInvestigatorCount") end - -- Move all contents on the play area (cards, tokens, etc) one row up. Certain fixed objects will - -- be ignored, as will anything the player has tagged with 'displacement_excluded' + -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain + -- fixed objects will be ignored, as will anything the player has tagged with + -- 'displacement_excluded' ---@param playerColor Color of the player requesting the shift. Used solely to send an error --- message in the unlikely case that the scripting zone has been deleted PlayAreaApi.shiftContentsUp = function(playerColor) return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsUp", playerColor) end - -- Move all contents on the play area (cards, tokens, etc) one row down. Certain fixed objects - -- will be ignored, as will anything the player has tagged with 'displacement_excluded' - ---@param playerColor Color of the player requesting the shift. Used solely to send an error - --- message in the unlikely case that the scripting zone has been deleted PlayAreaApi.shiftContentsDown = function(playerColor) return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsDown", playerColor) end - -- Move all contents on the play area (cards, tokens, etc) one column left. Certain fixed objects - -- will be ignored, as will anything the player has tagged with 'displacement_excluded' - ---@param playerColor Color of the player requesting the shift. Used solely to send an error - --- message in the unlikely case that the scripting zone has been deleted PlayAreaApi.shiftContentsLeft = function(playerColor) return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsLeft", playerColor) end - -- Move all contents on the play area (cards, tokens, etc) one column right. Certain fixed - -- objects will be ignored, as will anything the player has tagged with 'displacement_excluded' - ---@param playerColor Color of the player requesting the shift. Used solely to send an error - --- message in the unlikely case that the scripting zone has been deleted PlayAreaApi.shiftContentsRight = function(playerColor) return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsRight", playerColor) end