-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlovely.toml
967 lines (904 loc) · 27.3 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
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
#
# STAMPAPI
#
# generate_card_ui()
[[patches]]
[patches.regex]
target = 'functions/common_events.lua'
pattern = "(?<indent>[\t ]*)if v == 'eternal'"
line_prepend = '$indent'
position = 'before'
payload = '''if SMODS.Stamp.reverse_lookup[v] then info_queue[#info_queue+1] = {key = v, set = 'Other' } end'''
match_indent = true
# get_badge_colour()
[[patches]]
[patches.pattern]
target = 'functions/UI_definitions.lua'
pattern = 'return G.BADGE_COL[key] or {1, 0, 0, 1}'
position = 'before'
payload = '''
for k, v in pairs(SMODS.Stamps) do
G.BADGE_COL[k:lower()..'_stamp'] = v.colour
end
'''
match_indent = true
# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.seal then badges[#badges + 1] = string.lower(self.seal)..'_seal' end"
position = "after"
payload = '''if self.seal and SMODS.Stamp.reverse_lookup[self.seal..'_stamp'] then badges[#badges] = string.lower(self.seal)..'_stamp' end'''
match_indent = true
# Card:set_seal()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "function Card:set_seal(_seal, silent, immediate)"
position = "after"
payload = '''
local prev_seal_stamp = self:get_seal()
local seal_stamp_obj
if prev_seal_stamp and prev_seal_stamp ~= _seal then
seal_stamp_obj = SMODS.Seals[string.lower(prev_seal_stamp)]
if seal_stamp_obj and seal_stamp_obj.unapply and type(seal_stamp_obj.unapply) == "function" then
seal_stamp_obj.unapply(self)
end
seal_stamp_obj = SMODS.Stamps[string.lower(prev_seal_stamp)]
if seal_stamp_obj and seal_stamp_obj.unapply and type(seal_stamp_obj.unapply) == "function" then
seal_stamp_obj.unapply(self)
end
end
seal_stamp_obj = nil
'''
match_indent = true
# Card:set_seal()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.ability.name == 'Gold Card' and self.seal == 'Gold' and self.playing_card then"
position = "before"
payload = '''
local seal_stamp_obj
if _seal then
seal_stamp_obj = SMODS.Seals[string.lower(_seal)]
if seal_stamp_obj and seal_stamp_obj.apply and type(seal_stamp_obj.apply) == "function" then
seal_stamp_obj.apply(self)
end
seal_stamp_obj = SMODS.Stamps[string.lower(_seal)]
if seal_stamp_obj and seal_stamp_obj.apply and type(seal_stamp_obj.apply) == "function" then
seal_stamp_obj.apply(self)
end
end
'''
match_indent = true
# Card:add_to_deck()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "function Card:add_to_deck(from_debuff)"
position = "after"
payload = '''
if (not self.added_to_deck) and G.STAGE == G.STAGES.RUN then
if self.seal then
seal_stamp_obj = SMODS.Seals[string.lower(self.seal)]
if seal_stamp_obj and seal_stamp_obj.deck_add and type(seal_stamp_obj.deck_add) == 'function' then
seal_stamp_obj.deck_add(self)
end
seal_stamp_obj = SMODS.Stamps[string.lower(self.seal)]
if seal_stamp_obj and seal_stamp_obj.deck_add and type(seal_stamp_obj.deck_add) == "function" then
seal_stamp_obj.deck_add(self)
end
end
end
'''
match_indent = true
# Card:remove_from_deck()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "function Card:remove_from_deck(from_debuff)"
position = "after"
payload = '''
if self.added_to_deck and G.STAGE == G.STAGES.RUN then
if self.seal then
seal_stamp_obj = SMODS.Seals[string.lower(self.seal)]
if seal_stamp_obj and seal_stamp_obj.deck_remove and type(seal_stamp_obj.deck_remove) == 'function' then
seal_stamp_obj.deck_remove(self)
end
seal_stamp_obj = SMODS.Stamps[string.lower(self.seal)]
if seal_stamp_obj and seal_stamp_obj.deck_remove and type(seal_stamp_obj.deck_remove) == "function" then
seal_stamp_obj.deck_remove(self)
end
end
end
'''
match_indent = true
#
# BONUS XCHIPS, MULT, XMULT, HCHIPS, HXCHIPS, HMULT, HXMULT
# ALSO INCLUDES SUIT LEVELS SUITLEVELS
#
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif _c.set == 'Enhanced' then"
position = "before"
payload = '''
if specific_vars and specific_vars.bonus_xchips then
localize{type = 'other', key = 'card_extra_xchips', nodes = desc_nodes, vars = {specific_vars.bonus_xchips}}
end
if specific_vars and specific_vars.bonus_mult then
localize{type = 'other', key = 'card_extra_mult', nodes = desc_nodes, vars = {specific_vars.bonus_mult}}
end
if specific_vars and specific_vars.bonus_xmult then
localize{type = 'other', key = 'card_extra_xmult', nodes = desc_nodes, vars = {specific_vars.bonus_xmult}}
end
if specific_vars and specific_vars.bonus_hchips then
localize{type = 'other', key = 'card_extra_hchips', nodes = desc_nodes, vars = {specific_vars.bonus_hchips}}
end
if specific_vars and specific_vars.bonus_hxchips then
localize{type = 'other', key = 'card_extra_hxchips', nodes = desc_nodes, vars = {specific_vars.bonus_hxchips}}
end
if specific_vars and specific_vars.bonus_hmult then
localize{type = 'other', key = 'card_extra_hmult', nodes = desc_nodes, vars = {specific_vars.bonus_hmult}}
end
if specific_vars and specific_vars.bonus_hxmult then
localize{type = 'other', key = 'card_extra_hxmult', nodes = desc_nodes, vars = {specific_vars.bonus_hxmult}}
end'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif _c.set == 'Booster' then"
position = "before"
payload = '''
if specific_vars and specific_vars.bonus_xchips then
localize{type = 'other', key = 'card_extra_xchips', nodes = desc_nodes, vars = {specific_vars.bonus_xchips}}
end
if specific_vars and specific_vars.bonus_mult then
localize{type = 'other', key = 'card_extra_mult', nodes = desc_nodes, vars = {specific_vars.bonus_mult}}
end
if specific_vars and specific_vars.bonus_xmult then
localize{type = 'other', key = 'card_extra_xmult', nodes = desc_nodes, vars = {specific_vars.bonus_xmult}}
end
if specific_vars and specific_vars.bonus_hchips then
localize{type = 'other', key = 'card_extra_hchips', nodes = desc_nodes, vars = {specific_vars.bonus_hchips}}
end
if specific_vars and specific_vars.bonus_hxchips then
localize{type = 'other', key = 'card_extra_hxchips', nodes = desc_nodes, vars = {specific_vars.bonus_hxchips}}
end
if specific_vars and specific_vars.bonus_hmult then
localize{type = 'other', key = 'card_extra_hmult', nodes = desc_nodes, vars = {specific_vars.bonus_hmult}}
end
if specific_vars and specific_vars.bonus_hxmult then
localize{type = 'other', key = 'card_extra_hxmult', nodes = desc_nodes, vars = {specific_vars.bonus_hxmult}}
end'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "nominal_chips = self.base.nominal > 0 and self.base.nominal or nil,"
position = "after"
payload = '''
bonus_xchips = (self.ability.perma_xbonus or 0) > 1 and (self.ability.perma_xbonus or 0) or nil,
bonus_mult = (self.ability.perma_mult or 0) > 0 and (self.ability.perma_mult or 0) or nil,
bonus_xmult = (self.ability.perma_xmult or 0) > 1 and (self.ability.perma_xmult or 0) or nil,
bonus_hchips = (self.ability.perma_hbonus or 0) > 0 and (self.ability.perma_hbonus or 0) or nil,
bonus_hxchips = (self.ability.perma_hxbonus or 0) > 1 and (self.ability.perma_hxbonus or 0) or nil,
bonus_hmult = (self.ability.perma_hmult or 0) > 0 and (self.ability.perma_hmult or 0) or nil,
bonus_hxmult = (self.ability.perma_hxmult or 0) > 1 and (self.ability.perma_hxmult or 0) or nil,'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "perma_bonus = self.ability and self.ability.perma_bonus or 0,"
position = "after"
payload = '''
perma_xbonus = self.ability and self.ability.perma_xbonus or 1,
perma_mult = self.ability and self.ability.perma_mult or 0,
perma_xmult = self.ability and self.ability.perma_xmult or 1,
perma_hbonus = self.ability and self.ability.perma_hbonus or 0,
perma_hxbonus = self.ability and self.ability.perma_hxbonus or 1,
perma_hmult = self.ability and self.ability.perma_hmult or 0,
perma_hxmult = self.ability and self.ability.perma_hxmult or 1,
'''
match_indent = true
overwrite = false
# Game:init_game_object()
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "last_tarot_planet = nil,"
position = "before"
payload = '''
amm_data = {
suit_levels = {
},
},
'''
match_indent = true
# Card:generate_UIBox_ability_table()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "nominal_chips = self.base.nominal > 0 and self.base.nominal or nil,"
position = "after"
payload = '''
amm_suit_bonus = G.GAME.amm_data.suit_levels[self.base.suit],
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif _c.set == 'Enhanced' then"
position = "before"
payload = '''
if specific_vars.amm_suit_bonus and specific_vars.amm_suit_bonus.level > 1 then
localize{type = 'other', key = 'card_amm_suit_bonus', nodes = desc_nodes, vars = {specific_vars.amm_suit_bonus.level, specific_vars.amm_suit_bonus.chips, specific_vars.amm_suit_bonus.mult, card and localize(card.base.suit, "suits_plural"), colours = {
(specific_vars.amm_suit_bonus.level<=1 and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[math.min(7, specific_vars.amm_suit_bonus.level)]),
G.C.SUITS[card and card.base.suit],
}}}
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif _c.set == 'Booster' then"
position = "before"
payload = '''
if card and card.ability.effect ~= 'Stone Card' and (not card.config.center.no_suit) and (specific_vars and specific_vars.amm_suit_bonus and specific_vars.amm_suit_bonus.level > 1) then
localize{type = 'other', key = 'card_amm_suit_bonus', nodes = desc_nodes, vars = {specific_vars.amm_suit_bonus.level, specific_vars.amm_suit_bonus.chips, specific_vars.amm_suit_bonus.mult, card and localize(card.base.suit, "suits_plural"), colours = {
(specific_vars.amm_suit_bonus.level<=1 and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[math.min(7, specific_vars.amm_suit_bonus.level)]),
G.C.SUITS[card and card.base.suit],
}}}
end
'''
match_indent = true
overwrite = false
# G.UIDEF.run_info
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = """tab_definition_function = create_UIBox_current_hands,
},"""
position = "after"
payload = '''
{
label = localize('b_suits'),
tab_definition_function = create_UIBox_current_suits,
},
'''
match_indent = true
overwrite = false
# yeet
[[patches]]
[patches.pattern]
target = '=[SMODS _ "src/game_object.lua"]'
pattern = '''
if specific_vars and specific_vars.bonus_chips then
local remaining_bonus_chips = specific_vars.bonus_chips - (self.config.bonus or 0)
if remaining_bonus_chips > 0 then
localize { type = 'other', key = 'card_extra_chips', nodes = desc_nodes, vars = { specific_vars.bonus_chips - (self.config.bonus or 0) } }
end
end
'''
position = "after"
payload = '''
if specific_vars and specific_vars.bonus_xchips then
localize{type = 'other', key = 'card_extra_xchips', nodes = desc_nodes, vars = {specific_vars.bonus_xchips}}
end
if specific_vars and specific_vars.bonus_mult then
localize{type = 'other', key = 'card_extra_mult', nodes = desc_nodes, vars = {specific_vars.bonus_mult}}
end
if specific_vars and specific_vars.bonus_xmult then
localize{type = 'other', key = 'card_extra_xmult', nodes = desc_nodes, vars = {specific_vars.bonus_xmult}}
end
if specific_vars and specific_vars.bonus_hchips then
localize{type = 'other', key = 'card_extra_hchips', nodes = desc_nodes, vars = {specific_vars.bonus_hchips}}
end
if specific_vars and specific_vars.bonus_hxchips then
localize{type = 'other', key = 'card_extra_hxchips', nodes = desc_nodes, vars = {specific_vars.bonus_hxchips}}
end
if specific_vars and specific_vars.bonus_hmult then
localize{type = 'other', key = 'card_extra_hmult', nodes = desc_nodes, vars = {specific_vars.bonus_hmult}}
end
if specific_vars and specific_vars.bonus_hxmult then
localize{type = 'other', key = 'card_extra_hxmult', nodes = desc_nodes, vars = {specific_vars.bonus_hxmult}}
end
if card and (not SMODS.has_no_suit(card)) and (specific_vars and specific_vars.amm_suit_bonus and specific_vars.amm_suit_bonus.level > 1) then
localize{type = 'other', key = 'card_amm_suit_bonus', nodes = desc_nodes, vars = {specific_vars.amm_suit_bonus.level, specific_vars.amm_suit_bonus.chips, specific_vars.amm_suit_bonus.mult, card and localize(card.base.suit, "suits_plural"), colours = {
(specific_vars.amm_suit_bonus.level<=1 and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[math.min(7, specific_vars.amm_suit_bonus.level)]),
G.C.SUITS[card and card.base.suit],
}}}
end
'''
match_indent = true
overwrite = false
# eval_card()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "-- TARGET: main scoring on played cards"
match_indent = true
overwrite = false
position = 'after'
payload = '''
local x_chips = card:amm_get_chip_x_bonus()
if x_chips > 0 then
ret.playing_card.x_chips = x_chips
end
'''
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "-- TARGET: main scoring on held cards"
match_indent = true
overwrite = false
position = 'after'
payload = '''
local h_chips = card:amm_get_chip_h_bonus()
if h_chips > 0 then
ret.playing_card.chips = h_chips
end
local h_x_chips = card:amm_get_chip_h_x_bonus()
if h_x_chips > 0 then
ret.playing_card.x_chips = h_x_chips
end
'''
#
# ODDITYAPI
#
# G.FUNCS.use_card()
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if card.area and (not nc or card.area == G.pack_cards) then card.area:remove_card(card) end"
position = "before"
payload = '''local oddityapi_check_booster = false
if card.ability.set == "Oddity" and card.area == G.pack_cards then nc = true
oddityapi_check_booster = true end'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "e.config.ref_table:use_consumeable(area)"
position = "before"
payload = '''if oddityapi_check_booster == false then'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "SMODS.calculate_context({using_consumeable = true, consumeable = card, area = card.from_area})"
position = "after"
payload = '''end'''
match_indent = true
overwrite = false
# G.FUNCS.can_use_consumeable()
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if e.config.ref_table:can_use_consumeable() then"
position = "before"
payload = '''if e.config.ref_table.ability.set == 'Oddity' and e.config.ref_table.area == G.pack_cards then
if #G.consumeables.cards < G.consumeables.config.card_limit then
e.config.colour = G.C.GREEN
e.config.button = 'use_card'
elseif #G.consumeables.cards >= G.consumeables.config.card_limit then
e.config.colour = G.C.UI.BACKGROUND_INACTIVE
e.config.button = nil
end
else'''
match_indent = true
overwrite = false
# this is dumb
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "G.FUNCS.can_select_card = function(e)"
position = "before"
payload = '''end'''
match_indent = true
overwrite = false
# get_current_pool()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "for k, v in ipairs(_starting_pool) do"
match_indent = true
overwrite = false
position = 'before'
payload = '''
if _legendary and _type == 'Oddity' then
_starting_pool, _pool_key = SMODS.ConsumableTypes[_type].rarity_pools[-4], _type.."-4"..(_append or '')
end
'''
#
# ASPECTAPI
#
# Game:start_up()
[[patches]]
[patches.pattern]
target = 'game.lua'
pattern = "self.shared_seals = {"
match_indent = true
overwrite = false
position = 'before'
payload = '''
self.shared_aspects = {}
'''
# Game:init_item_prototypes ()
[[patches]]
[patches.pattern]
target = 'game.lua'
pattern = "self.P_SEALS = {"
match_indent = true
overwrite = false
position = 'before'
payload = '''
self.P_ASPECTS = {}
'''
# Game:init_item_prototypes()
[[patches]]
[patches.pattern]
target = 'game.lua'
pattern = "self.P_CENTER_POOLS = {"
match_indent = true
overwrite = false
position = 'after'
payload = '''
Aspect = {},
'''
# Card:generate_UIBox_ability_table()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "if self.seal then badges[#badges + 1] = string.lower(self.seal)..'_seal' end"
match_indent = true
overwrite = false
position = 'after'
payload = "if self.aspect then badges[#badges + 1] = string.lower(self.aspect)..'_aspect' end"
# Card:draw()
# this line of text is the worst thing
# if anyone knows how to do this without overwriting it'd be swell
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "if self.edition or self.seal or self.ability.eternal or self.ability.rental or self.ability.perishable or self.sticker or self.ability.set == 'Spectral' or self.debuff or self.greyed or self.ability.name == 'The Soul' or self.ability.set == 'Voucher' or self.ability.set == 'Booster' or self.config.center.soul_pos or self.config.center.demo then"
match_indent = true
overwrite = true
position = 'at'
payload = "if self.edition or self.seal or self.aspect or self.bottle or self.ability.eternal or self.ability.rental or self.ability.perishable or self.sticker or self.ability.set == 'Spectral' or self.debuff or self.greyed or self.ability.name == 'The Soul' or self.ability.set == 'Voucher' or self.ability.set == 'Booster' or self.config.center.soul_pos or self.config.center.demo then"
# this part is normal (totally nothing jank here either)
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "if self.seal == 'Gold' then G.shared_seals[self.seal]:draw_shader('voucher', nil, self.ARGS.send_to_shader, nil, self.children.center) end"
match_indent = true
overwrite = false
position = 'after'
payload = '''
end
if self.aspect then
G.shared_aspects[self.aspect].role.draw_major = self
G.shared_aspects[self.aspect]:draw_shader('dissolve', nil, nil, nil, self.children.center)
'''
# Card:save()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "seal = self.seal,"
match_indent = true
overwrite = false
position = 'after'
payload = '''
aspect = self.aspect,
'''
# Card:load()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "self.seal = cardTable.seal"
match_indent = true
overwrite = false
position = 'after'
payload = '''
self.aspect = cardTable.aspect
'''
# eval_card()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "-- TARGET: evaluate your own repetition effects"
match_indent = true
overwrite = false
position = 'after'
payload = '''
if card.aspect then
local aspects = card:calculate_aspect(context)
if aspects then
ret.aspects = aspects
end
end
'''
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "-- TARGET: evaluate your own general effects"
match_indent = true
overwrite = false
position = 'after'
payload = '''
if card.aspect then
local aspects = card:calculate_aspect(context)
if aspects then
ret.aspects = aspects
end
end
'''
# generate_card_ui()
#[[patches]]
#[patches.pattern]
#target = 'functions/common_events.lua'
#pattern = "local seal = G.P_SEALS[v] or G.P_SEALS[SMODS.Seal.badge_to_key[v] or '']"
#match_indent = true
#overwrite = false
#position = 'before'
#payload = '''
#local aspect = G.P_ASPECTS[v] or G.P_ASPECTS[AMM.Aspect.badge_to_key[v] or '']
#if aspect then
# info_queue[#info_queue+1] = aspect
#end
#'''
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = ''' end
if main_end then
desc_nodes[#desc_nodes+1] = main_end
end'''
match_indent = true
overwrite = false
position = 'before'
payload = '''
elseif _c.set == "Aspect" then
localize{type = 'descriptions', key = _c.key, set = "Other", nodes = desc_nodes, vars = _c.vars or loc_vars}
'''
# copy_card()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "new_card:set_seal(other.seal, true)"
match_indent = true
overwrite = false
position = 'before'
payload = '''
new_card:set_aspect(other.aspect,true)
'''
# G.UIDEF.card_h_popup()
# dirty patch, open to improvements
# you two have any ideas?
[[patches]]
[patches.pattern]
target = 'functions/UI_definitions.lua'
pattern = 'badges[#badges + 1] = create_badge(localize(v, "labels"), get_badge_colour(v))'
match_indent = true
overwrite = true
position = 'at'
payload = '''
badges[#badges + 1] = create_badge(localize(v, "labels"), get_badge_colour(v), amm_get_badge_text_colour(v))
'''
# get_badge_colour()
[[patches]]
[patches.pattern]
target = 'functions/UI_definitions.lua'
pattern = 'return G.BADGE_COL[key] or {1, 0, 0, 1}'
position = 'before'
payload = '''
for k, v in pairs(AMM.Aspects) do
G.BADGE_COL[k:lower()..'_aspect'] = v.badge_colour or v.colour
end
'''
match_indent = true
#
# BOTTLE API? IDFK, BOTTLES
#
# Game:start_up()
[[patches]]
[patches.pattern]
target = 'game.lua'
pattern = "self.shared_seals = {"
match_indent = true
overwrite = false
position = 'before'
payload = '''
--self.shared_bottle = nil
'''
# Card:generate_UIBox_ability_table()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "if self.seal then badges[#badges + 1] = string.lower(self.seal)..'_seal' end"
match_indent = true
overwrite = false
position = 'after'
payload = "if self.bottle then badges[#badges + 1] = 'bottle' end"
# this part is still normal
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "if self.seal == 'Gold' then G.shared_seals[self.seal]:draw_shader('voucher', nil, self.ARGS.send_to_shader, nil, self.children.center) end"
match_indent = true
overwrite = false
position = 'after'
payload = '''
end
if self.bottle then
G.shared_bottle.role.draw_major = self
G.shared_bottle:draw_shader('dissolve', nil, nil, nil, self.children.center)
'''
# copy_card()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = "new_card:set_seal(other.seal, true)"
match_indent = true
overwrite = false
position = 'before'
payload = '''
new_card.bottle = other.bottle
'''
# Card:save()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "seal = self.seal,"
match_indent = true
overwrite = false
position = 'after'
payload = '''
bottle = self.bottle,
'''
# Card:load()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "self.seal = cardTable.seal"
match_indent = true
overwrite = false
position = 'after'
payload = '''
self.bottle = cardTable.bottle
'''
#
# MISCELLANY
#
# new context? new context? new context?
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''
G.jokers.config.card_limit = G.jokers.config.card_limit + self.edition.card_limit
end
end
end
end
'''
position = "after"
payload = '''
SMODS.calculate_context({amm_added_card = true, from_debuff = from_debuff, other_card = self})
'''
match_indent = true
overwrite = false
# yeet
[[patches]]
[patches.pattern]
target = '=[SMODS Pokermon "functions/pokefunctions.lua"]'
pattern = '''
local previous_upgrade = nil
'''
position = "after"
payload = '''
local previous_stamp = nil
if card.seal and SMODS.Stamps[string.lower(card.seal)] then
previous_stamp = card.seal
end
'''
match_indent = true
overwrite = false
# yeet
[[patches]]
[patches.pattern]
target = '=[SMODS Pokermon "functions/pokefunctions.lua"]'
pattern = '''
if previous_edition then
'''
position = "before"
payload = '''
if previous_stamp then
new_card:set_seal(previous_stamp, nil, true)
end
'''
match_indent = true
overwrite = false
#
# GRAVEYARD -- MOST OF THIS IS BY MYSTHAPS
#
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "G.playing_cards = {}"
position = "after"
payload = '''
G.graveyard = {}
self.graveyard_area = CardArea(
100, 0,
CAI.discard_W,CAI.discard_H,
{card_limit = 5000, type = 'graveyard'})
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "Moveable.remove(self)"
position = "before"
payload = '''
if G.graveyard and G.graveyard_area and self.playing_card and AMM.api.graveyard.active then
if not self.graveyard then
local _card = copy_card(self, nil, nil, G.playing_card)
_card.graveyard = true
_card.area = G.graveyard_area
table.insert(G.graveyard, _card)
G.graveyard_area:emplace(_card)
_card.playing_card = #G.graveyard
_card:start_materialize(nil, true)
_card:add_to_graveyard()
SMODS.calculate_context({amm_buried_card = true, other_card = _card})
else
for k, v in ipairs(G.graveyard) do
if v == self then
table.remove(G.graveyard, k)
break
end
end
for k, v in ipairs(G.graveyard) do
v.playing_card = k
end
end
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "table.insert(G.playing_cards, v)"
position = "at"
payload = '''
if v.graveyard then
table.insert(G.graveyard, v)
else
table.insert(G.playing_cards, v)
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "self.ARGS.invisible_area_types = self.ARGS.invisible_area_types or {discard=1, voucher=1, play=1, consumeable=1, title = 1, title_2 = 1}"
position = "after"
payload = '''
self.ARGS.invisible_area_types.graveyard = 1
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "function CardArea:align_cards()"
position = "after"
payload = '''
if self == G.graveyard then return end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "if area == G.discard then"
position = "before"
payload = '''
if area == G.graveyard then
card.T.r = 0
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "bypass_lock = self.bypass_lock,"
position = "after"
payload = '''
graveyard = self.graveyard,
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "self.bypass_lock = cardTable.bypass_lock"
position = "after"
payload = '''
self.graveyard = cardTable.graveyard
'''
match_indent = true
overwrite = false
# graveyard calc
[[patches]]
[patches.pattern]
target = '=[SMODS _ "src/utils.lua"]'
pattern = '''
local effect = G.GAME.selected_back:trigger_effect(context)
if effect then SMODS.calculate_effect(effect, G.deck.cards[1] or G.deck) end
'''
position = "before"
payload = '''
if SMODS.optional_features.cardareas.graveyard then
context.cardarea = G.graveyard_area
for i=1, #G.graveyard_area.cards do
--print("hi autumn")
if return_table then
return_table[#return_table+1] = eval_card(G.graveyard_area.cards[i], context)
else
local effects = {eval_card(G.graveyard_area.cards[i], context)}
SMODS.calculate_quantum_enhancements(G.graveyard_area.cards[i], effects, context)
SMODS.trigger_effects(effects, G.graveyard_area.cards[i])
end
end
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = '''
elseif card.area == G.discard or card.area == G.vouchers then
'''
position = "before"
payload = '''
elseif card.area == G.graveyard_area then
y_off = -0.44*G.CARD_H
card = G.deck.cards[1] or G.deck
card_aligned = 'tm'
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "self.children.area_uibox = UIBox{"
position = "before"
payload = '''
if self == G.deck and SMODS.optional_features.amm.graveyard then
table.insert(card_count.nodes, 5, {n=G.UIT.T, config={text = ' (', scale = 0.25, colour = G.C.JOKER_GREY}})
table.insert(card_count.nodes, 6, {n=G.UIT.T, config={ref_table = G.graveyard_area.config, ref_value = 'card_count', scale = 0.3, colour = G.C.JOKER_GREY}})
table.insert(card_count.nodes, 7, {n=G.UIT.T, config={text = ')', scale = 0.25, colour = G.C.JOKER_GREY}})
end
'''
match_indent = true
overwrite = false