forked from MathIsFun0/Cryptid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlovely.toml
786 lines (743 loc) · 28.1 KB
/
lovely.toml
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
[manifest]
version = "1.0.0"
dump_lua = true
priority = -1
# Make the splash screen more jolly
# Requires "Custom Main Menu" config to be enabled
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_joker'])"
position = "after"
payload = '''
if Cryptid.enabled["Menu"] then
if Cryptid.enabled["M Jokers"] then
local mcard = {}
for k, _ in pairs(Cryptid.M_jokers) do
if G.P_CENTERS[k] then
mcard[#mcard + 1] = k
end
end
local option = math.random(#mcard)
local chosenoption = mcard[option]
if chosenoption == "j_cry_biggestm" or chosenoption == "j_cry_reverse" then --These don't render properly; replace these with loopy instead
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_cry_loopy'],{bypass_discovery_center = true, bypass_discovery_ui = true})
else
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS[chosenoption],{bypass_discovery_center = true, bypass_discovery_ui = true})
end
else
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_jolly'],{bypass_discovery_center = true, bypass_discovery_ui = true})
end
end
'''
match_indent = true
# Make cards in splash screen CCD cards
# Requires "Custom Main Menu" config to be enabled
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "if math.random() > 0.8 then card.sprite_facing = 'back'; card.facing = 'back' end"
position = "before"
payload = '''
if Cryptid.enabled["Menu"] then card:set_ability(get_random_consumable('cry_splash',{"no_grc"},nil,nil,true), true, nil) end
'''
match_indent = true
# Show Glitched Edition to confirm Cryptid is Active
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = false"
position = "before"
payload = "replace_card:set_edition(G.P_CENTERS.e_cry_glitched and 'e_cry_glitched' or 'e_negative',true,true)"
match_indent = true
# Patch related crash
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if not initial then G.GAME.blind:debuff_card(self) end"
position = "at"
payload = "if not initial and G.GAME and G.GAME.blind then G.GAME.blind:debuff_card(self) end"
match_indent = true
# Draw midground layer
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.config.center.soul_pos and (self.config.center.discovered or self.bypass_discovery_center) then"
position = "after"
payload = '''
if self.config.center.soul_pos and self.config.center.soul_pos.extra and (self.config.center.discovered or self.bypass_discovery_center) then
local scale_mod = 0.07-- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
local rotate_mod = 0--0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
self.children.floating_sprite2:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1--[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],nil, 0.6)
self.children.floating_sprite2:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)
end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''if not v.custom_draw and k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
position = "at"
payload = '''if not v.custom_draw and k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k ~= 'floating_sprite2' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
match_indent = true
# Custom variables in info queue
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end)"
position = "after"
payload = "if _c.specific_vars then specific_vars = _c.specific_vars end"
match_indent = true
# Fix not all cards returning to hand on big hands
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "{card_limit = 500, type = 'discard'})"
position = "at"
payload = "{card_limit = 1e308, type = 'discard'})"
match_indent = true
# When hand size exceeds deck size, space the cards as if the hand size was equal to the deck size
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "function CardArea:align_cards()"
position = "after"
payload = '''
if self.config.type == 'hand' then
self.config.temp_limit = math.min(self.config.card_limit, #G.playing_cards)
end
'''
match_indent = true
# Crash fix
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
position = "at"
payload = "if not G.SAVED_GAME or not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
match_indent = true
# Register banned bosses for rush hour
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "set_profile_progress()"
position = "before"
payload = '''
for i = 1, #G.CHALLENGES do
if (G.CHALLENGES[i].id == 'c_cry_rush_hour' or G.CHALLENGES[i].id == 'c_cry_rush_hour_ii' or G.CHALLENGES[i].id == 'c_cry_rush_hour_iii') and #G.CHALLENGES[i].restrictions.banned_other == 0 then
for k, v in pairs(G.P_BLINDS) do
if k ~= "bl_cry_clock" and k ~= "bl_cry_lavender_loop" and v.boss then
G.CHALLENGES[i].restrictions.banned_other[#G.CHALLENGES[i].restrictions.banned_other+1] = {id = k, type = 'blind'}
end
end
end
end
'''
match_indent = true
# Apply booster pack edition and stickers to contents - by Jen Walter
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "card.T.x = self.T.x"
position = "before"
payload = '''
local edi = self.edition or {}
if edi.type and not self.ability.name:find('Standard') then
if card.ability.name ~= "cry-meteor"
and card.ability.name ~= "cry-exoplanet"
and card.ability.name ~= "cry-stardust" then
card:set_edition({[edi.type] = true})
end
end
if self.ability.eternal then
card.ability.eternal = self.ability.eternal
end
if self.ability.perishable then
card.ability.perishable = self.ability.perishable
end
if self.ability.rental then
card.ability.rental = self.ability.rental
end
if self.pinned then
card.pinned = self.pinned
end
if self.ability.banana then
card.ability.banana = self.ability.banana
end
'''
match_indent = true
# catch edition code in standard pack to avoid reapplying edition (HORRIBLE)
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''local edition \= poll_edition\('standard_edition'\.\.G.GAME\.round_resets\.ante, edition_rate, true\)\n\s+card\:set_edition\(edition\)'''
position = "at"
payload = '''
local edi = self.edition or {}
if edi.type and not (G.GAME.modifiers.cry_force_edition and G.GAME.modifiers.cry_force_edition ~= 'random') then
card:set_edition({[edi.type] = true})
elseif not G.GAME.modifiers.cry_force_random_edition then
local edition = poll_edition('standard_edition'..G.GAME.round_resets.ante, edition_rate, true)
card:set_edition(edition)
end
'''
# Edition + sticker forcing on vouchers (editions are just funny cost increases)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "G.shop_vouchers:emplace(card)"
position = "before"
payload = '''
if G.GAME.current_round.cry_voucher_edition then
card:set_edition(G.GAME.current_round.cry_voucher_edition, true, true)
end
if G.GAME.current_round.cry_voucher_stickers then
if G.GAME.current_round.cry_voucher_stickers.eternal == true then -- this is dumb but i'm not sure how to call functions from a string
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.current_round.cry_voucher_stickers.perishable == true then
card.ability.perishable = true
end
if G.GAME.current_round.cry_voucher_stickers.rental == true then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.current_round.cry_voucher_stickers.pinned == true then
card.pinned = true
end
if G.GAME.current_round.cry_voucher_stickers.banana == true then
card.ability.banana = true
end
end
'''
match_indent = true
# don't forget voucher tags
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = "G.shop_vouchers:emplace(card)"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true)
end
if G.GAME.modifiers.cry_force_sticker == 'eternal' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.modifiers.cry_force_sticker == 'perishable' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_perishable(true)
card.ability.perishable = true
end
if G.GAME.modifiers.cry_force_sticker == 'rental' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.modifiers.cry_force_sticker == 'pinned' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.pinned = true
end
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.ability.banana = true
end
if G.GAME.modifiers.cry_sticker_sheet_plus then
for k, v in pairs(SMODS.Stickers) do
if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
end
end
'''
match_indent = true
# show owned vouchers
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "if G.GAME.used_vouchers[v.key] then"
position = "after"
payload = '''
if not G.GAME.cry_owned_vouchers[v.key] then
G.GAME.cry_owned_vouchers[v.key] = G.GAME.used_vouchers[v.key]
end
end
if G.GAME.cry_owned_vouchers[v.key] then
'''
match_indent = true
# show in voucher menu
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "voucher_areas[#voucher_areas]:emplace(card)"
position = "before"
payload = '''
if not G.GAME.voucher_edition_index then G.GAME.voucher_edition_index = {} end
if G.GAME.voucher_edition_index[card.ability.name] then -- i just made it a function so i can look at it less
local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
if edition then
card:set_edition(edition, true, true)
end
end
if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
card:set_perishable(true)
card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
card.ability.perishable = true
if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
card.debuff = true
end
end
if G.GAME.voucher_sticker_index.rental[card.ability.name] then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
card.pinned = true
end
if G.GAME.voucher_sticker_index.banana[card.ability.name] then
card.ability.banana = true
end
card.ability.extra = G.GAME.cry_voucher_centers[card.config.center_key].config.extra
if card.ability.extra_disp then card.ability.extra_disp = G.GAME.cry_voucher_centers[card.config.center_key].config.extra_disp end
'''
match_indent = true
# sticker tagging
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if center_table.name == 'Overstock' or center_table.name == 'Overstock Plus' then"
position = "before"
payload = '''
if not G.GAME.voucher_edition_index then G.GAME.voucher_edition_index = {} end
if self and self.edition then
G.GAME.voucher_edition_index[center_table.name] = self.edition.type
end
if not G.GAME.voucher_sticker_index then G.GAME.voucher_sticker_index = {eternal = {}, perishable = {}, rental = {}, pinned = {}, banana = {}} end
if self and self.ability and self.ability.eternal and self.ability.eternal == true then
G.GAME.voucher_sticker_index.eternal[center_table.name] = true
end
if self and self.ability and self.ability.perishable and self.ability.perishable == true then
G.GAME.voucher_sticker_index.perishable[center_table.name] = G.GAME.cry_voucher_perishable_rounds
end
if self and self.ability and self.ability.rental and self.ability.rental == true then
G.GAME.voucher_sticker_index.rental[center_table.name] = true
end
if self and self.pinned and self.pinned == true then
G.GAME.voucher_sticker_index.pinned[center_table.name] = true
end
if self and self.ability and self.ability.banana and self.ability.banana == true then
G.GAME.voucher_sticker_index.banana[center_table.name] = true
end
'''
match_indent = true
# apply end of round stuff
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if G.GAME.round_resets.ante == G.GAME.win_ante and G.GAME.blind:get_type() == 'Boss' then"
position = "before"
payload = '''
if G.GAME.voucher_sticker_index then
if G.GAME.voucher_sticker_index.perishable then
for k, v in pairs(G.GAME.voucher_sticker_index.perishable) do
if v > 1 then
G.GAME.voucher_sticker_index.perishable[k] = v - 1
end
if v == 1 then
G.GAME.voucher_sticker_index.perishable[k] = v - 1
for kk, vv in pairs(G.P_CENTERS) do
if k == vv.name then
cry_debuff_voucher(kk)
G.GAME.used_vouchers.vv = nil
G.GAME.used_vouchers[kk] = nil
break
end
end
end
end
end
if G.GAME.voucher_sticker_index.rental then
local cumulative_rental = 0
for k, v in pairs(G.GAME.voucher_sticker_index.rental) do
cumulative_rental = cumulative_rental + G.GAME.cry_voucher_rental_rate
end
if cumulative_rental > 0 then
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
blocking = false,
blockable = false,
func = (function()
ease_dollars(-cumulative_rental)
return true
end)}))
end
end
if G.GAME.voucher_sticker_index.banana then -- i'm pretty sure unredeem breaks if spectrals are disabled? unsure though
local voucher_queue = {}
local current_round_voucher=G.GAME.current_round.voucher
for k, v in pairs(G.GAME.voucher_sticker_index.banana) do
if (pseudorandom('byebyevoucher') < G.GAME.probabilities.normal/G.GAME.cry_voucher_banana_odds) then
area = G.play
local unredeemed_voucher = ''
for kk, vv in pairs(G.P_CENTERS) do
if k == vv.name then
unredeemed_voucher = kk
break
end
end
local card = create_card('Voucher', area, nil, nil, nil, nil, unredeemed_voucher)
if G.GAME.voucher_edition_index[card.ability.name] then -- i made this bullshit a function
local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
if edition then
card:set_edition(edition, true, true)
end
end
if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
card:set_perishable(true)
card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
card.ability.perishable = true
if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
card.debuff = true
end
end
if G.GAME.voucher_sticker_index.rental[card.ability.name] then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
card.pinned = true
end
if G.GAME.voucher_sticker_index.banana[card.ability.name] then
card.ability.banana = true
end
card:start_materialize()
area:emplace(card)
card.cost=0
card.shop_voucher=false
voucher_queue[#voucher_queue+1] = card
end
end
for k, v in pairs(voucher_queue) do
v:unredeem()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,
func = function()
v:start_dissolve()
return true
end}))
end
G.GAME.current_round.voucher=current_round_voucher
end
end
'''
match_indent = true
# Affect booster packs
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "G.shop_booster:emplace(card)"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true, true)
end
local eternal_perishable_poll = pseudorandom('cry_bpet'..(key_append or '')..G.GAME.round_resets.ante)
if (G.GAME.modifiers.cry_force_sticker == 'eternal') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_eternals_in_shop and eternal_perishable_poll > 0.8)) then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.modifiers.enable_perishables_in_shop and G.GAME.modifiers.cry_any_stickers then -- i don't feel like messing with this, whatever
if not G.GAME.modifiers.cry_eternal_perishable_compat and ((eternal_perishable_poll > 0.6) and (eternal_perishable_poll <= 0.8)) then
card:set_perishable(true)
card.ability.perishable = true
end
if G.GAME.modifiers.cry_eternal_perishable_compat and pseudorandom('cry_bpper'..(key_append or '')..G.GAME.round_resets.ante) > 0.8 then
card:set_perishable(true)
card.ability.perishable = true
end
end
if (G.GAME.modifiers.cry_force_sticker == 'perishable') or (G.GAME.modifiers.cry_sticker_sheet_plus) then
card:set_perishable(true)
card.ability.perishable = true
end
if (G.GAME.modifiers.cry_force_sticker == 'rental') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_rentals_in_shop and pseudorandom('cry_bpssjr'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then -- i should really just make this a function? so messy
card.ability.rental = true -- do not set_rental here to prevent cost from decreasing
end
if (G.GAME.modifiers.cry_force_sticker == 'pinned') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.cry_enable_pinned_in_shop and pseudorandom('cry_bppin'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then
card.pinned = true
end
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.ability.banana = true
end
if not G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) and (eternal_perishable_poll <= 0.8) then
card.ability.banana = true
end
if G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) then
card.ability.banana = true
end
if G.GAME.modifiers.cry_sticker_sheet_plus then
for k, v in pairs(SMODS.Stickers) do
if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
end
end
'''
match_indent = true
# world's first actually good multi-patch
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = "card:start_materialize()"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true, true)
end
'''
match_indent = true
# Prevent Jokers from spitting empty messages
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "text = extra.message or text"
position = "after"
payload = "if not text or text == '' then return end"
match_indent = true
# Add default pool value for Consumeables
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'else _pool[#_pool + 1] = "j_joker"'
position = "before"
payload = '''elseif _type == 'Consumeables' then _pool[#_pool + 1] = "c_ceres"'''
match_indent = true
# make the cat tag meow (can probably do this without injecting?)
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = '''play_sound('tarot2', math.random()*0.1 + 0.55, 0.09)'''
position = "before"
payload = '''if self.key == 'tag_cry_cat' then
local rand = math.random(4)
play_sound('cry_meow'..rand, 1.26, 0.25)
end
'''
match_indent = true
# hi it's me toneblock and i'm being stupid again! (Game:update inject)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''if G.FILE_HANDLER and G.FILE_HANDLER and G.FILE_HANDLER.update_queued and ('''
position = "before"
payload = '''
if not GLOBAL_cry_member_count_delay then GLOBAL_cry_member_count_delay = 0 end
if (GLOBAL_cry_member_count_delay > 5) or not GLOBAL_cry_member_count then -- it doesn't need to update this frequently? but it also doesn't need to be higher tbh...
if update_cry_member_count then update_cry_member_count() end -- i honestly hate nil checks like this, wish there was a shorthand
GLOBAL_cry_member_count_delay = 0
else
GLOBAL_cry_member_count_delay = GLOBAL_cry_member_count_delay + dt
end
'''
match_indent = true
# call update_cry_member_count() whenever the collection is opened to ensure it updates properly on title collection if it can (better than running it on loc_vars)
# it's not computationally intense at all, so whatever
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''G.FUNCS.your_collection = function(e)'''
position = "after"
payload = '''
if update_cry_member_count then update_cry_member_count() end
'''
match_indent = true
# notice if https is disabled (by default)
# also does some other things since this is patching in the same spot
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if _c.set == 'Other' then"
position = "before"
payload = '''
if _c.name == 'cry-membershipcard' or _c.name == 'cry-membershipcardtwo' then
if not Cryptid.enabled["HTTPS Module"] then
if G.localization.descriptions.Other.cry_https_disabled then
main_end = {}
localize{type = 'other', key = 'cry_https_disabled', nodes = main_end, vars = {}}
main_end = main_end[1]
end
end
end
if _c.name == 'cry-translucent Joker' then
if G.jokers and G.jokers.cards then
for k, v in ipairs(G.jokers.cards) do
if (v.edition and v.edition.negative) and (G.localization.descriptions.Other.remove_negative)then
main_end = {}
localize{type = 'other', key = 'remove_negative', nodes = main_end, vars = {}}
main_end = main_end[1]
break
end
end
end
end
if _c.name == 'cry-blurred Joker' then
if (SMODS.Mods["sdm0sstuff"] or {}).can_load then
if G.localization.descriptions.Other.blurred_sdm0 then
main_end = {}
localize{type = 'other', key = 'blurred_sdm0', nodes = main_end, vars = {}}
main_end = main_end[1]
end
end
end
'''
match_indent = true
# hand size forgiveness if playing negative or antimatter deck (someone please fix)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "function Game:update_draw_to_hand(dt)"
position = "after"
payload = '''
if G.GAME.selected_back and (G.GAME.selected_back.name == 'cry--Negative Deck' or G.GAME.selected_back.name == 'cry-Antimatter') and G.hand.config.card_limit <= 0 then -- 'cry--Negative Deck'... sure
G.hand.config.card_limit = 1
end
'''
match_indent = true
# don't draw old perishable texture
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''if self.ability.perishable then'''
position = "at"
payload = '''if self.ability.perishable and not layer then'''
match_indent = true
# init Cryptid global through lovely
# so other mods can add things to memepack pool
# and define some stub functions so that the game does not immediately crash when talisman isn't loaded
[[patches]]
[patches.pattern]
target = "main.lua"
pattern = '''function love.load()'''
position = "before"
payload = '''
Cryptid = {}
Cryptid.enabled = {}
Cryptid.memepack = {}
Cryptid.aliases = {}
Cryptid.food = {}
Cryptid.M_jokers = {}
Cryptid.Megavouchers = {}
function cry_format(...)
return ...
end
'''
match_indent = true
# Adds cry_creating_card event
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''
check_for_unlock({type = 'have_edition'})
end
'''
position = "after"
payload = '''
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({cry_creating_card = true, card = card})
end
'''
match_indent = true
# Adds cry_debuff_immune card modifier
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'if self.ability and self.ability.perma_debuff then self.debuff = true end'
position = "after"
payload = '''
if self.cry_debuff_immune then
self.debuff = false
end
'''
match_indent = true
# Removes cry_debuff_immune at the end of the round
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = 'for i = 1, #G.jokers.cards do'
position = "before"
payload = '''
for i = 1, #G.playing_cards do
local CARD = G.playing_cards[i]
CARD.cry_debuff_immune = false
end
'''
match_indent = true
# Joker Sell List
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'self:calculate_joker{selling_self = true}'
position = "before"
payload = '''
if self.config.center.set == 'Joker' then
if G.GAME.jokers_sold then
local contained = false
for i = 1, #G.GAME.jokers_sold do
if self.config.center.key == G.GAME.jokers_sold[i] then contained = true end
end
if not contained then table.insert(G.GAME.jokers_sold, self.config.center.key) end
else
G.GAME.jokers_sold = {self.config.center.key}
end
end
'''
match_indent = true
# fix crashing from the source
# well, not from the real source, but close enough
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = '''update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {'''
position = "before"
payload = '''
if (not self.ability.orbital_hand) or (not G.GAME.hands[self.ability.orbital_hand]) then
local _poker_hands = {}
for k, v in pairs(G.GAME.hands) do
if v.visible then _poker_hands[#_poker_hands+1] = k end
end
self.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed('orbital'))
end
'''
match_indent = true
# add check for unlock with winning hand
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''check_for_unlock({type = 'win'})'''
position = "after"
payload = '''
check_for_unlock({type = 'cry_win_with_hand', hand = G.GAME.last_hand_played})
'''
match_indent = true
# (scuffed) remove filler from rare tag pool
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''if v.yes_pool_flag and not G.GAME.pool_flags[v.yes_pool_flag] then add = nil end'''
position = "after"
payload = '''
if v.key == 'j_cry_filler' and _append == 'rta' then add = nil end
'''
match_indent = true