-
Notifications
You must be signed in to change notification settings - Fork 3
/
JellyJokers.lua
1974 lines (1860 loc) · 92.8 KB
/
JellyJokers.lua
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
--- STEAMODDED HEADER
--- MOD_NAME: Jelly's Jokers
--- MOD_ID: JellyJokers
--- MOD_AUTHOR: [JamesTheJellyfish]
--- MOD_DESCRIPTION: A pack of Jokers
----------------------------------------------
------------MOD CODE -------------------------
function SMODS.INIT.JellyJokers()
sendDebugMessage("Loaded JellyJokers~")
local localization = {
j_tarlton = {
name = "Tarlton",
text = {
"Copies the effects of",
"all other {C:attention}Jokers{}",
"In your possession.",
"{C:inactive}(must be compatible){}"
},
},
j_pierrot = {
name = "Pierrot",
text = {
"Allows for {C:attention}+1{}",
"card to be selected and played,",
},
},
j_prosopagnosia = {
name = "Prosopagnosia",
text = {
"{C:red}NO{} cards are",
"considered",
"{C:attention}face{} cards",
},
},
j_double_vision = {
name = "Double Vision",
text = {
"All cards are",
"considered",
"{C:attention}2s{}",
},
},
j_scouter = {
name = "Scouter Joker",
text = {
"Tells you what a given hand",
"would score, including all bonuses.",
"Current hand would score:",
"{C:blue,E:1,S:0.8}#1#{}",
"{C:inactive}(May not score correctly for",
"{C:inactive}conditional effects, such as {C:attention}Wee Joker{C:inactive} or {C:attention}Blackboard{C:inactive}){}"
},
},
j_special_snowflake = {
name = "Special Snowflake",
text = {
"This Joker gains {X:mult,C:white} X#1# {} Mult",
"for each {C:attention}Uniquely enhanced card",
"in your full deck",
"{C:inactive}(ex: {C:green}gold, gold with red seal, steel, etc.{}{C:inactive})",
"{C:inactive}(Currently {X:mult,C:white} X#2# {C:inactive} Mult)",
},
},
j_collector = {
name = "The Collector",
text = {
"This Joker gains {X:mult,C:white} X#1# {} Mult",
"for each {C:attention}non-base edition Joker",
"you have.",
"{C:inactive}(Currently {X:mult,C:white} X#2# {C:inactive} Mult)",
},
},
j_copycat = {
name = "Copycat",
text = {
"Copies ability of",
"a random {C:attention}Joker{} in your possession",
"(currently copying {C:green}#1#{})",
},
},
j_greener_pastures = {
name = "Greener Pastures",
text = {
"When blind is selected, creates a random",
"{C:dark_edition}negative{} Joker that always sells for {C:money}$0{}.",
"The joker is destroyed and replaced every round.",
},
},
j_one_more = {
name = "One More Time!",
text = {
"Sell this card to",
"Add your previous hand to current score",
"(Currently {C:blue,E:1,S:1}#1#{})",
},
},
j_pessimist = {
name = "Pessimist",
text = {
"sell this card to apply",
"{C:dark_edition}negative{} to a random Joker.",
"Permanent {C:blue}-#1#{} hands.",
"{C:inactive}({C:attention}Destroys{C:inactive} itself when blind selected){}"
},
},
j_lipographic_jokr = {
name = "Lipographic Jokr",
text = {
"will grant {C:mult}+#1#{} mult according to",
"all scoring cards. Grants {C:mult}-#2#{} mult",
"for all {C:attention}fifth symbol{}",
"in alias of scoring card.",
},
},
j_buckleswasher = {
name = "Buckleswasher",
text = {
"Adds the sell value of",
"all owned {C:attention}Jokers{} {C:red,E:1,S:0.3}RIGHT{}",
"of this card to Mult",
"{C:inactive}(Currently {C:mult}+#1#{C:inactive} Mult)",
},
},
j_hatter = {
name = "Mad Hatter",
text = {
"{C:green,E:1,S:0.7}shuffles{} the {C:attention}Enhancements{},",
"{C:attention}Seals{}, and {C:attention}Editions{}",
"of played hand",
},
},
j_safari = {
name = "Safari Joker",
text = {
"{C:attention}All cards{} will now",
"count as the same suit",
},
},
j_oops_1s = {
name = "Oops! All 1s",
text = {
"Halves all {C:attention}listed",
"{C:green,E:1,S:1.1}probabilities",
"{C:inactive}(ex: {C:green}1 in 3{C:inactive} -> {C:green}1 in 6{C:inactive})",
},
},
j_zeno = {
name = "Zeno's Joker",
text = {
"if you draw at least 50% of your deck",
"during the round, a {C:attention}random{} card",
"you didn't draw will be {C:red}destroyed{}",
"and a {C:spectral}Spectral{} card will be created",
},
},
j_wise_penny = {
name = "Wise Penny",
text = {
"if you {C:warning}don't{} spend money at a shop, a random",
"nonsealed card gets a {C:money}gold seal{}",
},
},
j_furnace = {
name = "Furnace",
text = {
"all {C:attention}coal cards{} upgrade at the ",
"{C:attention}same time",
},
},
j_fridge = {
name = "Fridge",
text = {
"{C:attention}Food Jokers{} no longer",
"decay or go extinct.",
},
},
j_krampus = {
name = "Krampus",
text = {
"Adds a {C:attention}Coal Card{} to your hand",
"at the start of each blind.",
},
},
j_edition_eater = {
name = "Edition Eater",
text = {
"When blind is Selected,",
"removes the edition of the joker to its right.",
"Gains {X:mult,C:white}xN{} Mult per edition eaten.",
"{C:inactive}(N = {C:dark_edition}Foil{} {X:mult,C:white}x#1#{C:inactive}, {C:dark_edition}Holographic{} {X:mult,C:white}x#2#{C:inactive}, ",
"{C:dark_edition}Negative{} {X:mult,C:white}x#4#{C:inactive}, {C:dark_edition}Polychrome{} {X:mult,C:white}x#3#{C:inactive})",
"(Will {C:warning}Destroy{} the joker if it's negative and there's no room)",
"Currently {X:mult,C:white}x#5#{} Mult."
},
},
j_magnate = {
name = "Magnate",
text = {
"standard packs will only contain",
"cards that are the {C:attention}same rank and suit{}",
"as cards already in your deck.",
},
},
j_greedy_pot = {
name = "Greedy Pot",
text = {
"After play or discard, always draw",
"{C:attention}2 more{} cards than you would otherwise.",
},
},
j_pink_menace = {
name = "The Pink Menace",
text = {
"When blind is selected,",
"if the card to the right of this one is a food joker,",
"{C:attention}consume it{}, and for the next round, The",
"Pink Menace provides {C:attention}twice{} the benefit",
"that you would have received from the food joker.",
},
},
j_caviar = {
name = "Caviar",
text = {
"gives {C:money}$#1#{} per hand played.",
"reduces by {C:attention}#2#{} each round,",
},
},
j_chef_joker = {
name = "Chef Joker",
text = {
"When blind is selected,",
"create a random food joker",
"{C:inactive}(Must have room.)",
},
},
j_brownie = {
name = "Two-Bite Brownie",
text = {
"retriggers all twos {C:attention}#1#{} times",
"reduces by #2# each round",
},
},
j_mineral_deposit = {
name = "Mineral Deposit",
text = {
"retriggers all cards that have",
"{C:attention}no rank or suit{}",
},
},
j_glutton_joker = {
name = "Glutton Joker",
text = {
"{X:mult,C:white}x#1#{} Mult for every food joker that has been",
"{C:attention}consumed{} this game",
"Currently {X:mult,C:white}x#2#{} Mult"
},
},
}
local food_localization = {
food_jokers = {
name = "Food Jokers",
text = {
"Food Jokers depict food, and",
"{C:attention}decay/destroy{} themselves over time.",
"{C:inactive}(i.e. {C:attention}Gros Michel{C:inactive}, {C:attention}Ramen{C:inactive}, {C:attention}Popcorn{C:inactive}, etc.)"
}
}
}
-- Misc localization
G.localization.misc.dictionary.k_no_you = "Reversed!"
G.localization.misc.dictionary.k_hatter = "CHANGE PLACES!"
G.localization.misc.dictionary.k_zeno = "Halfway!"
G.localization.misc.dictionary.k_chilled = "Chilled!"
G.localization.misc.dictionary.k_furnace_heat = "Heating Up!"
G.localization.misc.dictionary.k_coal_stone = "+1 Coal"
G.localization.misc.dictionary.k_unwise_penny = "An Unwise Investment!"
G.localization.misc.dictionary.k_wise_penny = "A Wise Investment!"
G.localization.misc.dictionary.k_consumed = "Consumed!"
digits = {
[1] = "One",
[2] = "Two",
[3] = "Three",
[4] = "Four",
[5] = "Five",
[6] = "Six",
[7] = "Seven",
[8] = "Eight",
[9] = "Nine",
[10] = "Ten",
[11] = "Eleven",
[12] = "Twelve",
[13] = "Thriteen",
[14] = "Fourteen",
[15] = "Fifteen",
[16] = "Sixteen",
[17] = "Seventeen",
[18] = "Eighteen",
[19] = "Nineteen",
[20] = "Twenty"
}
for i=6,20 do
G.localization.misc['poker_hands'][digits[i] .. ' of a Kind'] = digits[i] .. ' of a Kind'
G.localization.misc['poker_hands']['Flush ' .. digits[i]] = 'Flush ' .. digits[i]
if i % 2 == 0 then
local est = 'er'
if i > 7 then est = string.rep("est", math.floor((i-6)/2)) end
G.localization.misc['poker_hands']['Flush'.. est ..' House'] = 'Flush' .. est .. ' House'
G.localization.misc['poker_hands']['Full'.. est ..' House'] = 'Full' .. est .. ' House'
G.localization.misc['poker_hands'][digits[i/2] .. ' Pair'] = digits[i/2] .. ' Pair'
end
end
init_localization()
updateLocalizationJelly(localization, "Joker")
updateLocalizationJelly(food_localization, "Other")
if supported_languages[G.SETTINGS.language] then
local joker_localization = assert(loadstring(love.filesystem.read(SMODS.findModByID("JellyJokers").path .. '/localization/' ..G.SETTINGS.language..'/jokers.lua')))()
updateLocalizationJelly(joker_localization, "Joker")
end
--[[SMODS.Joker:new(
name, slug,
config,
spritePos, loc_txt,
rarity, cost, unlocked, discovered, blueprint_compat, eternal_compat,
atlas
)
]]
--
local jokers = {
j_tarlton= {order = 1, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 4, cost = 20, name = "Tarlton", pos = {x=1,y=16}, soul_pos = {x=1, y=9}, set = "Joker", effect = "Copycat", cost_mult = 1.0, config = {},unlock_condition = {type = '', extra = '', hidden = true}},
j_pierrot= {order = 2, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 4, cost = 20, name = "Pierrot", pos = {x=5,y=16}, soul_pos = {x=0, y=9}, set = "Joker", effect = "", config = {}, unlock_condition = {type = '', extra = '', hidden = true}},
j_lipographic_jokr= {order = 3, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 5, name = "Lipographic Jokr", pos = {x=2,y=16}, set = "Joker", config = {extra = {mult = 10, sub = 5}}},
j_oops_1s= {order = 4, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 1, cost = 4, name = "Oops! All 1s", pos = {x=3,y=16}, set = "Joker", effect = "", config = {}, unlock_condition = {type = 'chip_score', chips = 10000}},
j_safari= {order = 5, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 3, cost = 7, name = "Safari Joker", pos = {x=4,y=16}, set = "Joker", effect = "", config = {}, unlock_condition = {type = 'modify_deck', extra = {count = 3, enhancement = 'Wild Card', e_key = 'm_wild'}}},
j_copycat= {order = 6, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 3, cost = 10, name = "Copycat", pos = {x=0,y=16}, set = "Joker", effect = "Copycat", cost_mult = 1.0, config = {},unlock_condition = {type = 'win_custom'}},
j_pessimist= {order = 7, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = false, rarity = 3, cost = 10, name = "Pessimist", pos = {x=6,y=16}, set = "Joker", effect = "", config = {extra = 2}, unlock_condition = {type = 'win_custom'}},
j_prosopagnosia= {order = 8, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 1, cost = 5, name = "Prosopagnosia", pos = {x=7,y=16}, set = "Joker", effect = "All face cards", cost_mult = 1.0, config = {}},
j_double_vision= {order = 9, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 3, cost = 10, name = "Double Vision", pos = {x=8,y=16}, set = "Joker", effect = "", cost_mult = 1.0, config = {}},
j_scouter= {order = 10, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 1, cost = 4, name = "Scouter Joker", pos = {x=9,y=16}, set = "Joker", effect = "", cost_mult = 1.0, config = {extra = 0}},
j_zeno= {order = 11, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 3, cost = 8, name = "Zeno's Joker", pos = {x = 0, y = 17}, set = 'Joker', config = {}},
j_one_more= {order = 12, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 1, cost = 8, name = "One More Time!", pos = {x = 1, y = 17}, set = 'Joker', config = {extra = {score=0, old_chips=0}}},
j_collector= {order = 13, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 3, cost = 7, name = "The Collector", pos = {x=2,y=17}, set = "Joker", effect = "Card Buff", cost_mult = 1.0, config = {extra = 1.5}},
j_buckleswasher= {order = 14, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 4, name = "Buckleswasher", pos = {x=3,y=17}, set = "Joker", effect = "Set Mult", cost_mult = 1.0, config = {mult = 1},unlock_condition = {type = 'c_jokers_sold', extra = 20}},
j_hatter= {order = 15, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 2, cost = 7, name = "Mad Hatter",set = "Joker", config = {}, pos = {x=4,y=17}},
j_greener_pastures= {order = 16, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 2, cost = 8, name = "Greener Pastures",set = "Joker", config = {}, pos = {x=5,y=17}},
j_special_snowflake={order = 17, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 6, name = "Special Snowflake",set = "Joker", config = {extra = 0.2}, pos = {x=6,y=17}, soul_pos={x=7, y=17}},
j_glutton_joker= {order = 18, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 6, name = "Glutton Joker",set = "Joker", config = {extra = 1}, pos = {x=2,y=14}},
j_mineral_deposit= {order = 19, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 5, name = "Mineral Deposit",set = "Joker", config = {extra = 1}, pos = {x=1,y=14}},
j_brownie= {order = 20, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = false, rarity = 1, cost = 4, name = "Two-Bite Brownie",set = "Joker", config = {extra = {retriggers=2, retrigger_mod=1}}, pos = {x=0,y=14}},
j_caviar= {order = 21, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = false, rarity = 2, cost = 2, name = "Caviar",set = "Joker", config = {extra = {dollars = 5, dollar_mod = 1}}, pos = {x=9,y=15}},
j_chef_joker= {order = 22, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 5, name = "Chef Joker",set = "Joker", config = {}, pos = {x=8,y=15}},
j_pink_menace= {order = 23, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 3, name = "The Pink Menace",set = "Joker", config = {extra = {eaten = nil, val = 0}}, pos = {x=7,y=15}},
j_greedy_pot= {order = 24, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 3, cost = 10, name = "Greedy Pot",set = "Joker", config = {}, pos = {x=6,y=15}},
j_magnate= {order = 25, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 2, cost = 5, name = "Magnate",set = "Joker", config = {}, pos = {x=5,y=15}},
j_edition_eater= {order = 26, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 8, name = "Edition Eater",set = "Joker", config = {extra = {foil = 0.5, holo = 1, polychrome = 2, negative = 1.5, Xmult = 1}}, pos = {x=4,y=15}},
j_krampus= {order = 27, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 6, name = "Krampus",set = "Joker", config = {}, pos = {x=3,y=15}},
j_fridge= {order = 28, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 2, cost = 3, name = "Fridge",set = "Joker", config = {}, pos = {x=2,y=15}},
j_furnace= {order = 29, unlocked = true, discovered = true, blueprint_compat = false, eternal_compat = true, rarity = 3, cost = 6, name = "Furnace",set = "Joker", config = {}, pos = {x=1,y=15}},
j_wise_penny= {order = 30, unlocked = true, discovered = true, blueprint_compat = true, eternal_compat = true, rarity = 2, cost = 7, name = "Wise Penny",set = "Joker", config = {extra = true}, pos = {x=0,y=15}},
}
-- Add sprites
SMODS.Sprite:new("JellyJokers", SMODS.findModByID("JellyJokers").path, "Jokers_JellyMod.png", 71, 95, "asset_atli")
:register()
addJokersToPools(jokers, "JellyJokers")
end
local init_game_objectobjref = Game.init_game_object
function Game.init_game_object(self)
local gameObj = init_game_objectobjref(self)
gameObj.foods_eaten = 0
gameObj.food_jokers_list = {["Gros Michel"] = 'j_gros_michel',
["Cavendish"] = 'j_cavendish',
["Popcorn"] = 'j_popcorn',
["Ice Cream"] = 'j_ice_cream',
["Ramen"] = 'j_ramen',
["Seltzer"] = 'j_selzer',
["Turtle Bean"] = 'j_turtle_bean',
["Two-Bite Brownie"] = 'j_brownie',
["Caviar"] = 'j_caviar',
}
return gameObj
end
local calculate_jokerref = Card.calculate_joker
function Card.calculate_joker(self, context)
if self.ability.name == "Hiker" and context.scouter then return end
if self.ability.name == "To Do List" and context.scouter then return end
if self.ability.name == "Matador" and context.scouter then return end
if self.ability.name == "Mr. Bones" and context.scouter then return end
if G.GAME.food_jokers_list[self.ability.name] and next(find_joker("Fridge")) and not context.blueprint then
if self.ability.name == "Ramen" then
if context.discard then
return {
message = localize('k_chilled'),
colour = G.C.FILTER
}
end
elseif self.ability.name == "Seltzer" then
if context.after then
return {
message = localize('k_chilled'),
colour = G.C.FILTER
}
end
elseif context.end_of_round and not context.repetition then
return {
message = localize('k_chilled'),
colour = G.C.FILTER
}
end
end
local calc_ref = calculate_jokerref(self, context)
if calc_ref then
if calc_ref.message == localize('k_eaten_ex') or calc_ref.message == localize('k_drank_ex') or calc_ref.message == localize('k_extinct_ex') then
G.GAME.foods_eaten = G.GAME.foods_eaten + 1
end
end
if self.ability.set == "Joker" and not self.debuff then
if self.ability.name == "Tarlton" and not context.blueprint then
local other_joker = nil
local final_ret = nil
for i=1,#G.jokers.cards do
other_joker = G.jokers.cards[i]
if other_joker and other_joker.ability.name ~= self.ability.name and other_joker.config.center.blueprint_compat then
context.blueprint_card = context.blueprint_card or self
context.blueprint = 1
local other_joker_ret = other_joker:calculate_joker(context)
if final_ret == nil and other_joker_ret ~= nil then
final_ret = other_joker_ret
final_ret.card = context.blueprint_card or self
final_ret.colour = G.C.RED
elseif other_joker_ret then
for k, val in pairs(other_joker_ret) do
if not final_ret[k] then
final_ret[k] = val
end
if final_ret[k] and k == "x_mult" then
final_ret[k] = final_ret[k] * val
end
if final_ret[k] and k == "mult" then
final_ret[k] = final_ret[k] + val
end
if final_ret[k] and k == "chips" then
final_ret[k] = final_ret[k] + val
end
if final_ret[k] and k == "dollars" then
final_ret[k] = final_ret[k] + val
end
if final_ret[k] and k == "repetitions" then
final_ret[k] = final_ret[k] + val
end
if final_ret[k] and k == "message" then
final_ret[k] = final_ret[k] .. " " .. val
end
end
end
end
end
if final_ret then
return final_ret
end
end
if self.ability.name == "Copycat" then
local other_joker = nil
local joker_name = G.GAME.current_round.copycat_joker_name
for i= 1, #G.jokers.cards do
if G.jokers.cards[i].ability.name == joker_name then other_joker = G.jokers.cards[i] end
end
if other_joker and other_joker ~= self and other_joker.config.center.blueprint_compat then
context.blueprint = (context.blueprint and (context.blueprint + 1)) or 1
context.blueprint_card = context.blueprint_card or self
if context.blueprint > #G.jokers.cards + 1 then return end
local other_joker_ret = other_joker:calculate_joker(context)
if other_joker_ret then
other_joker_ret.card = context.blueprint_card or self
other_joker_ret.colour = G.C.RED
return other_joker_ret
end
end
end
if context.open_booster then
if self.ability.name == "Wise Penny" and self.ability.extra and context.card.cost > 0 then
self.ability.extra = false
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_unwise_penny'), colour = G.C.RED})
end
elseif context.buying_card then
if self.ability.name == "Wise Penny" and self.ability.extra then
self.ability.extra = false
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_unwise_penny'), colour = G.C.RED})
end
elseif context.selling_self then
if self.ability.name == 'One More Time!' and not context.blueprint and G.GAME.blind:get_type() then
G.E_MANAGER:add_event(Event({
trigger = 'after',delay = 0.4,
func = (function() update_hand_text({delay = 0, immediate = true}, {mult = 0, chips = 0, chip_total = math.floor(self.ability.extra.score), level = '', handname = ''});play_sound('button', 0.9, 0.6);return true end)
}))
if self.ability.extra.score > 0 then
delay(0.8)
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function() play_sound('chips2');return true end)
}))
end
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blocking = false,
ref_table = G.GAME,
ref_value = 'chips',
ease_to = G.GAME.chips + math.floor(self.ability.extra.score),
delay = 0.5,
func = (function(t) return math.floor(t) end)
}))
percent = 0.8
percent_delta = 0.3
for i=1, #G.jokers.cards do
--calculate the joker after hand played effects
local effects = eval_card(G.jokers.cards[i], {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, after = true})
if effects.jokers then
card_eval_status_text(G.jokers.cards[i], 'jokers', nil, percent, nil, effects.jokers)
percent = percent + percent_delta
end
end
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blocking = true,
ref_table = G.GAME.current_round.current_hand,
ref_value = 'chip_total',
ease_to = 0,
delay = 0.5,
func = (function(t) return math.floor(t) end)
}))
return {
message = "+ " .. number_format(self.ability.score),
colour = G.C.CHIPS
}
end
if self.ability.name == 'Pessimist' and not context.blueprint then
local temp_pool = {}
for k, v in pairs(G.jokers.cards) do
if v.ability.set == 'Joker' and (not v.edition) and v ~= self then
table.insert(temp_pool, v)
end
end
if #temp_pool > 0 then
local eligible_card = pseudorandom_element(temp_pool, pseudoseed('Pessimist'))
local edition = {negative = true}
eligible_card:set_edition(edition, true)
G.GAME.round_resets.hands = G.GAME.round_resets.hands - self.ability.extra
ease_hands_played(-self.ability.extra)
end
end
elseif context.selling_card then
elseif context.reroll_shop then
if self.ability.name == "Wise Penny" and self.ability.extra and G.GAME.current_round.reroll_cost > 0 then
self.ability.extra = false
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_unwise_penny'), colour = G.C.RED})
end
elseif context.ending_shop then
if self.ability.name == "Wise Penny" then
if self.ability.extra then
local eligible_cards = {}
for k, v in ipairs(G.deck.cards) do
if not v.seal then
eligible_cards[#eligible_cards+1] = v
end
end
if #eligible_cards > 0 then
local chosen_card = pseudorandom_element(eligible_cards, pseudoseed('wise_penny'))
chosen_card:set_seal('Gold', true)
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_wise_penny'), colour = G.C.SECONDARY_SET.Enhanced})
end
end
end
elseif context.skip_blind then
elseif context.skipping_booster then
elseif context.playing_card_added and not self.getting_sliced then
elseif context.first_hand_drawn then
elseif context.setting_blind and not self.getting_sliced then
if self.ability.name == "Wise Penny" and not (context.blueprint_card or self).getting_sliced and not context.blueprint then
self.ability.extra = true
end
if self.ability.name == 'Greener Pastures' and not (context.blueprint_card or self).getting_sliced and not context.blueprint then
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
play_sound('timpani')
local card = create_card('Joker', G.jokers, false, nil, nil, nil, nil, 'green')
card:set_edition({negative = true})
card:set_cost()
card.cost = 0
card.ability.extra_value = -1000
card.sell_cost = 0
card:add_to_deck()
G.jokers:emplace(card)
return true end }))
delay(0.6)
end
if self.ability.name == 'Pessimist' and not (context.blueprint_card or self).getting_sliced and not context.blueprint then
self:start_dissolve()
end
if self.ability.name == 'Chef Joker' and not (context.blueprint_card or self).getting_sliced then
local jokers_to_create = math.min(1, G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer))
G.GAME.joker_buffer = G.GAME.joker_buffer + jokers_to_create
local food_joker_keys = {}
for k, v in pairs(G.GAME.food_jokers_list) do
if not next(find_joker(k)) and (k ~= "Cavendish" or G.GAME.pool_flags.gros_michel_extinct)then
food_joker_keys[#food_joker_keys+1] = v
end
end
if #food_joker_keys > 0 then
G.E_MANAGER:add_event(Event({
func = function()
for i = 1, jokers_to_create do
local card = create_card('Joker', G.jokers, nil, 0, nil, nil, pseudorandom_element(food_joker_keys, pseudoseed('chef_joker')), nil)
card:add_to_deck()
G.jokers:emplace(card)
card:start_materialize()
G.GAME.joker_buffer = 0
end
return true
end}))
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_plus_joker'), colour = G.C.BLUE})
end
end
if self.ability.name == "Krampus" and not (context.blueprint_card or self).getting_sliced then
G.E_MANAGER:add_event(Event({
func = function()
local front = pseudorandom_element(G.P_CARDS, pseudoseed('krampus_fr'))
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local card = Card(G.play.T.x + G.play.T.w/2, G.play.T.y, G.CARD_W, G.CARD_H, front, G.P_CENTERS.m_coal, {playing_card = G.playing_card})
card:start_materialize({G.C.SECONDARY_SET.Enhanced})
G.play:emplace(card)
table.insert(G.playing_cards, card)
return true
end}))
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_coal_stone'), colour = G.C.SECONDARY_SET.Enhanced})
G.E_MANAGER:add_event(Event({
func = function()
G.deck.config.card_limit = G.deck.config.card_limit + 1
return true
end}))
draw_card(G.play,G.deck, 90,'up', nil)
playing_card_joker_effects({true})
end
if self.ability.name == 'The Pink Menace' and not context.blueprint then
if self.ability.extra.eaten == "h_size" then
G.hand:change_size(-self.ability.extra.val)
end
self.ability.extra.val = 0
self.ability.extra.eaten = nil
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == self then my_pos = i; break end
end
if my_pos and G.jokers.cards[my_pos+1] and not self.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced and G.GAME.food_jokers_list[G.jokers.cards[my_pos+1].ability.name] then
local sliced_card = G.jokers.cards[my_pos+1]
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({func = function()
G.GAME.joker_buffer = 0
self:juice_up(0.8, 0.8)
if sliced_card.ability.name == "Ice Cream" then
self.ability.extra.val = sliced_card.ability.extra.chips * 2
self.ability.extra.eaten = "chips"
elseif sliced_card.ability.name == "Popcorn" then
self.ability.extra.val = sliced_card.ability.mult * 2
self.ability.extra.eaten = "mult"
elseif sliced_card.ability.name == "Gros Michel" then
self.ability.extra.val = sliced_card.ability.extra.mult * 2
self.ability.extra.eaten = "mult"
G.GAME.pool_flags.gros_michel_extinct = true
elseif sliced_card.ability.name == "Turtle Bean" then
self.ability.extra.val = sliced_card.ability.extra.h_size * 2
self.ability.extra.eaten = "h_size"
G.hand:change_size(self.ability.extra.val)
elseif sliced_card.ability.name == "Seltzer" then
self.ability.extra.val = 2
self.ability.extra.eaten = "repetitions"
elseif sliced_card.ability.name == "Ramen" then
self.ability.extra.val = sliced_card.ability.x_mult * 2
self.ability.extra.eaten = "x_mult"
elseif sliced_card.ability.name == "Cavendish" then
self.ability.extra.val = sliced_card.ability.extra.Xmult * 2
self.ability.extra.eaten = "x_mult"
elseif sliced_card.ability.name == "Caviar" then
self.ability.extra.val = sliced_card.ability.extra.dollars * 2
self.ability.extra.eaten = "play_dollars"
elseif sliced_card.ability.name == "Two-Bite Brownie" then
self.ability.extra.val = sliced_card.ability.extra.retriggers * 2
self.ability.extra.eaten = "2_retrigger"
end
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
G.GAME.foods_eaten = G.GAME.foods_eaten + 1
play_sound('slice1', 0.96+math.random()*0.08)
return true end }))
card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize('k_consumed')})
end
end
if self.ability.name == "Edition Eater" and not (context.blueprint_card or self).getting_sliced and not context.blueprint then
local target_joker = nil
for i=1,#G.jokers.cards do
if G.jokers.cards[i] == self and i < #G.jokers.cards then
target_joker = G.jokers.cards[i+1]
break
end
end
if target_joker and target_joker.edition then
local target_edition = target_joker.edition
sendDebugMessage(target_edition.type)
sendDebugMessage(self.ability.extra[target_edition.type])
self.ability.extra.Xmult = self.ability.extra.Xmult + self.ability.extra[target_edition.type]
target_joker:set_edition(nil, true, nil)
if target_edition.type == "negative" and #G.jokers.cards > G.jokers.config.card_limit then
card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize('k_no_room_ex')})
target_joker:start_dissolve()
end
card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_xmult',vars={self.ability.extra.Xmult}}})
end
end
elseif context.destroying_card then
elseif context.cards_destroyed then
elseif context.remove_playing_cards then
elseif context.using_consumeable then
elseif context.debuffed_hand then
elseif context.pre_discard then
elseif context.discard then
elseif context.end_of_round then
if context.individual then
if self.ability.name == 'Scouter Joker' then self.ability.extra = 0 end
elseif context.repetition then
elseif not context.blueprint then
if self.ability.name == 'Two-Bite Brownie' and not context.blueprint then
if self.ability.extra.retriggers - self.ability.extra.retrigger_mod <= 0 then
G.GAME.foods_eaten = G.GAME.foods_eaten + 1
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
self.T.r = -0.2
self:juice_up(0.3, 0.4)
self.states.drag.is = true
self.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(self)
self:remove()
self = nil
return true; end}))
return true
end
}))
return {
message = localize('k_eaten_ex'),
colour = G.C.RED
}
else
self.ability.extra.retriggers = self.ability.extra.retriggers - self.ability.extra.retrigger_mod
return {
message = localize{type='variable',key='a_chips_minus',vars={self.ability.extra.retrigger_mod}},
colour = G.C.FILTER
}
end
end
if self.ability.name == 'Caviar' and not context.blueprint then
if self.ability.extra.dollars - self.ability.extra.dollar_mod <= 0 then
G.GAME.foods_eaten = G.GAME.foods_eaten + 1
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
self.T.r = -0.2
self:juice_up(0.3, 0.4)
self.states.drag.is = true
self.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(self)
self:remove()
self = nil
return true; end}))
return true
end
}))
return {
message = localize('k_eaten_ex'),
colour = G.C.RED
}
else
self.ability.extra.dollars = self.ability.extra.dollars - self.ability.extra.dollar_mod
return {
message = '-' .. localize('$') .. self.ability.extra.dollar_mod,
colour = G.C.MONEY
}
end
end
if self.ability.name == "Zeno's Joker" and #G.playing_cards > 0 and #G.deck.cards / #G.playing_cards <= 0.5 and #G.deck.cards > 0 then
local card = pseudorandom_element(G.deck.cards, pseudoseed("Zeno's Joker"))
card.destroyed = true
card:remove()
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = (function()
local card = create_card('Spectral',G.consumeables, nil, nil, nil, nil, nil, 'sixth')
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0
return true
end)}))
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_plus_spectral'), colour = G.C.SECONDARY_SET.Spectral})
end
return {
message = localize('k_zeno'),
colour = G.C.RED
}
end
end
elseif context.repetition then
if self.ability.name == 'Mineral Deposit' and context.cardarea == G.play and context.other_card:get_id() < -10 then
return {
message = localize('k_again_ex'),
repetitions = self.ability.extra,
card = self
}
end
if self.ability.name == "Two-Bite Brownie" and context.cardarea == G.play and context.other_card:get_id() == 2 then
return {
message = localize('k_again_ex'),
repetitions = self.ability.extra.retriggers,
card = self
}
end
if self.ability.name == "The Pink Menace" and context.cardarea == G.play and (self.ability.extra.eaten == "repetitions" or (self.ability.extra.eaten == "2_retrigger" and context.other_card:get_id() == 2)) then
return {
message = localize('k_again_ex'),
repetitions = self.ability.extra.val,
card = self
}
end
elseif context.other_joker then
elseif context.adding_to_deck then
elseif context.individual then
if self.ability.name == 'Lipographic Jokr' and context.cardarea == G.play then
local curr_mult = self.ability.extra.mult
local mult_sub = self.ability.extra.sub
print("acting on: " .. tostring(context.other_card:get_id()))
if context.other_card:get_id() == 14 then curr_mult = curr_mult - mult_sub end
if context.other_card:get_id() == 3 then curr_mult = curr_mult - mult_sub*2 end
if context.other_card:get_id() == 5 then curr_mult = curr_mult - mult_sub end
if context.other_card:get_id() == 7 then curr_mult = curr_mult - mult_sub*2 end
if context.other_card:get_id() == 8 then curr_mult = curr_mult - mult_sub end
if context.other_card:get_id() == 9 then curr_mult = curr_mult - mult_sub end
if context.other_card:get_id() == 10 then curr_mult = curr_mult - mult_sub end
if context.other_card:get_id() == 12 then curr_mult = curr_mult - mult_sub*2 end
if context.other_card:is_suit("Spades") then curr_mult = curr_mult - mult_sub end
if context.other_card:is_suit("Hearts") then curr_mult = curr_mult - mult_sub end
if context.other_card.config.center == G.P_CENTERS.m_steel then curr_mult = curr_mult - mult_sub*2 end
if context.other_card.config.center == G.P_CENTERS.m_stone then curr_mult = self.ability.extra.mult - mult_sub end
if context.other_card.config.center == G.P_CENTERS.e_polychrome then curr_mult = curr_mult - mult_sub end
if context.other_card.config.center == G.P_CENTERS.e_negative then curr_mult = curr_mult - mult_sub end
if context.other_card.seal == 'Gold' then curr_mult = curr_mult - mult_sub end
if context.other_card.seal == 'Red' then curr_mult = curr_mult - mult_sub*2 end
if context.other_card.seal == 'Blue' then curr_mult = curr_mult - mult_sub*2 end
if context.other_card.seal == 'Purple' then curr_mult = curr_mult - mult_sub*2 end
print(curr_mult)
return {
mult = math.max(0, curr_mult),
card = self
}
end
if self.ability.name == 'Furnace' and context.cardarea == G.play and context.other_card.config.center == G.P_CENTERS.m_coal and not context.blueprint then
local changed_val = false
for k, v in ipairs(G.playing_cards) do
if v ~= context.other_card and v.config.center == G.P_CENTERS.m_coal then
changed_val = true
v.ability.extra.current = v.ability.extra.current + 1
end
end
if changed_val then
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_furnace_heat'), colour = G.C.DARK_EDITION})
end
end
else
if context.cardarea == G.jokers then
if context.before then
if self.ability.name == 'Mad Hatter' and not context.blueprint then
local enhanced = {}
local viable_cards = {}
for k, v in ipairs(context.full_hand) do
if not v.debuff then
viable_cards[#viable_cards+1] = v
G.E_MANAGER:add_event(Event({
func = function()
v:juice_up()
return true
end
}))
end
if v.config.center ~= G.P_CENTERS.c_base and not v.debuff then
enhanced[#enhanced+1] = {enhancement = v.config.center}
v:set_ability(G.P_CENTERS.c_base, nil, true)
end
if v.edition and not v.debuff then
enhanced[#enhanced+1] = {edition = v.edition}
v:set_edition(nil, true, nil)
end
if v.seal and not v.debuff then
enhanced[#enhanced+1] = {seal = v.seal}
v:set_seal(nil, nil, true)
end
end
if #enhanced > 0 then
for i=1,#enhanced do
local enhancement = enhanced[i]
local card = pseudorandom_element(viable_cards, pseudoseed('Mad Hatter'))
while (enhancement.enhancement and card.config.center ~= G.P_CENTERS.c_base) or (enhancement.edition and card.edition) or (enhancement.seal and card.seal) do
card = pseudorandom_element(viable_cards, seudoseed('Mad Hatter'))
end
if enhancement.enhancement then
card:set_ability(enhancement.enhancement, nil, true)
end
if enhancement.seal then
card:set_seal(enhancement.seal, nil, true)
end
if enhancement.edition then
card:set_edition(enhancement.edition, true, nil)
end
end
return {
message = localize("k_hatter"),
card = self
}
end
end
elseif context.after then
if self.ability.name == 'One More Time!' and not context.blueprint then
return {
message = tostring(number_format(self.ability.extra.score)),
colour = G.C.CHIPS
}
end
else
if self.ability.name == 'Special Snowflake' and self.ability.unique_tally > 0 then
return {
message = localize{type='variable',key='a_xmult',vars={1 + self.ability.extra*self.ability.unique_tally}},
Xmult_mod = 1 + self.ability.extra*self.ability.unique_tally,
colour = G.C.MULT
}
end
if self.ability.name == 'Glutton Joker' and G.GAME.foods_eaten > 0 then
return {
message = localize{type='variable',key='a_xmult',vars={1 + self.ability.extra*G.GAME.foods_eaten}},
Xmult_mod = 1 + self.ability.extra*G.GAME.foods_eaten,
colour = G.C.MULT
}
end
if self.ability.name == 'Edition Eater' and self.ability.extra.Xmult > 1 then
return {
message = localize{type='variable',key='a_xmult',vars={self.ability.extra.Xmult}},
Xmult_mod = self.ability.extra.Xmult,
colour = G.C.MULT
}
end
if self.ability.name == 'The Collector' and self.ability.edition_tally > 0 then
return {
message = localize{type='variable',key='a_xmult',vars={1 + self.ability.extra*self.ability.edition_tally}},
Xmult_mod = 1 + self.ability.extra*self.ability.edition_tally,
colour = G.C.MULT
}