Respect card editions
This commit is contained in:
parent
d0d81744a7
commit
e499747a6e
1 changed files with 9 additions and 3 deletions
|
|
@ -26,8 +26,8 @@ SMODS.Consumable {
|
||||||
return #G.playing_cards > 1 and can_use()
|
return #G.playing_cards > 1 and can_use()
|
||||||
end,
|
end,
|
||||||
use = function(_, _, _, _)
|
use = function(_, _, _, _)
|
||||||
local function calculate_joker(v)
|
local function destructible(v)
|
||||||
v:calculate_joker({remove_playing_cards = true, removed = G.playing_cards})
|
return not v.ability or not (v.ability.eternal or v.ability.cry_absolute)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function destroy(v)
|
local function destroy(v)
|
||||||
|
|
@ -46,7 +46,13 @@ SMODS.Consumable {
|
||||||
timer = 'REAL',
|
timer = 'REAL',
|
||||||
trigger = 'after',
|
trigger = 'after',
|
||||||
func = function()
|
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)
|
F.foreach(G.jokers.cards, calculate_joker)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue