From aafc10965bd4fcc067d6a09de4b914e14af075a2 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 18 Aug 2024 10:44:05 +0200 Subject: [PATCH] Removed DES handling from playermat --- src/playermat/Playermat.ttslua | 21 --------------------- src/playermat/PlayermatApi.ttslua | 17 ----------------- 2 files changed, 38 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 78f6a129..4f1696c0 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -136,7 +136,6 @@ local defaultSlotData = { } local activeInvestigatorData = {} -local hasDES = false local isClassTextureEnabled = true local isDrawButtonVisible = false local optionPanelVisibility = "" @@ -339,7 +338,6 @@ function doUpkeep(_, clickedByColor, isRightClick) updateMessageColor(clickedByColor) -- unexhaust cards in play zone, flip action tokens and find Forced Learning / Dream-Enhancing Serum - checkForDES() local forcedLearning = false local rot = self.getRotation() for _, obj in ipairs(searchAroundSelf()) do @@ -653,23 +651,6 @@ function concatenateListOfStrings(list) return cardList end --- checks if DES is present -function checkForDES() - hasDES = false - for _, obj in ipairs(searchAroundSelf()) do - if obj.type == "Card" then - local cardMetadata = JSON.decode(obj.getGMNotes()) or {} - - -- position is used to exclude deck / discard - local cardPos = self.positionToLocal(obj.getPosition()) - if cardMetadata.id == "06159" and cardPos.x > -1 then - hasDES = true - break - end - end - end -end - --------------------------------------------------------- -- XML creation and modifying --------------------------------------------------------- @@ -1568,5 +1549,3 @@ end function getActiveInvestigatorData() return activeInvestigatorData end function setActiveInvestigatorData(newData) activeInvestigatorData = newData end - -function getDES() return hasDES end diff --git a/src/playermat/PlayermatApi.ttslua b/src/playermat/PlayermatApi.ttslua index 35d6b941..313f0778 100644 --- a/src/playermat/PlayermatApi.ttslua +++ b/src/playermat/PlayermatApi.ttslua @@ -48,23 +48,6 @@ do end end - -- Instructs a playermat to check for DES - ---@param matColor string Color of the playermat - White, Orange, Green, Red or All - PlayermatApi.checkForDES = function(matColor) - for _, mat in pairs(getMatForColor(matColor)) do - mat.call("checkForDES") - end - end - - -- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat - ---@param matColor string Color of the playermat - White, Orange, Green or Red (does not support "All") - ---@return boolean: whether DES is present on the playermat - PlayermatApi.hasDES = function(matColor) - for _, mat in pairs(getMatForColor(matColor)) do - return mat.call("getDES") - end - end - -- gets the slot data for the playermat ---@param matColor string Color of the playermat - White, Orange, Green or Red (does not support "All") PlayermatApi.getSlotData = function(matColor)