forked from MathIsFun0/Talisman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlovely.toml
1165 lines (1080 loc) · 40.8 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
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
[[patches]]
[patches.copy]
target = "main.lua"
position = "append"
sources = [
"talisman.lua"
]
# Show a Gold Seal to confirm Talisman is Active
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = false"
position = "before"
payload = "replace_card:set_seal('Gold', true, true)"
match_indent = true
overwrite = false
[[patches]]
[patches.module]
source = "nativefs.lua"
before = "main.lua"
name = "nativefs"
# Use formatted numbers for poker hand scores
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "{n=G.UIT.T, config={text = G.GAME.hands[handname].chips, scale = 0.45, colour = G.C.UI.TEXT_LIGHT}},"
position = "at"
payload = "{n=G.UIT.T, config={text = number_format(G.GAME.hands[handname].chips, 1000000), scale = 0.45, colour = G.C.UI.TEXT_LIGHT}},"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "{n=G.UIT.T, config={text = G.GAME.hands[handname].mult, scale = 0.45, colour = G.C.UI.TEXT_LIGHT}}"
position = "at"
payload = "{n=G.UIT.T, config={text = number_format(G.GAME.hands[handname].mult, 1000000), scale = 0.45, colour = G.C.UI.TEXT_LIGHT}}"
match_indent = true
overwrite = true
# Chip requirements for achievements/unlocks
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if args.chips >= 10000 then"
position = "at"
payload = "if to_big(args.chips) >= to_big(10000) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if args.chips >= 1000000 then"
position = "at"
payload = "if to_big(args.chips) >= to_big(1000000) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if args.chips >= 100000000 then"
position = "at"
payload = "if to_big(args.chips) >= to_big(100000000) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if card.unlock_condition.chips <= args.chips then"
position = "at"
payload = "if to_big(card.unlock_condition.chips) <= to_big(args.chips) then"
match_indent = true
overwrite = true
# More comparison issues
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if hand_chips*mult > 0 then"
position = "at"
payload = "if to_big(hand_chips)*mult > to_big(0) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if G.GAME.current_round.current_hand.chip_total < 1 then"
position = "at"
payload = "if to_big(G.GAME.current_round.current_hand.chip_total) < to_big(1) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "ease_chips(0)"
position = "at"
payload = "ease_chips(to_big(0))"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "chips = 0,"
position = "at"
payload = "chips = to_big(0),"
match_indent = true
overwrite = true
# Patch for Steamodded Sound API
[[patches]]
[patches.pattern]
target = "main.lua"
pattern = "G.ARGS.score_intensity.organ = G.video_organ or G.ARGS.score_intensity.required_score > 0 and math.max(math.min(0.4, 0.1*math.log(G.ARGS.score_intensity.earned_score/(G.ARGS.score_intensity.required_score+1), 5)),0.) or 0"
position = "at"
payload = "G.ARGS.score_intensity.organ = G.video_organ or to_big(G.ARGS.score_intensity.required_score) > to_big(0) and math.max(math.min(0.4, 0.1*math.log(G.ARGS.score_intensity.earned_score/(G.ARGS.score_intensity.required_score+1), 5)),0.) or 0"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "G.ARGS.score_intensity.organ = G.video_organ or G.ARGS.score_intensity.required_score > 0 and math.max(math.min(0.4, 0.1*math.log(G.ARGS.score_intensity.earned_score/(G.ARGS.score_intensity.required_score+1), 5)),0.) or 0"
position = "at"
payload = "G.ARGS.score_intensity.organ = G.video_organ or to_big(G.ARGS.score_intensity.required_score) > to_big(0) and math.max(math.min(0.4, 0.1*math.log(G.ARGS.score_intensity.earned_score/(G.ARGS.score_intensity.required_score+1), 5)),0.) or 0"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if G.ARGS.score_intensity.earned_score >= G.ARGS.score_intensity.required_score and G.ARGS.score_intensity.required_score > 0 then"
position = "at"
payload = "if to_big(G.ARGS.score_intensity.earned_score) >= to_big(G.ARGS.score_intensity.required_score) and to_big(G.ARGS.score_intensity.required_score) > to_big(0) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "if G.GAME.chips - G.GAME.blind.chips >= 0 or G.GAME.current_round.hands_left < 1 then"
position = "at"
payload = '''if to_big(G.GAME.chips) >= to_big(G.GAME.blind.chips) or G.GAME.current_round.hands_left < 1 then'''
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if G.GAME.chips - G.GAME.blind.chips >= 0 then"
position = "at"
payload = "if to_big(G.GAME.chips) >= to_big(G.GAME.blind.chips) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "blind.lua"
pattern = "if self.boss and G.GAME.chips - G.GAME.blind.chips >= 0 then"
position = "at"
payload = "if self.boss and to_big(G.GAME.chips) - G.GAME.blind.chips >= to_big(0) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "G.GAME.chips/G.GAME.blind.chips >= 0.25 then"
position = "at"
payload = "to_big(G.GAME.chips)/G.GAME.blind.chips >= to_big(0.25) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.mult) == 'number' and G.GAME.current_round.current_hand.mult or 1)))) end"
position = "at"
payload = "if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.min(2,math.max(0,math.floor(math.log10(is_number(G.GAME.current_round.current_hand.mult) and G.GAME.current_round.current_hand.mult or 1))))) end"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.chips) == 'number' and G.GAME.current_round.current_hand.chips or 1)))) end"
position = "at"
payload = "if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.min(2,math.max(0,math.floor(math.log10(is_number(G.GAME.current_round.current_hand.chips) and G.GAME.current_round.current_hand.chips or 1))))) end"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "if type(G.GAME.current_round.current_hand.chips) ~= 'number' or type(G.GAME.current_round.current_hand.mult) ~= 'number' then"
position = "at"
payload = "if not is_number(G.GAME.current_round.current_hand.chips) or not is_number(G.GAME.current_round.current_hand.mult) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "main.lua"
pattern = "if type(G.GAME.current_round.current_hand.chips) ~= 'number' or type(G.GAME.current_round.current_hand.mult) ~= 'number' then"
position = "at"
payload = "if not is_number(G.GAME.current_round.current_hand.chips) or not is_number(G.GAME.current_round.current_hand.mult) then"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "local delta = (type(vals.chips) == 'number' and type(G.GAME.current_round.current_hand.chips) == 'number') and (vals.chips - G.GAME.current_round.current_hand.chips) or 0"
position = "at"
payload = "local delta = (is_number(vals.chips) and is_number(G.GAME.current_round.current_hand.chips)) and (vals.chips - G.GAME.current_round.current_hand.chips) or 0"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "local delta = (type(vals.mult) == 'number' and type(G.GAME.current_round.current_hand.mult) == 'number')and (vals.mult - G.GAME.current_round.current_hand.mult) or 0"
position = "at"
payload = "local delta = (is_number(vals.mult) and is_number(G.GAME.current_round.current_hand.mult))and (vals.mult - G.GAME.current_round.current_hand.mult) or 0"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if delta < 0 then delta = ''..delta; col = G.C.RED"
position = "at"
payload = "if to_big(delta) < to_big(0) then delta = number_format(delta); col = G.C.RED"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif delta > 0 then delta = '+'..delta"
position = "at"
payload = "elseif to_big(delta) > to_big(0) then delta = '+'..number_format(delta)"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "else delta = ''..delta"
position = "at"
payload = "else delta = number_format(delta)"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "engine/string_packer.lua"
pattern = 'if type_v == "table" then'
position = "after"
payload = '''
if v.m and v.e then
v = "to_big("..v.m..","..v.e..")"
elseif v.array and v.sign then
local v0 = "to_big({"
for qi = 1,#v.array do
v0 = v0 .. v.array[qi] .. ", "
end
v0 = v0 .. "},"..v.sign..")"
v = v0
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "engine/string_packer.lua"
pattern = 'if v.is and v:is(Object) then'
position = "at"
payload = 'elseif v.is and v:is(Object) then'
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME.round_resets, ref_value = 'ante'}}, colours = {G.C.IMPORTANT},shadow = true, font = G.LANGUAGES['en-us'].font, scale = 2*scale}),id = 'ante_UI_count'}},"
position = "at"
payload = "{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME.round_resets, ref_value = 'ante_disp'}}, colours = {G.C.IMPORTANT},shadow = true, font = G.LANGUAGES['en-us'].font, scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100)}),id = 'ante_UI_count'}},--{n=G.UIT.T, config={text = number_format(G.GAME.round_resets.ante), lang = G.LANGUAGES['en-us'], scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100), colour = G.C.IMPORTANT, shadow = true,id = 'ante_UI_count'}},"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "ante = 1,"
position = "after"
payload = "ante_disp = number_format(1),"
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "G.GAME.round_resets.ante = G.GAME.round_resets.ante + mod"
position = "after"
payload = "G.GAME.round_resets.ante_disp = number_format(G.GAME.round_resets.ante)"
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if not G.ARGS.hand_chip_total_UI_set or G.ARGS.hand_chip_total_UI_set < G.GAME.current_round.current_hand.chip_total then"
position = "at"
payload = "if not G.ARGS.hand_chip_total_UI_set or to_big(G.ARGS.hand_chip_total_UI_set) < to_big(G.GAME.current_round.current_hand.chip_total) then"
match_indent = true
overwrite = true
# For some reason Big leaks into the text engine, this mitigates it
[[patches]]
[patches.pattern]
target = "engine/text.lua"
pattern = "if self.strings[k].W > self.config.W then self.config.W = self.strings[k].W; self.strings[k].W_offset = 0 end"
position = "before"
payload = '''
if Big then
if type(self.strings[k].W) == 'table' then
self.strings[k].W = self.strings[k].W:to_number()
end
if type(self.strings[k].H) == 'table' then
self.strings[k].H = self.strings[k].H:to_number()
end
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "engine/text.lua"
pattern = "function DynaText:draw()"
position = "after"
payload = '''
if Big then
self.scale = to_big(self.scale):to_number()
if self.shadow_parallax then self.shadow_parallax.x = to_big(self.shadow_parallax.x):to_number() end
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "engine/text.lua"
pattern = "for k, letter in ipairs(self.strings[self.focused_string].letters) do"
position = "after"
payload = '''
if Big then
letter.dims.x = to_big(letter.dims.x):to_number()
letter.dims.y = to_big(letter.dims.y):to_number()
letter.offset.x = to_big(letter.offset.x):to_number()
letter.offset.y = to_big(letter.offset.y):to_number()
end
'''
match_indent = true
overwrite = false
[[patches]]
[patches.pattern]
target = "engine/ui.lua"
pattern = "if _th and _tw then"
position = "after"
payload = '''
if Big then
_th = to_big(_th):to_number()
_tw = to_big(_tw):to_number()
end
'''
match_indent = true
overwrite = false
#these last few are causing lag, so they'll only be applied in the main menu
[[patches]]
[patches.pattern]
target = "engine/ui.lua"
pattern = "local _cw, _ch = w:set_wh()"
position = "after"
payload = "if Big and G.STATE == G.STATES.MENU then _cw = to_big(_cw):to_number(); _ch = to_big(_ch):to_number() end"
match_indent = true
[[patches]]
[patches.pattern]
target = "engine/moveable.lua"
pattern = "function Moveable:move_wh(dt)"
position = "after"
payload = '''
if Big and G.STATE == G.STATES.MENU then self.T.w = to_big(self.T.w):to_number()
self.T.h = to_big(self.T.h):to_number()
self.VT.w = to_big(self.VT.w):to_number()
self.VT.h = to_big(self.VT.h):to_number() end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "function prep_draw(moveable, scale, rotate, offset)"
position = "after"
payload = '''
if Big and G.STATE == G.STATES.MENU then moveable.VT.x = to_big(moveable.VT.x):to_number()
moveable.VT.y = to_big(moveable.VT.y):to_number()
moveable.VT.w = to_big(moveable.VT.w):to_number()
moveable.VT.h = to_big(moveable.VT.h):to_number() end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "engine/ui.lua"
pattern = "if self.config.vert then love.graphics.translate(0,self.VT.h); love.graphics.rotate(-math.pi/2) end"
position = "before"
payload = '''
if Big and G.STATE == G.STATES.MENU then self.config.scale = to_big(self.config.scale):to_number() end
'''
match_indent = true
# call init game object appendum after init game object
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "if new_game_obj then self.GAME = self:init_game_object() end"
position = "after"
payload = "if Talisman and Talisman.igo then self.GAME = Talisman.igo(self.GAME) end"
match_indent = true
overwrite = false
# call init game object appendum after init game object
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "self.GAME = saveTable and saveTable.GAME or self:init_game_object()"
position = "after"
payload = "if Talisman and Talisman.igo then self.GAME = Talisman.igo(self.GAME) end"
match_indent = true
overwrite = false
# remove more animations from event queue
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if effects[ii].card then"
position = "at"
payload = "if effects[ii].card and not Talisman.config_file.disable_anims then"
match_indent = true
overwrite = false
#enhancement animation removing
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.edition and not silent then"
position = "at"
payload = "if self.edition and (not Talisman.config_file.disable_anims or (not Talisman.calculating_joker and not Talisman.calculating_score and not Talisman.calculating_card)) and not silent then"
match_indent = true
overwrite = false
# dollar buffer thingy
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "G.E_MANAGER:add_event(Event({func = (function() G.GAME.dollar_buffer = 0; return true end)}))"
position = "at"
payload = "if not Talisman.config_file.disable_anims then G.E_MANAGER:add_event(Event({func = (function() G.GAME.dollar_buffer = 0; return true end)})) else G.GAME.dollar_buffer = 0 end"
match_indent = true
overwrite = false
# add card
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if G.GAME.blind then G.E_MANAGER:add_event(Event({ func = function() G.GAME.blind:set_blind(nil, true, nil); return true end })) end"
position = "at"
payload = "if G.GAME.blind and (not SMODS or G.GAME.blind.in_blind) and not (Talisman.config_file.disable_anims and (Talisman.calculating_joker or Talisman.calculating_score or Talisman.calculating_card)) then G.E_MANAGER:add_event(Event({ func = function() G.GAME.blind:set_blind(nil, true, nil); return true end })) end"
match_indent = true
overwrite = false
# hand level ups
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if not instant then"
position = "at"
payload = "if not instant and not Talisman.config_file.disable_anims then"
match_indent = true
overwrite = false
# Juice Issues
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "func = (function() card:juice_up(0.7);return true end)"
position = "at"
payload = "func = (function() if card and card.juice_up then card:juice_up(0.7) end;return true end)"
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if card then card:juice_up(0.8, 0.5) end"
position = "at"
payload = "if card and card.juice_up then card:juice_up(0.8, 0.5) end"
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "card:juice_up(0.6, 0.1)"
position = "at"
payload = "if card and card.juice_up then card:juice_up(0.6, 0.1) end"
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "func = (function() if eval_func(card) then if not first or first then card:juice_up(0.1, 0.1) end;juice_card_until(card, eval_func, nil, 0.8) end return true end)"
position = "at"
payload = "func = (function() if eval_func(card) then if card and card.juice_up then card:juice_up(0.1, 0.1) end;juice_card_until(card, eval_func, nil, 0.8) end return true end)"
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "func = (function() if eval_func(card) then if not first or first then card:juice_up(0.1, 0.1) end;juice_card_until(card, eval_func, nil, 0.8) end return true end)"
position = "at"
payload = "func = (function() if eval_func(card) then if card and card.juice_up then card:juice_up(0.1, 0.1) end;juice_card_until(card, eval_func, nil, 0.8) end return true end)"
match_indent = true
# return eval_round value
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "add_round_eval_row({name = 'bottom', dollars = dollars})"
position = "after"
payload = "Talisman.dollars = dollars"
match_indent = true
# arbitrary operations on chips and mult
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if effects.jokers.Xmult_mod then mult = mod_mult(mult*effects.jokers.Xmult_mod);extras.mult = true end"
position = "after"
payload = '''
if effects.jokers.Emult_mod then mult = mod_mult(mult^effects.jokers.Emult_mod);extras.mult = true end
if effects.jokers.EEmult_mod then mult = mod_mult(mult:arrow(2, effects.jokers.EEmult_mod));extras.mult = true end
if effects.jokers.EEEmult_mod then mult = mod_mult(mult:arrow(3, effects.jokers.EEEmult_mod));extras.mult = true end
if effects.jokers.hypermult_mod and type(effects.jokers.hypermult_mod) == 'table' then mult = mod_mult(mult:arrow(effects.jokers.hypermult_mod[1], effects.jokers.hypermult_mod[2]));extras.mult = true end
if effects.jokers.Xchip_mod then hand_chips = mod_chips(hand_chips*effects.jokers.Xchip_mod);extras.hand_chips = true end
if effects.jokers.Echip_mod then hand_chips = mod_chips(hand_chips^effects.jokers.Echip_mod);extras.hand_chips = true end
if effects.jokers.EEchip_mod then hand_chips = mod_chips(hand_chips:arrow(2, effects.jokers.EEchip_mod));extras.hand_chips = true end
if effects.jokers.EEEchip_mod then hand_chips = mod_chips(hand_chips:arrow(3, effects.jokers.EEEchip_mod));extras.hand_chips = true end
if effects.jokers.hyperchip_mod and type(effects.jokers.hyperchip_mod) == 'table' then hand_chips = mod_chips(hand_chips:arrow(effects.jokers.hyperchip_mod[1], effects.jokers.hyperchip_mod[2]));extras.hand_chips = true end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if effect.Xmult_mod then mult = mod_mult(mult*effect.Xmult_mod);extras.mult = true end"
position = "after"
payload = '''
if effect.Emult_mod then mult = mod_mult(mult^effect.Emult_mod);extras.mult = true end
if effect.EEmult_mod then mult = mod_mult(mult:arrow(2, effect.EEmult_mod));extras.mult = true end
if effect.EEEmult_mod then mult = mod_mult(mult:arrow(3, effect.EEEmult_mod));extras.mult = true end
if effect.hypermult_mod and type(effect.hypermult_mod) == 'table' then mult = mod_mult(mult:arrow(effect.hypermult_mod[1], effect.hypermult_mod[2]));extras.mult = true end
if effect.Xchip_mod then hand_chips = mod_chips(hand_chips*effect.Xchip_mod);extras.hand_chips = true end
if effect.Echip_mod then hand_chips = mod_chips(hand_chips^effect.Echip_mod);extras.hand_chips = true end
if effect.EEchip_mod then hand_chips = mod_chips(hand_chips:arrow(2, effect.EEchip_mod));extras.hand_chips = true end
if effect.EEEchip_mod then hand_chips = mod_chips(hand_chips:arrow(3, effect.EEEchip_mod));extras.hand_chips = true end
if effect.hyperchip_mod and type(effect.hyperchip_mod) == 'table' then hand_chips = mod_chips(hand_chips:arrow(effect.hyperchip_mod[1], effect.hyperchip_mod[2]));extras.hand_chips = true end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "x_mult = center.config.Xmult or 1,"
position = "after"
payload = '''
e_mult = center.config.Emult or 0,
ee_mult = center.config.EEmult or 0,
eee_mult = center.config.EEEmult or 0,
hyper_mult = type(center.config.Hmult) == 'table' and center.config.Hmult or {0, 0},
x_chips = center.config.Xchips or 0,
e_chips = center.config.Echips or 0,
ee_chips = center.config.EEchips or 0,
eee_chips = center.config.EEEchips or 0,
hyper_chips = type(center.config.Hchips) == 'table' and center.config.Hchips or {0, 0},
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "local p_dollars = card:get_p_dollars()"
position = "before"
payload = '''
local x_chips = card:get_chip_x_bonus()
if x_chips > 0 then
ret.x_chips = x_chips
end
local e_chips = card:get_chip_e_bonus()
if e_chips > 0 then
ret.e_chips = e_chips
end
local ee_chips = card:get_chip_ee_bonus()
if ee_chips > 0 then
ret.ee_chips = ee_chips
end
local eee_chips = card:get_chip_eee_bonus()
if eee_chips > 0 then
ret.eee_chips = eee_chips
end
local hyper_chips = card:get_chip_hyper_bonus()
if type(hyper_chips) == 'table' and hyper_chips[1] > 0 and hyper_chips[2] > 0 then
ret.hyper_chips = hyper_chips
end
local e_mult = card:get_chip_e_mult()
if e_mult > 0 then
ret.e_mult = e_mult
end
local ee_mult = card:get_chip_ee_mult()
if ee_mult > 0 then
ret.ee_mult = ee_mult
end
local eee_mult = card:get_chip_eee_mult()
if eee_mult > 0 then
ret.eee_mult = eee_mult
end
local hyper_mult = card:get_chip_hyper_mult()
if type(hyper_mult) == 'table' and hyper_mult[1] > 0 and hyper_mult[2] > 0 then
ret.hyper_mult = hyper_mult
end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif eval_type == 'dollars' then"
position = "before"
payload = '''
elseif eval_type == 'x_chips' then
sound = 'talisman_xchip'
amt = amt
text = 'X' .. amt
colour = G.C.CHIPS
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'e_chips' then
sound = 'talisman_echip'
amt = amt
text = '^' .. amt
colour = G.C.CHIPS
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'ee_chips' then
sound = 'talisman_eechip'
amt = amt
text = '^^' .. amt
colour = G.C.CHIPS
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'eee_chips' then
sound = 'talisman_eeechip'
amt = amt
text = '^^^' .. amt
colour = G.C.CHIPS
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'hyper_chips' then
sound = 'talisman_eeechip'
text = (amt[1] > 5 and ('{' .. tostring(amt[1]) .. '}') or string.rep('^', amt[1])) .. tostring(amt[2])
amt = amt[2]
colour = G.C.CHIPS
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'e_mult' then
sound = 'talisman_emult'
amt = amt
text = '^' .. amt .. ' Mult'
colour = G.C.MULT
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'ee_mult' then
sound = 'talisman_eemult'
amt = amt
text = '^^' .. amt .. ' Mult'
colour = G.C.MULT
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'eee_mult' then
sound = 'talisman_eeemult'
amt = amt
text = '^^^' .. amt .. ' Mult'
colour = G.C.MULT
config.type = 'fade'
config.scale = 0.7
elseif eval_type == 'hyper_mult' then
sound = 'talisman_eeemult'
text = (amt[1] > 5 and ('{' .. tostring(amt[1]) .. '}') or string.rep('^', amt[1])) .. tostring(amt[2]) .. ' Mult'
amt = amt[2]
colour = G.C.MULT
config.type = 'fade'
config.scale = 0.7
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if effects[ii].message then"
position = "before"
payload = '''
if effects[ii].x_chips then
mod_percent = true
hand_chips = mod_chips(hand_chips*effects[ii].x_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(G.hand.cards[i], 'x_chips', effects[ii].x_chips, percent)
end
if effects[ii].e_chips then
mod_percent = true
hand_chips = mod_chips(hand_chips^effects[ii].e_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(G.hand.cards[i], 'e_chips', effects[ii].e_chips, percent)
end
if effects[ii].ee_chips then
mod_percent = true
hand_chips = mod_chips(hand_chips:arrow(2, effects[ii].ee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(G.hand.cards[i], 'ee_chips', effects[ii].ee_chips, percent)
end
if effects[ii].eee_chips then
mod_percent = true
hand_chips = mod_chips(hand_chips:arrow(3, effects[ii].eee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(G.hand.cards[i], 'eee_chips', effects[ii].eee_chips, percent)
end
if effects[ii].hyper_chips and type(effects[ii].hyper_chips) == 'table' then
mod_percent = true
hand_chips = mod_chips(hand_chips:arrow(effects[ii].hyper_chips[1], effects[ii].hyper_chips[2]))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(G.hand.cards[i], 'hyper_chips', effects[ii].hyper_chips, percent)
end
if effects[ii].e_mult then
mod_percent = true
mult = mod_mult(mult^effects[ii].e_mult)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(G.hand.cards[i], 'e_mult', effects[ii].e_mult, percent)
end
if effects[ii].ee_mult then
mod_percent = true
mult = mod_mult(mult:arrow(2, effects[ii].ee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(G.hand.cards[i], 'ee_mult', effects[ii].ee_mult, percent)
end
if effects[ii].eee_mult then
mod_percent = true
mult = mod_mult(mult:arrow(3, effects[ii].eee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(G.hand.cards[i], 'eee_mult', effects[ii].eee_mult, percent)
end
if effects[ii].hyper_mult and type(effects[ii].hyper_mult) == 'table' then
mod_percent = true
mult = mod_mult(mult:arrow(effects[ii].hyper_mult[1], effects[ii].hyper_mult[2]))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(G.hand.cards[i], 'hyper_mult', effects[ii].hyper_mult, percent)
end
'''
match_indent = true
# sfx
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "sound = extra.edition and 'foil2' or extra.mult_mod and 'multhit1' or extra.Xmult_mod and 'multhit2' or 'generic1'"
position = "at"
payload = '''sound = extra.edition and 'foil2' or extra.mult_mod and 'multhit1' or extra.Xmult_mod and 'multhit2' or extra.Xchip_mod and 'talisman_xchip' or extra.Echip_mod and 'talisman_echip' or extra.Emult_mod and 'talisman_emult' or extra.EEchip_mod and 'talisman_eechip' or extra.EEmult_mod and 'talisman_eemult' or (extra.EEEchip_mod or extra.hyperchip_mod) and 'talisman_eeechip' or (extra.EEEmult_mod or extra.hypermult_mod) and 'talisman_eeemult' or 'generic1'
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "--calculate the card edition effects"
position = "before"
payload = '''
if effects[ii].x_chips then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips*effects[ii].x_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'x_chips', effects[ii].x_chips, percent)
end
if effects[ii].e_chips then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips^effects[ii].e_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'e_chips', effects[ii].e_chips, percent)
end
if effects[ii].ee_chips then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips:arrow(2, effects[ii].ee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'ee_chips', effects[ii].ee_chips, percent)
end
if effects[ii].eee_chips then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips:arrow(3, effects[ii].eee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'eee_chips', effects[ii].eee_chips, percent)
end
if effects[ii].hyper_chips and type(effects[ii].hyper_chips) == 'table' then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips:arrow(effects[ii].hyper_chips[1], effects[ii].hyper_chips[2]))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'hyper_chips', effects[ii].hyper_chips, percent)
end
if effects[ii].e_mult then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
mult = mod_mult(mult^effects[ii].e_mult)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(scoring_hand[i], 'e_mult', effects[ii].e_mult, percent)
end
if effects[ii].ee_mult then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
mult = mod_mult(mult:arrow(2, effects[ii].ee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(scoring_hand[i], 'ee_mult', effects[ii].ee_mult, percent)
end
if effects[ii].eee_mult then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
mult = mod_mult(mult:arrow(3, effects[ii].eee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(scoring_hand[i], 'eee_mult', effects[ii].eee_mult, percent)
end
if effects[ii].hyper_mult and type(effects[ii].hyper_mult) == 'table' then
mod_percent = true
if effects[ii].card then juice_card(effects[ii].card) end
mult = mod_mult(mult:arrow(effects[ii].hyper_mult[1], effects[ii].hyper_mult[2]))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(scoring_hand[i], 'hyper_mult', effects[ii].hyper_mult, percent)
end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = 'if effects[ii].edition.p_dollars_mod then'
position = 'before'
match_indent = true
payload = '''
if scoring_hand and scoring_hand[i] and scoring_hand[i].edition then
local trg = scoring_hand[i]
local edi = trg.edition
if edi.x_chips then
hand_chips = mod_chips(hand_chips * edi.x_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = 'X'.. edi.x_chips ..' Chips',
edition = true,
x_chips = true})
end
if edi.e_chips then
hand_chips = mod_chips(hand_chips ^ edi.e_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^'.. edi.e_chips ..' Chips',
edition = true,
e_chips = true})
end
if edi.ee_chips then
hand_chips = mod_chips(hand_chips:arrow(2, edi.ee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^^'.. edi.ee_chips ..' Chips',
edition = true,
ee_chips = true})
end
if edi.eee_chips then
hand_chips = mod_chips(hand_chips:arrow(3, edi.eee_chips))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^^^'.. edi.eee_chips ..' Chips',
edition = true,
eee_chips = true})
end
if edi.hyper_chips and type(edi.hyper_chips) == 'table' then
hand_chips = mod_chips(hand_chips:arrow(edi.hyper_chips[1], edi.hyper_chips[2]))
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = (edi.hyper_chips[1] > 5 and ('{' .. edi.hyper_chips[1] .. '}') or string.rep('^', edi.hyper_chips[1])) .. edi.hyper_chips[2] ..' Chips',
edition = true,
eee_chips = true})
end
if edi.e_mult then
mult = mod_mult(mult ^ edi.e_mult)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^'.. edi.e_mult ..' Mult',
edition = true,
e_mult = true})
end
if edi.ee_mult then
mult = mod_mult(mult:arrow(2, edi.ee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^^'.. edi.ee_mult ..' Mult',
edition = true,
ee_mult = true})
end
if edi.eee_mult then
mult = mod_mult(mult:arrow(3, edi.eee_mult))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = '^^^'.. edi.eee_mult ..' Mult',
edition = true,
eee_mult = true})
end
if edi.hyper_mult and type(edi.hyper_mult) == 'table' then
mult = mod_mult(mult:arrow(edi.hyper_mult[1], edi.hyper_mult[2]))
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = (edi.hyper_mult[1] > 5 and ('{' .. edi.hyper_mult[1] .. '}') or string.rep('^', edi.hyper_mult[1])) .. edi.hyper_mult[2] ..' Mult',
edition = true,
hyper_mult = true})
end
end
'''
# my fix for this one is really scuffed
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = 'if edition_effects.jokers.x_mult_mod then'
position = 'before'
match_indent = true
payload = '''
if edition_effects.jokers.x_mult_mod then
mult = mod_mult(mult*edition_effects.jokers.x_mult_mod)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(_card, 'jokers', nil, percent, nil, {
message = localize{type='variable',key='a_xmult',vars={edition_effects.jokers.x_mult_mod}},
x_mult_mod = edition_effects.jokers.x_mult_mod,
colour = G.C.EDITION,
edition = true})
end
if G.jokers.cards and G.jokers.cards[i] and G.jokers.cards[i].edition then
local trg = G.jokers.cards[i]
local edi = trg.edition
if edi.x_chips then
hand_chips = mod_chips(hand_chips * edi.x_chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(trg, 'extra', nil, percent, nil,
{message = 'X'.. edi.x_chips ..' Chips',
edition = true,
x_chips = true})
end