Merge pull request #83 from argonui/servitor-bugfix

DeckImporter: Summoned Servitor (Dominance) - BUGFIX
This commit is contained in:
Chr1Z 2022-12-06 22:42:33 +01:00 committed by GitHub
commit 477074cc20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,32 +2,32 @@ require("playermat/Zones")
require("arkhamdb/LoaderUi") require("arkhamdb/LoaderUi")
require("playercards/PlayerCardSpawner") require("playercards/PlayerCardSpawner")
local bondedList = { } local bondedList = {}
local customizationRowsWithFields = { } local customizationRowsWithFields = {}
-- inputMap maps from (our 1-indexes) customization row index to inputValue table index -- inputMap maps from (our 1-indexes) customization row index to inputValue table index
-- The Raven Quill -- The Raven Quill
customizationRowsWithFields["09042"] = { } customizationRowsWithFields["09042"] = {}
customizationRowsWithFields["09042"].inputCount = 2 customizationRowsWithFields["09042"].inputCount = 2
customizationRowsWithFields["09042"].inputMap = { } customizationRowsWithFields["09042"].inputMap = {}
customizationRowsWithFields["09042"].inputMap[1] = 1 customizationRowsWithFields["09042"].inputMap[1] = 1
customizationRowsWithFields["09042"].inputMap[5] = 2 customizationRowsWithFields["09042"].inputMap[5] = 2
-- Friends in Low Places -- Friends in Low Places
customizationRowsWithFields["09060"] = { } customizationRowsWithFields["09060"] = {}
customizationRowsWithFields["09060"].inputCount = 2 customizationRowsWithFields["09060"].inputCount = 2
customizationRowsWithFields["09060"].inputMap = { } customizationRowsWithFields["09060"].inputMap = {}
customizationRowsWithFields["09060"].inputMap[1] = 1 customizationRowsWithFields["09060"].inputMap[1] = 1
customizationRowsWithFields["09060"].inputMap[3] = 2 customizationRowsWithFields["09060"].inputMap[3] = 2
-- Living Ink -- Living Ink
customizationRowsWithFields["09079"] = { } customizationRowsWithFields["09079"] = {}
customizationRowsWithFields["09079"].inputCount = 3 customizationRowsWithFields["09079"].inputCount = 3
customizationRowsWithFields["09079"].inputMap = { } customizationRowsWithFields["09079"].inputMap = {}
customizationRowsWithFields["09079"].inputMap[1] = 1 customizationRowsWithFields["09079"].inputMap[1] = 1
customizationRowsWithFields["09079"].inputMap[5] = 2 customizationRowsWithFields["09079"].inputMap[5] = 2
customizationRowsWithFields["09079"].inputMap[6] = 3 customizationRowsWithFields["09079"].inputMap[6] = 3
-- Grizzled -- Grizzled
customizationRowsWithFields["09101"] = { } customizationRowsWithFields["09101"] = {}
customizationRowsWithFields["09101"].inputCount = 3 customizationRowsWithFields["09101"].inputCount = 3
customizationRowsWithFields["09101"].inputMap = { } customizationRowsWithFields["09101"].inputMap = {}
customizationRowsWithFields["09101"].inputMap[1] = 1 customizationRowsWithFields["09101"].inputMap[1] = 1
customizationRowsWithFields["09101"].inputMap[2] = 2 customizationRowsWithFields["09101"].inputMap[2] = 2
customizationRowsWithFields["09101"].inputMap[3] = 3 customizationRowsWithFields["09101"].inputMap[3] = 3
@ -238,7 +238,7 @@ function maybeAddCustomizeUpgradeSheets(slots, configuration)
-- upgrade sheets for customizable cards -- upgrade sheets for customizable cards
local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" }) local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" })
if upgradesheet ~= nil then if upgradesheet ~= nil then
slots[cardId.."-c"] = 1 slots[cardId .. "-c"] = 1
end end
end end
end end
@ -470,7 +470,7 @@ function convertRavenQuillSelections(selectionString)
if (string.len(selectionString) == 5) then if (string.len(selectionString) == 5) then
return getCardName(selectionString) return getCardName(selectionString)
elseif (string.len(selectionString) == 11) then elseif (string.len(selectionString) == 11) then
return getCardName(string.sub(selectionString, 1, 5))..", "..getCardName(string.sub(selectionString, 7)) return getCardName(string.sub(selectionString, 1, 5)) .. ", " .. getCardName(string.sub(selectionString, 7))
end end
end end
@ -497,7 +497,7 @@ function buildZoneLists(cards)
local zoneList = {} local zoneList = {}
for _, card in ipairs(cards) do for _, card in ipairs(cards) do
if zoneList[card.zone] == nil then if zoneList[card.zone] == nil then
zoneList[card.zone] = { } zoneList[card.zone] = {}
end end
table.insert(zoneList[card.zone], card) table.insert(zoneList[card.zone], card)
end end
@ -689,9 +689,8 @@ function handleCustomizableUpgrades(cardList, customizations)
markedBoxes[index] = tonumber(str) markedBoxes[index] = tonumber(str)
elseif counter == 3 and str ~= "" then elseif counter == 3 and str ~= "" then
if (baseId == "09042") then if (baseId == "09042") then
inputValues[customizationRowsWithFields[baseId].inputMap[index]] = inputValues[customizationRowsWithFields[baseId].inputMap[index]] = convertRavenQuillSelections(str)
convertRavenQuillSelections(str) elseif customizationRowsWithFields[baseId] ~= nil then
else
inputValues[customizationRowsWithFields[baseId].inputMap[index]] = str inputValues[customizationRowsWithFields[baseId].inputMap[index]] = str
end end
end end