Fix consumables being usable without any selected cards

This commit is contained in:
Emik 2026-07-27 11:46:07 +02:00
parent 8edd1c1c73
commit 0267ed9ef7
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
3 changed files with 6 additions and 4 deletions

View file

@ -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",

View file

@ -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)

View file

@ -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)