support for multiple RBWs
This commit is contained in:
parent
208a29ff33
commit
22b60f38b3
@ -2,7 +2,6 @@
|
||||
"id": "02014",
|
||||
"type": "Asset",
|
||||
"class": "Neutral",
|
||||
"startsInPlay": true,
|
||||
"cost": 2,
|
||||
"traits": "Ally. Creature.",
|
||||
"cycle": "The Dunwich Legacy"
|
||||
|
@ -167,18 +167,20 @@ do
|
||||
--- if a weakness is added.
|
||||
internal.maybeDrawRandomWeakness = function(slots, playerColor)
|
||||
local allCardsBag = getObjectFromGUID(configuration.card_bag_guid)
|
||||
local hasRandomWeakness = false
|
||||
local randomWeaknessAmount = 0
|
||||
for cardId, cardCount in pairs(slots) do
|
||||
if cardId == RANDOM_WEAKNESS_ID then
|
||||
hasRandomWeakness = true
|
||||
randomWeaknessAmount = cardCount
|
||||
break
|
||||
end
|
||||
end
|
||||
if hasRandomWeakness then
|
||||
local weaknessId = allCardsBag.call("getRandomWeaknessId")
|
||||
slots[weaknessId] = 1
|
||||
slots[RANDOM_WEAKNESS_ID] = nil
|
||||
internal.maybePrint("Random basic weakness added to deck", playerColor)
|
||||
if randomWeaknessAmount ~= 0 then
|
||||
for i=1, randomWeaknessAmount do
|
||||
local weaknessId = allCardsBag.call("getRandomWeaknessId")
|
||||
slots[weaknessId] = 1
|
||||
slots[RANDOM_WEAKNESS_ID] = nil
|
||||
end
|
||||
internal.maybePrint("Added " .. randomWeaknessAmount .. " random basic weakness(es) to deck", playerColor)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user