Respect card editions

This commit is contained in:
Emik 2025-03-24 11:30:02 +01:00
parent d0d81744a7
commit e499747a6e
Signed by untrusted user who does not match committer: emik
GPG key ID: 09CDFF9E5703688D

View file

@ -26,8 +26,8 @@ SMODS.Consumable {
return #G.playing_cards > 1 and can_use()
end,
use = function(_, _, _, _)
local function calculate_joker(v)
v:calculate_joker({remove_playing_cards = true, removed = G.playing_cards})
local function destructible(v)
return not v.ability or not (v.ability.eternal or v.ability.cry_absolute)
end
local function destroy(v)
@ -46,7 +46,13 @@ SMODS.Consumable {
timer = 'REAL',
trigger = 'after',
func = function()
F.foreach(G.playing_cards, destroy)
local cards = F.filter(G.playing_cards, destructible)
local function calculate_joker(v)
v:calculate_joker({remove_playing_cards = true, removed = cards})
end
F.foreach(cards, destroy)
F.foreach(G.jokers.cards, calculate_joker)
return true
end