-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjokers.lua
More file actions
180 lines (170 loc) · 5.44 KB
/
jokers.lua
File metadata and controls
180 lines (170 loc) · 5.44 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
SMODS.Atlas{
key = 'jokers',
path = 'Jokers.png',
px = 71,
py = 95,
-- 2x is 144 by 190
}
SMODS.Joker:take_ownership('perkeo', -- object key (class prefix not required)
{ -- table of properties to change from the existing object
rarity = 'Perkolator_Perkeo_R',
},
true -- silent | suppresses mod badge
)
SMODS.Joker{
key = 'PerkOlator',
atlas = 'jokers',
pos = {x = 0, y = 0},
soul_pos = { x = 0, y = 1 },
blueprint_compat = true,
rarity = 'Perkolator_Perkeo_R',
loc_vars = function (self, info_queue, card)
--info_queue[#info_queue+1] = G.P_CENTERS.j_perkeo
info_queue[#info_queue+1] = G.P_CENTERS.e_negative
end,
calculate = function (self,card,context)
if context.ending_shop then
G.E_MANAGER:add_event(Event({
func = function()
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card({key='j_perkeo', edition='e_negative'})
return true
end
}))
return true
end
}))
return {
message = "Perkeo!",
colour = HEX('56a786')
}
end
end
}
SMODS.Joker{
key = 'Perkmentia',
atlas = 'jokers',
pos = {x = 1, y = 0},
rarity = 'Perkolator_Perkeo_R',
blueprint_compat = true,
calculate = function (self,card,context)
if context.ending_shop and context.main_eval then
local card = pseudorandom_element(G.consumeables.cards, pseudoseed('Perkmentia'))
if card then
G.E_MANAGER:add_event(Event({
func = function()
card:start_dissolve()
local consumable_types = {'Tarot','Spectral','Planet'}
SMODS.add_card({set = pseudorandom_element(consumable_types, pseudoseed('Perkmentia')), area = G.consumeables, edition = 'e_negative' })
SMODS.add_card({set = pseudorandom_element(consumable_types, pseudoseed('Perkmentia')), area = G.consumeables, edition = 'e_negative' })
return true
end
}))
end
return {
message = "What?",
colour = HEX('56a786')
}
end
end
}
SMODS.Joker{
key = 'PNA',
atlas = 'jokers',
pos = {x = 1, y = 1},
rarity = 'Perkolator_Perkeo_R',
blueprint_compat = true,
calculate = function (self,card,context)
if context.first_hand_drawn and not context.blueprint then
local eval = function() return G.GAME.current_round.hands_played == 0 end
juice_card_until(card, eval, true)
end
if context.cardarea == G.jokers and context.before then
if #context.full_hand == 1 and G.GAME.current_round.hands_played == 0 then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local _card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
_card:set_edition('e_negative', true)
_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, _card)
G.hand:emplace(_card)
_card.states.visible = nil
G.E_MANAGER:add_event(Event({
func = function()
_card:start_materialize()
return true
end
}))
return {
message = "DUPLICATED",
colour = HEX('56a786'),
playing_cards_created = {true}
}
end
end
end
}
SMODS.Joker{
key = "Perkeo_Template",
atlas = 'jokers',
rarity = "Perkolator_Perkeo_R",
pos = {x = 2, y = 0},
config = { extra = { Xmult_mod = 1,Xmult = 2} },
loc_vars = function(self,info_queue,card)
return { vars = {card.ability.extra.Xmult_mod, card.ability.extra.Xmult} }
end,
calculate = function (self,card,context)
if context.card_added then
sendDebugMessage("test", "perkeo")
end
if context.card_added and context.card.ability.consumeable and context.card.edition and not context.blueprint then
sendDebugMessage("test", "perkeo")
if context.card.edition.type == 'negative' then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_mod
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult,card.ability.extra.Xmult_mod } },
colour = G.C.MULT
}
end
end
if context.joker_main then
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
Xmult_mod = card.ability.extra.Xmult
}
end
end
}
SMODS.Joker{
key = 'perkomon',
rarity = "Perkolator_Perkeo_R",
atlas = 'jokers',
pos = {x = 3, y = 0},
config = {extra = {Xmult = 2}},
loc_vars = function(self,info_queue,card)
return { vars = {card.ability.extra.Xmult} }
end,
calculate = function (self,card,context)
if context.other_joker and context.other_joker.config.center.rarity == "Perkolator_Perkeo_R" and card ~= context.other_joker then
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
Xmult_mod = card.ability.extra.Xmult
}
end
end
}
SMODS.Joker{
key = 'just_the_perks',
atlas = 'jokers',
pos = {x = 2, y = 1},
rarity = "Perkolator_Perkeo_R",
calculate = function (self,card,context)
if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= card and (context.other_card.config.center.rarity == "Perkolator_Perkeo_R" or context.other_card.config.center.key == "j_perkeo") then
return {
message = localize('k_again_ex'),
repetitions = 1,
}
end
end,
}