-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditions.lua
More file actions
76 lines (74 loc) · 3.03 KB
/
Copy patheditions.lua
File metadata and controls
76 lines (74 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SMODS.Shader {
key = "ephemeral",
path = "ephemeral.fs"
}
-- Ephemeral
-- +1 hand size/joker or consumable slot, self-destructs when played, discarded, used, or at end of round
SMODS.Edition {
key = "ephemeral",
shader = "ephemeral",
config = { card_limit = 1 },
disable_base_shader = true,
loc_vars = function(self, info_queue, card)
if card.ability and card.ability.set == "Joker" then
info_queue[#info_queue] = { key = 'e_wafflemod_ephemeral_joker', set = 'Edition', config = {} }
elseif card.config and (card.config.center.pools or {}).Consumeables then
info_queue[#info_queue] = { key = 'e_wafflemod_ephemeral_consumable', set = 'Edition', config = {} }
elseif card.ability and (card.ability.set == "Default" or card.ability.set == "Enhanced") then
info_queue[#info_queue] = { key = 'e_wafflemod_ephemeral_playing_card', set = 'Edition', config = {} }
else
info_queue[#info_queue] = { key = 'e_wafflemod_ephemeral', set = 'Edition', config = {} }
end
end,
-- on_apply = function (card)
-- card.sell_cost = 0
-- end,
calculate = function(self, card, context)
card.sell_cost = 0
if card.ability.set == "Default" then
if context.discard and card == context.other_card then
card:start_dissolve()
end
if context.destroy_card and context.cardarea == G.play and card == context.destroy_card then
return { remove = true }
end
elseif card.ability.set == "Joker" then
if context.round_eval then
G.E_MANAGER:add_event(Event({
trigger = "immediate",
func = function()
SMODS.destroy_cards(card)
return true
end
}))
end
else
if WaffleMod.endOfRoundContext(context) then
G.E_MANAGER:add_event(Event({
trigger = "immediate",
func = function()
SMODS.destroy_cards(card)
return true
end
}))
end
end
end
}
-- destroy ephemeral cards in deck at end of round
WaffleMod.bindToModCalculate(function(context)
if WaffleMod.endOfRoundContext(context) then
for _, v in pairs(G.hand.cards) do
if v.edition and ((v.edition.key == "e_wafflemod_ephemeral") or v.edition.wafflemod_ephemeral) then
v:remove_from_deck() -- looks redundant but i'm pretty sure prevents ghost cards from causing weird deck miscounts
SMODS.destroy_cards(v, {immediate = true})
end
end
for _, v in pairs(G.playing_cards) do
if v.edition and ((v.edition.key == "e_wafflemod_ephemeral") or v.edition.wafflemod_ephemeral) then
v:remove_from_deck()
SMODS.destroy_cards(v, {immediate = true})
end
end
end
end)