added different color handling

This commit is contained in:
Chr1Z93 2023-11-05 00:32:19 +01:00
parent 33334b4058
commit 762756430a

View File

@ -29,7 +29,9 @@ end
function contextFunc(playerColor, amount)
local options = Player.getAvailableColors()
table.insert(options, "Encounter")
table.insert(options, "Encounter Deck")
-- show the target selection dialog
Player[playerColor].showOptionsDialog("Select target deck", options, _,
function(owner)
drawCardsFromBottom(playerColor, owner, amount)
@ -44,10 +46,11 @@ function drawCardsFromBottom(playerColor, owner, amount)
local deckAreaObjects = {}
-- get the respective deck
if owner == "Encounter" then
if owner == "Encounter Deck" then
deck = mythosAreaApi.getEncounterDeck()
else
deckAreaObjects = playmatApi.getDeckAreaObjects(owner)
local matColor = playmatApi.getMatColor(owner)
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
deck = deckAreaObjects.draw
end