-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspectrals.lua
88 lines (86 loc) · 2.99 KB
/
spectrals.lua
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
77
78
79
80
81
82
83
84
85
86
87
88
SMODS.Consumable({
key = "negative_space",
set = "Spectral",
pos = { x = 0, y = 0 },
hidden = true,
soul_set = "index",
atlas = "spectrals",
config = { multiplier = 1 },
loc_vars = function(self, info_queue, card)
table.insert(info_queue, { key = "eternal", set = "Other", vars = {} })
table.insert(info_queue, G.P_CENTERS.e_negative)
return { vars = { card.ability.multiplier } }
end,
can_use = function(self, card)
return true
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.4,
func = function()
for _ = 1, G.jokers.config.card_limit * card.ability.multiplier, 1 do
local key
repeat
local _pool, _pool_key = get_current_pool("Joker")
key = pseudorandom_element(_pool, pseudoseed(_pool_key))
until G.P_CENTERS[key] and G.P_CENTERS[key].eternal_compat
SMODS.add_card({ key = key, no_edition = true, edition = "e_negative", stickers = { "eternal" } })
end
play_sound("timpani")
return true
end
}))
end,
})
local function pulsar_target()
local most, played
for k, v in ipairs(G.handlist) do
if G.GAME.hands[v].visible then
if not played or G.GAME.hands[v].played > played then
most = v
played = G.GAME.hands[v].played
end
end
end
return most
end
SMODS.Consumable({
key = "pulsar",
set = "Spectral",
pos = { x = 1, y = 0 },
hidden = true,
soul_set = "Planet",
atlas = "spectrals",
config = { factor = 2 },
loc_vars = function(self, info_queue, card)
local mult_text
if card.ability.factor == 2 then
mult_text = "Double"
elseif card.ability.factor == 3 then
mult_text = "Triple"
elseif card.ability.factor == 4 then
mult_text = "Quadruple"
else
mult_text = "X" .. card.ability.factor .. " to"
end
return { vars = { mult_text, localize(pulsar_target(), "poker_hands") } }
end,
can_use = function(self, card)
return true
end,
use = function(self, card, area, copier)
local hand_key = pulsar_target()
local hand_center = G.GAME.hands[hand_key]
update_hand_text({ sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3 },
{
handname = localize(hand_key, 'poker_hands'),
chips = hand_center.chips,
mult = hand_center.mult,
level = hand_center.level
})
level_up_hand(card, hand_key, false, hand_center.level * (card.ability.factor - 1))
update_hand_text({ sound = 'button', volume = 0.7, pitch = 1.1, delay = 0 },
{ mult = 0, chips = 0, handname = '', level = '' })
end,
})