bugfix for 'dominance'

This commit is contained in:
Chr1Z93 2022-12-06 11:09:47 +01:00
parent 97b3dd4ce5
commit b03aee593d

View File

@ -2,32 +2,32 @@ require("playermat/Zones")
require("arkhamdb/LoaderUi")
require("playercards/PlayerCardSpawner")
local bondedList = { }
local customizationRowsWithFields = { }
local bondedList = {}
local customizationRowsWithFields = {}
-- inputMap maps from (our 1-indexes) customization row index to inputValue table index
-- The Raven Quill
customizationRowsWithFields["09042"] = { }
customizationRowsWithFields["09042"] = {}
customizationRowsWithFields["09042"].inputCount = 2
customizationRowsWithFields["09042"].inputMap = { }
customizationRowsWithFields["09042"].inputMap = {}
customizationRowsWithFields["09042"].inputMap[1] = 1
customizationRowsWithFields["09042"].inputMap[5] = 2
-- Friends in Low Places
customizationRowsWithFields["09060"] = { }
customizationRowsWithFields["09060"] = {}
customizationRowsWithFields["09060"].inputCount = 2
customizationRowsWithFields["09060"].inputMap = { }
customizationRowsWithFields["09060"].inputMap = {}
customizationRowsWithFields["09060"].inputMap[1] = 1
customizationRowsWithFields["09060"].inputMap[3] = 2
-- Living Ink
customizationRowsWithFields["09079"] = { }
customizationRowsWithFields["09079"] = {}
customizationRowsWithFields["09079"].inputCount = 3
customizationRowsWithFields["09079"].inputMap = { }
customizationRowsWithFields["09079"].inputMap = {}
customizationRowsWithFields["09079"].inputMap[1] = 1
customizationRowsWithFields["09079"].inputMap[5] = 2
customizationRowsWithFields["09079"].inputMap[6] = 3
-- Grizzled
customizationRowsWithFields["09101"] = { }
customizationRowsWithFields["09101"] = {}
customizationRowsWithFields["09101"].inputCount = 3
customizationRowsWithFields["09101"].inputMap = { }
customizationRowsWithFields["09101"].inputMap = {}
customizationRowsWithFields["09101"].inputMap[1] = 1
customizationRowsWithFields["09101"].inputMap[2] = 2
customizationRowsWithFields["09101"].inputMap[3] = 3
@ -235,7 +235,7 @@ function maybeAddCustomizeUpgradeSheets(slots, configuration)
-- upgrade sheets for customizable cards
local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" })
if upgradesheet ~= nil then
slots[cardId.."-c"] = 1
slots[cardId .. "-c"] = 1
end
end
end
@ -388,11 +388,11 @@ function loadCards(slots, investigatorId, customizations, playerColor, commandMa
spreadCallback = function(deck) deck.spread(spreadDistance) end
end
Spawner.spawnCards(
zoneCards,
deckPos,
Zones.getDefaultCardRotation(playerColor, zone),
true, -- Sort deck
spreadCallback)
zoneCards,
deckPos,
Zones.getDefaultCardRotation(playerColor, zone),
true, -- Sort deck
spreadCallback)
coroutine.yield(0)
end
@ -438,7 +438,7 @@ function convertRavenQuillSelections(selectionString)
if (string.len(selectionString) == 5) then
return getCardName(selectionString)
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
@ -465,7 +465,7 @@ function buildZoneLists(cards)
local zoneList = {}
for _, card in ipairs(cards) do
if zoneList[card.zone] == nil then
zoneList[card.zone] = { }
zoneList[card.zone] = {}
end
table.insert(zoneList[card.zone], card)
end
@ -657,9 +657,8 @@ function handleCustomizableUpgrades(cardList, customizations)
markedBoxes[index] = tonumber(str)
elseif counter == 3 and str ~= "" then
if (baseId == "09042") then
inputValues[customizationRowsWithFields[baseId].inputMap[index]] =
convertRavenQuillSelections(str)
else
inputValues[customizationRowsWithFields[baseId].inputMap[index]] = convertRavenQuillSelections(str)
elseif customizationRowsWithFields[baseId] ~= nil then
inputValues[customizationRowsWithFields[baseId].inputMap[index]] = str
end
end