Removed DES handling from playermat

This commit is contained in:
Chr1Z93 2024-08-18 10:44:05 +02:00
parent 581abdf868
commit aafc10965b
2 changed files with 0 additions and 38 deletions

View File

@ -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

View File

@ -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)