-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharcades.lua
More file actions
378 lines (365 loc) · 13 KB
/
Copy patharcades.lua
File metadata and controls
378 lines (365 loc) · 13 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
SMODS.Atlas {
key = "wafflemod_arcadeAtlas",
path = "arcades.png",
px = 71,
py = 95,
}
SMODS.ConsumableType {
key = "wafflemod_arcade",
default = "c_wafflemod_pacman",
secondary_colour = HEX("403B87"),
primary_colour = HEX("B270D3"),
collection_rows = { 5, 5 },
shop_rate = 0,
select_card = "consumeables"
}
SMODS.UndiscoveredSprite {
key = "wafflemod_arcade",
atlas = "wafflemod_arcadeAtlas",
pos = { x = 0, y = 0 }
}
local function addArcadeHint(info_queue)
WaffleMod.addDisabledTooltip(info_queue, WaffleMod.config.arcade_cabinets.enabled)
if next(SMODS.find_card("j_perkeo")) then
info_queue[#info_queue + 1] = { key = 'wafflemod_arcade_hint_perkeo', set = 'Other', config = {} }
else
info_queue[#info_queue + 1] = { key = 'wafflemod_arcade_hint', set = 'Other', config = {} }
end
end
local doHeldEffects = WaffleMod.config.arcade_cabinets.held_effects
WaffleMod.ArcadeCabinet = SMODS.Consumable:extend {
set = "wafflemod_arcade",
atlas = "wafflemod_arcadeAtlas",
cost = 5,
keep_on_use = function(self, card)
return true
end,
}
-- (Sorted by release date)
-- Asteroids
-- Space Invaders (1979)
WaffleMod.ArcadeCabinet {
key = "space_invaders",
pos = { x = 3, y = 0 },
config = { extra = {
use_cost = 3,
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
return { vars = { card.ability.extra.use_cost } }
end,
can_use = function(self, card)
return G.consumeables and #G.consumeables.cards < G.consumeables.config.card_limit
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
return true
end
}))
delay(0.2)
ease_dollars(-card.ability.extra.use_cost)
SMODS.add_card { set = "Planet", area = G.consumeables }
end,
calculate = function(self, card, context)
if context.using_consumeable and context.consumeable.ability.set == "Planet" then
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
SMODS.smart_level_up_hand(card, WaffleMod.getRandomHand("wafflemod_space_invaders_hand"), false)
return true
end
}))
end
end
}
-- Pac-Man (1980)
WaffleMod.ArcadeCabinet {
key = "pacman",
pos = { x = 1, y = 0 },
config = { extra = {
conv_enhancement = "m_wild",
use_cost = 3,
xmult = 1.75,
suit_cache = {},
scored_wilds = {},
num_scored_suits = 0
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
info_queue[#info_queue + 1] = G.P_CENTERS[card.ability.extra.conv_enhancement]
return { vars = { card.ability.extra.use_cost, card.ability.extra.xmult } }
end,
can_use = function(self, card)
return G.hand and #G.hand.highlighted == 1 and WaffleMod.canAfford(card.ability.extra.use_cost)
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
return true
end
}))
WaffleMod.flipFunctionCards(G.hand.highlighted, function(c)
c:set_ability(card.ability.extra.conv_enhancement)
end)
delay(0.2)
ease_dollars(-card.ability.extra.use_cost)
end,
calculate = function(self, card, context)
local extra = card.ability.extra
if context.before then
extra.scored_wilds = {}
extra.num_scored_suits = 0
extra.suit_cache = {}
end
if context.individual and context.cardarea == G.play then
local isWild = SMODS.has_enhancement(context.other_card, "m_wild")
if isWild then
if extra.num_scored_suits < WaffleMod.getSuitCount() and not extra.scored_wilds[context.other_card] then
extra.scored_wilds[context.other_card] = true
extra.num_scored_suits = extra.num_scored_suits + 1
return {
xmult = card.ability.extra.xmult
}
end
extra.suit_cache.wildCount = (extra.suit_cache.wildCount or 0) + 1
elseif not SMODS.has_no_suit(context.other_card) and not extra.suit_cache[context.other_card.base.suit] and extra.num_scored_suits < WaffleMod.getSuitCount() then
extra.suit_cache[context.other_card.base.suit] = true
extra.num_scored_suits = extra.num_scored_suits + 1
return {
xmult = card.ability.extra.xmult
}
end
end
end
}
-- Dig Dug (February 1982)
WaffleMod.ArcadeCabinet {
key = "dig_dug",
pos = { x = 2, y = 0 },
config = { extra = {
target_enhancement = "m_stone",
use_cost = 3,
target_interval = 3,
cards_needed = 3
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
info_queue[#info_queue + 1] = G.P_CENTERS[card.ability.extra.target_enhancement]
return { vars = { card.ability.extra.use_cost, card.ability.extra.target_interval, card.ability.extra.cards_needed } }
end,
can_use = function(self, card)
return G.hand and #G.hand.highlighted == 1 and WaffleMod.canAfford(card.ability.extra.use_cost)
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
return true
end
}))
WaffleMod.flipFunctionCards(G.hand.highlighted, function(c)
c:set_ability(card.ability.extra.target_enhancement)
end)
delay(0.2)
ease_dollars(-card.ability.extra.use_cost)
end,
calculate = function(self, card, context)
local extra = card.ability.extra
if context.individual and SMODS.has_enhancement(context.other_card, "m_stone") then
extra.cards_needed = math.max(extra.cards_needed - 1, 0)
if extra.cards_needed <= 0 and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
--print("make tarot lalalala")
extra.cards_needed = card.ability.extra.target_interval
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
return {
extra = {
message = localize('k_plus_tarot'),
message_card = card,
colour = G.C.PURPLE,
func = function()
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card {
set = 'Tarot',
key_append = 'wafflemod_dig_dug'
}
G.GAME.consumeable_buffer = 0
return true
end
}))
end
}
}
end
end
end
}
-- Joust (July 1982)
WaffleMod.ArcadeCabinet {
key = "joust",
pos = {x = 6, y = 0},
config = { extra = {
use_cost = 3,
price = 3 -- egg on vremade uses this terminology, soooo :b
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
return { vars = { card.ability.extra.use_cost, card.ability.extra.price } }
end,
can_use = function(self, card)
local anyCardsWithRankInHand = false
for i = 1, #G.hand.cards do
if not SMODS.has_no_rank(G.hand.cards[i]) then
anyCardsWithRankInHand = true
end
end
return WaffleMod.canAfford(card.ability.extra.use_cost) and anyCardsWithRankInHand
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
local tempId = 15
local destroyThisCard = nil
for i = 1, #G.hand.cards do
if not SMODS.has_no_rank(G.hand.cards[i]) and tempId >= G.hand.cards[i]:get_id() then
tempId = G.hand.cards[i].base.id
destroyThisCard = G.hand.cards[i]
end
end
if destroyThisCard then
SMODS.destroy_cards(destroyThisCard)
end
return true
end
}))
ease_dollars(-card.ability.extra.use_cost)
end,
calculate = function(self, card, context)
if doHeldEffects then
if WaffleMod.endOfRoundContext(context) then
card.ability.extra_value = card.ability.extra_value or 0 + card.ability.extra.price
card:set_cost()
return {
message = localize('k_val_up'),
colour = G.C.MONEY
}
end
end
end
}
-- Metro-Cross (May 1985)
WaffleMod.ArcadeCabinet {
key = "metro_cross",
pos = { x = 5, y = 0 },
config = { extra = {
create_set = "Spectral",
use_cost = 3,
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
return { vars = { card.ability.extra.use_cost } }
end,
can_use = function(self, card)
return WaffleMod.canAfford(card.ability.extra.use_cost)
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
add_tag(Tag(WaffleMod.selectRandomTag()))
play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
return true
end
}))
ease_dollars(-card.ability.extra.use_cost)
end,
calculate = function(self, card, context)
if context.skip_blind then
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
func = (function()
SMODS.add_card {
set = card.ability.extra.create_set,
key_append = 'wafflemod_metro_cross'
}
G.GAME.consumeable_buffer = 0
return true
end)
}))
return {
message = localize('k_plus_spectral'),
colour = G.C.SECONDARY_SET.Spectral,
remove = true
}
end
end
end
}
-- Polybius (???)
WaffleMod.ArcadeCabinet {
key = "polybius",
set = "Spectral",
atlas = "wafflemod_arcadeAtlas",
pos = { x = 4, y = 0 },
cost = 10,
config = { extra = {
edition = "e_negative",
use_cost = 6,
mult = 6
} },
loc_vars = function(self, info_queue, card)
addArcadeHint(info_queue)
info_queue[#info_queue + 1] = { key = 'e_negative_playing_card', set = 'Edition', config = { extra = 1 } }
return { vars = { card.ability.extra.use_cost, card.ability.extra.mult } }
end,
hidden = true,
soul_set = "wafflemod_arcade",
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = "0.2",
blocking = false,
func = function()
card:juice_up()
G.hand.highlighted[1]:set_edition("e_negative")
ease_dollars(-card.ability.extra.use_cost)
return true
end
}))
end,
can_use = function(self, card)
return G.hand and #G.hand.highlighted == 1 and WaffleMod.canAfford(card.ability.extra.use_cost) and
not G.hand.highlighted[1].edition
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card.edition and context.other_card.edition.key == "e_negative" then
return { mult = card.ability.extra.mult }
end
end,
in_pool = function()
return WaffleMod.config.arcade_cabinets.enabled
end
}