Fix consumables being usable without any selected cards
This commit is contained in:
parent
8edd1c1c73
commit
9f19d85769
3 changed files with 6 additions and 4 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"id": "Roland",
|
||||
"name": "Roland",
|
||||
"prefix": "Roland",
|
||||
"version": "2.9.76",
|
||||
"version": "2.9.77",
|
||||
"badge_colour": "8BE9FD",
|
||||
"display_name": "Roland",
|
||||
"main_file": "src/main.lua",
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ spectral {
|
|||
return {vars = {card.ability.extra.amount}}
|
||||
end,
|
||||
can_use = function()
|
||||
return u() and #G.hand.cards > 0
|
||||
return next(G.hand.cards) and u()
|
||||
end,
|
||||
use = function(_, card, _)
|
||||
local cards = f(G.hand.cards):table()
|
||||
|
|
@ -132,7 +132,8 @@ spectral {
|
|||
return {vars = {card.ability.extra.amount}}
|
||||
end,
|
||||
can_use = function(_, card)
|
||||
return u() and #Bakery_API.get_highlighted() <= card.ability.extra.amount
|
||||
local count = #Bakery_API.get_highlighted()
|
||||
return u() and count > 0 and count <= card.ability.extra.amount
|
||||
end,
|
||||
use = function(_, _, _)
|
||||
f(Bakery_API.get_highlighted()):each(function(v)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,9 @@ q(SMODS.Consumable {
|
|||
end
|
||||
|
||||
local highlighted = Bakery_API.get_highlighted()
|
||||
local count = #G.jokers.highlighted + #highlighted
|
||||
|
||||
return #G.jokers.highlighted + #highlighted <= card.ability.extra.amount and
|
||||
return count > 0 and count <= card.ability.extra.amount and
|
||||
f(G.jokers.highlighted):concat(highlighted):all(function(v)
|
||||
return not v.edition
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue