Exclude custom sigs from weakness spread

This commit is contained in:
Chr1Z93 2024-09-19 18:50:08 +02:00
parent c20d747921
commit f5b60223bb

View File

@ -800,13 +800,22 @@ function spawnWeaknesses()
prepareToPlaceCards()
-- exclude custom signature weaknesses
local customExcludeList = {}
local customInvestigatorData = allCardsBagApi.getCustomInvestigatorData()
for investigatorId, invdata in pairs(customInvestigatorData.InvestigatorSubdata or {}) do
for _, cardId in ipairs(invdata.signatures or {}) do
customExcludeList[cardId] = true
end
end
local basicWeaknessList = {}
local otherWeaknessList = {}
for _, id in ipairs(allCardsBagApi.getUniqueWeaknesses()) do
local cardMetadata = allCardsBagApi.getCardById(id).metadata
if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount > 0 then
table.insert(basicWeaknessList, id)
elseif excludedNonBasicWeaknesses[id] == nil then
elseif excludedNonBasicWeaknesses[id] == nil and customExcludeList[id] == nil then
table.insert(otherWeaknessList, id)
end
end