-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumBalatro.lua
More file actions
1681 lines (1663 loc) · 56.9 KB
/
Copy pathNumBalatro.lua
File metadata and controls
1681 lines (1663 loc) · 56.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
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: NumBalatro
--- MOD_ID: NumBalatro
--- MOD_AUTHOR: [Numbuh214]
--- PREFIX: numbuh
--- MOD_DESCRIPTION: Game balance tweaks that I've either thought of, or have seen and been inspired by. (Credits for the latter will be added as they come.)
--- PRIORITY: 214
----------------------------------------------
------------MOD CODE -------------------------
local NumBalatro = SMODS.current_mod
suit_bias = {
odds = 2,
name = "Suit Bias: #1#",
text = {
"{C:green}#2# in #3#{} chance",
"to change suit conversion",
"{C:purple}Tarot{} cards to {V:1}#4#{}",
--"{C:inactive}{S:0.75}(Changes #5# cards to {V:1}{S:0.75}#1#{C:inactive}{S:0.75})"
}
}
local bd = {set = "Back", name = "Black Deck", key = "b_black"}
black_deck_text = {
name = "Black Deck",
text =
{
"{C:attention}+#1#{} Joker slot",
"Start run with the",
"{C:attention,T:v_hieroglyph}Hieroglyph{} voucher",
" ",
"{S:0.75}{C:inactive}Idea by {C:attention}u/Winderkorffin{C:inactive} and {C:attention}u/Purasangre{}"
}
}
bd.config ={
voucher = 'v_hieroglyph',
hands = 0,
joker_slot = 1
}
bd.loc_def = function(self)
return {
self.joker_slot,
"Hieroglyph"
}
end
local ritual = {name="Current Stats",text={"{C:chips}+#1#{} Chips","{C:mult}+#2#{} Mult"}}
bd.process_loc_text = function()
SMODS.process_loc_text(G.localization.descriptions.Other, 'suit_bias', {name = suit_bias.name, text = suit_bias.text})
SMODS.process_loc_text(G.localization.descriptions.Other, 'ritual', ritual)
SMODS.process_loc_text(G.localization.descriptions.Back, 'b_black', black_deck_text)
end
SMODS.Back:take_ownership("b_black",bd):register()
newJokers =
{
{
key = "onearmed_bandit",
name = "One-Armed Bandit",
rarity = 2,
cost = 7,
config = {
odds_retrigger = 10
},
loc_text = {
text = {
"{C:attention}Lucky{} Cards {C:red}cost {C:money}$1{} when",
"played, but gain a {C:green}#1# in #2#{}",
"chance to retrigger once",
"Odds of both payouts",
"are also {C:attention}increased{}"
}
},
loc_vars = {
"odds_retrigger"
},
enhancement_gate = 'm_lucky',
calculate = function(self, card, context)
--if self then
--for k,v in pairs(self) do
--sendDebugMessage(k..": "..tostring(v))
--end
--end
if (context.repetition and context.cardarea == G.play and context.other_card.config.center_key == "m_lucky") then
card_eval_status_text(card, 'extra', nil, nil, nil, {message = "Bonus Spin!"})
return {
message = localize('k_again_ex'),
repetitions = 1,
card = card
}
end
if context.before then
--takes money from every lucky card played
for i = 1, #context.scoring_hand do
if context.scoring_hand[i].config.center_key == "m_lucky" and not context.scoring_hand[i].debuff then
G.E_MANAGER:add_event(Event({func = function() context.scoring_hand[i]:juice_up(); return true end }))
ease_dollars(-1)
delay(0.23)
end
end
end
if context.individual and context.cardarea == G.play then
end
return nil
end
},
{
key = "punchclock",
name = "Punch Clock",
rarity = 2,
cost = 5,
config = {
chips = 40,
mult = 15
},
loc_text = {
text = {
"Each played {C:attention}9{} or {C:attention}5{} gives",
"{C:chips}+#2#{} Chips when scored"
}
},
loc_vars = {
"mult",
"chips"
},
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and (context.other_card.base.value == "5" or context.other_card.base.value == "9") then
return {
chips = 40
}
end
end
},
{
key = "magicnumber",
name = "Magic Number",
rarity = 1,
cost = 3,
config = {
per_chips = 30,
per_mult = 6,
per_x_mult = 1.2
},
loc_text = {
text = {
"Each played {C:attention}3{} gives",
"{C:chips}+#1#{} Chips, {C:mult}+#2#{} Mult,",
"or {X:mult,C:white}X#3#{} Mult when scored"
}
},
loc_vars = {
"per_chips",
"per_mult",
"per_x_mult"
},
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if context.other_card.base.value ~= "3" then
return nil
end
local rand = math.floor(3*pseudorandom('magic_number'))
return {
chips = rand == 0 and newJokers[3].config.per_chips or nil,
mult = rand == 1 and newJokers[3].config.per_mult or nil,
x_mult = rand == 2 and newJokers[3].config.per_x_mult or nil,
card = context.other_card
}
end
end
},
{
key = "brickbybrick",
name = "Brick By Brick",
rarity = 1,
cost = 5,
config = {
},
loc_text = {
name = "Brick by Brick",
text = {
"{C:attention,T:m_stone}Stone{} cards count",
"as their own unique {C:attention}rank{}",
}
},
enhancement_gate = 'm_stone',
loc_vars = {
},
},
{
key = "brothers_hamm",
name = "Brothers Hamm",
rarity = 1,
cost = 5,
config = {
h_size = 0
},
loc_text = {
text = {
"Gain {C:attention}+1{} hand size (up to {C:attention}+3{}) if",
"played hand contains a {C:attention}Full House{}",
"{C:red}Resets{} if other hand type is played",
"{C:inactive}(currently {C:attention}+#1#{C:inactive} hand size){}",
}
},
loc_vars = {
"h_size"
},
calculate = function(self,card,context)
if context.joker_main and context.cardarea == G.jokers and context.poker_hands then
if next(context.poker_hands["Full House"]) then
if card.ability.h_size < 3 then
G.hand:change_size(1)
card.ability.h_size = card.ability.h_size + 1
card_eval_status_text(card, 'extra', nil, nil, nil, {message = card.ability.h_size.."/3", colour = G.C.GREEN})
return nil
end
elseif card.ability.h_size > 0 then
G.hand:change_size(-card.ability.h_size)
card.ability.h_size = 0
card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize("k_reset"), colour = G.C.RED})
end
end
if context.selling_card and context.card == card then
G.hand:change_size(-card.ability.h_size)
end
end
},
{
key = "climbers",
name = "The Climbers",
rarity = 1,
cost = 5,
config = {
},
loc_text = {
text = {
"If played hand contains",
"hand of higher level,",
"{C:attention}upgrade{} played hand"
}
},
loc_vars = {
},
calculate = function(self,card,context)
if context.before and not card.debuff then
local base = nil
for k, v in pairs(G.handlist) do
if next(context.poker_hands[v]) then
if base == nil then
base = v
else
if (G.GAME.hands[v].level > G.GAME.hands[base].level) then
local thing = context.blueprint_card or card
card_eval_status_text(thing, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')})
return
{
card = thing,
level_up = true,
message = localize('k_level_up_ex')
}
end
--sendDebugMessage(v)
--sendDebugMessage(" Level "..G.GAME.hands[v].level)
end
end
end
end
end
},
{
key = "lucky_rabbit",
name = "Lucky The Rabbit",
rarity = 1,
cost = 7,
config = {
mult = 0
},
loc_text = {
text = {
"All scored {C:attention}7{} cards",
"become {C:attention}Lucky{}",
"Gain {C:mult}+7{} Mult for every",
"{C:attention}Lucky{} card held in hand"
}
},
loc_vars = {
},
calculate = function(self,card,context)
if context.before then
local sevens = {}
for i = 1, #context.scoring_hand do
v = context.scoring_hand[i]
if v.base.value == "7" and not v.debuff and v.config.center_key ~= "m_lucky" then
table.insert(sevens, i)
end
end
if #sevens == 0 or type(sevens[1]) ~= "number" then return nil end
G.E_MANAGER:add_event(Event({
trigger = "before",
delay = 0.7,
blocking = true,
func = function()
delay(0.4)
for k, v in pairs(sevens) do
context.scoring_hand[v]:set_ability(G.P_CENTERS.m_lucky, nil)
context.scoring_hand[v]:juice_up()
end
play_sound('generic1')
if card.ability.name == newJokers[7].name then
card:juice_up()
end
return true
end
}))
-- return {
-- message = "Lucky!",
-- colour = G.C.MONEY,
-- card = card
-- }
end
if context.individual and context.cardarea == G.hand and context.other_card and context.other_card.config.center_key == "m_lucky" then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = card,
}
else
return {
h_mult = 7,
card = card
}
end
end
end
},
}
override =
{
"square",
"seance",
"superposition",
"sly",
"jolly",
"duo",
"wily",
"zany",
"trio",
"clever",
"mad",
"runner",
"matador",
"to_the_moon",
"ceremonial",
"red_card",
}
oldJokers = {
square = {
name = "Square Joker",
set = "Joker",
rarity = 3,
cost = 9,
config = {
chips = 0,
chip_mod = 1
},
loc_text = {
text = {
"If played hand has exactly",
"{C:attention}4{} cards, this Joker gains",
"{C:chips}+#2#{} Chips, and this effect's value",
"is permanently increased by {C:attention}2{}",
"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chip#3#)"
}
},
loc_vars = function(self, info_queue, card)
local singular = self.chips or card.ability.chips
return
{
singular,
self.chip_mod,
(singular == 1) and "" or "s"
}
end,
calculate = function(self, card, context)
if context.before and #context.full_hand == 4 and not context.blueprint then
card.ability.chips = card.ability.chips + card.ability.chip_mod
card.ability.chip_mod = card.ability.chip_mod + 2
return {
message = localize('k_upgrade_ex'),
colour = G.C.CHIPS,
card = card
}
end
if context.joker_main and context.cardarea == G.jokers then
return {
message = localize{type='variable',key='a_chips',vars={card.ability.chips}},
colour = G.C.CHIPS,
chip_mod = card.ability.chips,
card = card
}
end
end,
atlas = true
},
seance = {
name = "Seance",
rarity = 2,
cost = 6,
config = {
x_mult = 0.5,
current = 1,
},
loc_text = {
name = "Séance",
text = {
"Gains {X:mult,C:white}X#1#{} Mult per {C:spectral}Spectral{}",
"card used this run",
"{C:inactive}(currently {X:mult,C:white}X#2#{C:inactive} Mult){}",
}
},
loc_vars = {
"x_mult",
"current"
},
atlas = false
},
superposition = {
name = "Superposition",
rarity = 2,
cost = 6,
config = {
},
loc_text = {
text = {
"{C:attention}Straights{} can loop {C:inactive}(ex: K, Q, A, 2, 3){}",
"and hands containing a {C:attention}Straight{}",
"create a random consumable",
"{C:inactive}(Must have room)"
}
},
loc_vars = {
"x_mult",
"current",
"poker_hand"
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers and next(context.poker_hands["Straight"]) and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
local card_types = {'Tarot','Planet','Spectral'}
local rand = pseudorandom('j_superposition') * 100
local idx = 1
if rand < 55 then
idx = 2
end
if rand < 10 then
idx = 3
end
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(card_types[idx],G.consumeables, nil, nil, nil, nil, nil, 'sup')
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0
return true
end)}))
return {
message = localize('k_plus_'..string.lower(card_types[idx])),
colour = G.C.SECONDARY_SET[card_types[idx]],
card = card
}
end
end,
atlas = false
},
sly = {
name = "Sly Joker",
config = {
type = "Pair",
t_chips = 22
},
loc_text = {
text = {
"{C:chips}+#2#{} Chips for each",
"unique {C:attention}#1#{} or better",
"in played hand"
}
},
loc_vars = {
"type",
"t_chips"
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return pair_joker_calc(card, context, 'chips', false)
end
end,
atlas = true
},
jolly = {
name = "Jolly Joker",
config = {
type = "Pair",
t_mult = 6
},
loc_text = {
text = {
"{C:mult}+#2#{} Mult for each",
"unique {C:attention}#1#{} or better",
"in played hand"
}
},
loc_vars = {
"type",
"t_mult"
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return pair_joker_calc(card, context, 'mult', false)
end
end,
atlas = true
},
duo = {
name = "The Duo",
config = {
x_mult = 2
},
loc_text = {
text = {
"{X:mult,C:white}x#1#{} Mult if",
"played hand has",
"exactly {C:attention}2{} cards",
"of a single rank"
}
},
loc_vars = {
"x_mult"
},
calculate = function(self,card,context)
if context.joker_main and context.cardarea == G.jokers and next(get_X_same(card.ability.x_mult, context.scoring_hand)) and #get_X_same(card.ability.x_mult, context.scoring_hand)[1] == card.ability.x_mult then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.x_mult}},
colour = G.C.MULT,
Xmult_mod = card.ability.x_mult or nil,
card = card
}
end
end,
atlas = true
},
wily = {
name = "Wily Joker",
config = {
type = "Three of a Kind",
t_chips = 33,
},
loc_text = {
text = {
"{C:chips}+#2#{} Chips if hand",
"contains {C:attention}#1#{}",
"{C:chips}+#3#{} Chips if hand contains",
"exactly {C:attention}3{} scoring cards",
}
},
loc_vars = {
"type",
"t_chips",
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return oak_joker_calc(card, context, 3, 'chips', false)
end
end,
atlas = true
},
zany = {
name = "Zany Joker",
config = {
type = "Three of a Kind",
t_mult = 6,
},
loc_text = {
text = {
"{C:mult}+#2#{} Mult if hand",
"contains {C:attention}#1#{}",
"{C:mult}+#3#{} Mult if hand contains",
"exactly {C:attention}3{} scoring cards",
}
},
loc_vars = {
"type",
"t_mult",
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return oak_joker_calc(card, context, 3, 'mult', false)
end
end,
atlas = true
},
trio = {
name = "The Trio",
config = {
x_mult = 3
},
loc_text = {
text = {
"{X:mult,C:white}x#1#{} Mult if",
"played hand has",
"exactly {C:attention}3{} cards",
"of a single rank"
}
},
loc_vars = {
"x_mult"
},
calculate = function(self,card,context)
if context.joker_main and context.cardarea == G.jokers and next(get_X_same(card.ability.x_mult, context.scoring_hand)) and #get_X_same(card.ability.x_mult, context.scoring_hand)[1] == card.ability.x_mult then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.x_mult}},
colour = G.C.MULT,
Xmult_mod = card.ability.x_mult or nil,
card = card
}
end
end,
atlas = false
},
clever = {
name = "Clever Joker",
config = {
type = "Four of a Kind",
t_chips = 44,
},
loc_text = {
text = {
"{C:chips}+#2#{} Chips if hand",
"contains {C:attention}#1#{}",
"{C:chips}+#3#{} Chips if hand",
"has exactly {C:attention}4{} scoring cards"
}
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return oak_joker_calc(card, context, 4, 'chips', false)
end
end,
loc_vars = {
"type",
"t_chips",
},
atlas = true
},
mad = {
name = "Mad Joker",
config = {
type = "Four of a Kind",
t_mult = 8,
},
loc_text = {
text = {
"{C:mult}+#2#{} Mult if hand",
"contains {C:attention}#1#{}",
"{C:mult}+#3#{} Mult if hand",
"has exactly {C:attention}4{} scoring cards"
}
},
calculate = function(self, card, context)
if context.joker_main and context.cardarea == G.jokers then
return oak_joker_calc(card, context, 4, 'mult', false)
end
end,
loc_vars = {
"type",
"t_mult",
},
atlas = true
},
runner = {
name = "Runner",
config = {
chips = 0,
chip_mod = 1,
},
loc_text = {
text = {
"If played hand contains a",
"{C:attention}Straight{}, this Joker gains",
"{C:chips}+#2#{} Chips, and this effect's value",
"is permanently increased by {C:attention}1{}",
"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chip#3#)"
}
},
loc_vars = function(self, info_queue, card)
return {
self.chips,
self.chip_mod,
self.chips == 1 and "" or "s"
}
end,
calculate = function(self, card, context)
if context.before and next(context.poker_hands["Straight"]) and not context.blueprint then
card.ability.chips = card.ability.chips + card.ability.chip_mod
card.ability.chip_mod = card.ability.chip_mod + 1
return {
message = localize('k_upgrade_ex'),
colour = G.C.CHIPS,
card = card
}
end
if context.joker_main and context.cardarea == G.jokers then
return {
message = localize{type='variable',key='a_chips',vars={card.ability.chips}},
colour = G.C.CHIPS,
chip_mod = self.chips,
card = card
}
end
end,
atlas = false
},
crazy = {
name = "Crazy Joker",
config = {
t_mult = 20,
type = "Straight"
},
loc_text = {
text = {
"{C:mult}+#2#{} Mult if hand",
"contains a {C:attention}#1#{}"
}
},
loc_vars = {
"type",
"t_mult",
},
atlas = false
},
devious = {
name = "Devious Joker",
config = {
t_chips = 123,
type = "Straight"
},
loc_text = {
text = {
"{C:chips}+#2#{} Chips if hand",
"contains a {C:attention}#1#{}"
}
},
loc_vars = {
"type",
"t_chips",
},
atlas = false
},
matador = {
name = "Matador",
config = {
big_payout = 5,
small_payout = 3
},
loc_text = {
text = {
"Earn {C:money}$#2#{} per card affected by",
"a {C:attention}Boss Blind{},",
"and {C:money}$#1#{} when any other",
"{C:attention}Boss Blind{} ability is triggered",
}
},
loc_vars = {
"big_payout",
"small_payout",
},
atlas = false,
calculate = function(self,card,context)
if context.setting_blind then
card.ability.old_size = G.hand.config.card_limit
card.ability.old_hand = G.GAME.current_round.discards_left
card.ability.old_discard = G.GAME.current_round.discards_left
end
if context.first_hand_drawn then
if G.GAME.blind.triggered == true or card.facing == "back" or G.GAME.blind.mult > 2 or card.ability.old_size > G.hand.config.card_limit then
payout_big(card)
end
if card.ability.old_hand > G.GAME.current_round.hands_left then
for i = 1, card.ability.old_hand do
payout_big(card, 0.4)
end
end
if card.ability.old_discard > G.GAME.current_round.discards_left then
for i = 1, card.ability.old_discard+1 do
payout_big(card, 0.4)
end
end
end
if context.debuffed_hand then
payout_big(card)
end
if context.before then
local postage = true
for k, v in pairs(G.jokers.cards) do
if v.ability.crimson_heart_chosen then
payout_big(card)
break
end
end
for k, v in pairs(context.full_hand) do
--sendDebugMessage(v.base.name)
--sendDebugMessage("Is this flipped?")
--sendDebugMessage(v.flipped_by_blind == true and "Yes" or "No")
if v.flipped_by_blind == true then
payout_small(card, 0.4, v)
G.GAME.blind.triggered = false
end
end
sendDebugMessage("("..G.GAME.blind.old_level.." > "..G.GAME.hands[context.scoring_name].level..") ?")
if G.GAME.blind.old_level > G.GAME.hands[context.scoring_name].level then
payout_big(card)
end
end
end
},
to_the_moon = {
name = "To the Moon",
config = {
extra = 0,
stonks = 0,
increase = 0.01,
triggers = 0,
x_mult = 1,
},
loc_text = {
text = {
"Gains an additional {X:mult,C:white}X#1#{} mult",
"whenever money is gained",
"{C:inactive}(Currently {X:mult,C:white}X#2#{} mult)"
}
},
loc_vars = {
"increase",
"x_mult"
},
calculate = function(self, card, context)
if context.joker_main and card.ability.x_mult+card.ability.triggers > 1 then
sendDebugMessage(card.ability.triggers.." triggers.")
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.x_mult+card.ability.triggers}},
colour = G.C.MULT,
Xmult_mod = card.ability.x_mult+card.ability.triggers,
card = card
}
end
if G.GAME.dollar_buffer then
if G.GAME.dollar_buffer > (self.stonks and self.stonks or 0) then
self.triggers = (self.triggers or 0) + card.ability.increase
self.stonks = G.GAME.dollar_buffer
sendDebugMessage("Trigger # "..self.triggers)
end
if G.GAME.dollar_buffer == 0 and (self.stonks and (self.stonks > 0)) then
sendDebugMessage("Resetting buffer")
self.triggers = 0
self.stonks = 0
end
elseif (self.stonks and (self.stonks > 0)) then
sendDebugMessage("Resetting buffer")
self.triggers = 0
self.stonks = 0
end
end,
atlas = false
},
ceremonial = {
name = "Ceremonial Dagger",
config = {
bonus = 0,
mult = 0,
extra_value = 0
},
loc_text = {
text = {
"When {C:attention}Blind{} is selected,",
"destroy Joker to the right and",
"gain {C:chips}Chips{}, {C:mult}Mult{}, and {C:money}sell{} value",
"equal to half its listed value(s)",
"{C:inactive}(Does not absorb {X:mult,C:white}XMult{}{C:inactive}){}"
}
},
loc_vars = {
},
calculate = function(self,card,context)
if context.setting_blind and not context.blueprint then
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then my_pos = i; break end
end
if my_pos and G.jokers.cards[my_pos+1] and not card.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced then
local sliced_card = G.jokers.cards[my_pos+1]
local soul = {
chips = sliced_card.ability.chips or 0,
mult = sliced_card.ability.mult or sliced_card.ability.t_mult or sliced_card.ability.s_mult or 0,
extra_value = sliced_card.sell_cost or 0
}
if sliced_card.ability.name == "Onyx Agate" then
soul.mult = sliced_card.ability.extra
end
if sliced_card.ability.name == "Banner" then
soul.chips = G.GAME.current_round.discards_left*sliced_card.ability.extra
end
if soul.chips == 0 then
soul.chips = sliced_card.ability.t_chips
sendDebugMessage(type(sliced_card.ability.extra))
if sliced_card.ability.extra and type(sliced_card.ability.extra) == "table" then
if sliced_card.ability.extra.chip_mod and sliced_card.ability.extra.chip_mod > 0 then
soul.chips = sliced_card.ability.extra.chip_mod
elseif sliced_card.ability.extra.chips and sliced_card.ability.extra.chips > 0 then
soul.chips = sliced_card.ability.extra.chips
end
end
end
if sliced_card.ability.effect == "Joker Mult" then
soul.mult = #G.jokers.cards*sliced_card.ability.extra
end
if sliced_card.ability.name == "Fortune Teller" then
soul.mult = G.GAME.consumeable_usage_total.tarot*sliced_card.ability.extra
end
if soul.mult == 0 then
soul.mult = sliced_card.ability.t_mult== 0 and sliced_card.ability.s_mult or sliced_card.ability.t_mult
if sliced_card.ability.extra and type(sliced_card.ability.extra) == "table" and sliced_card.ability.extra.mult and sliced_card.ability.extra.mult > 0 then
soul.mult = sliced_card.ability.extra.mult
end
end
for k, v in pairs(soul) do
sendDebugMessage(k..": "..tostring(card.ability[k]))
card.ability[k] = (card.ability[k] or 0) + math.ceil(0.5*v)
sendDebugMessage("Increased to "..tostring(card.ability[k]))
end
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({trigger = "before", delay = 1.4, func = function()
G.GAME.joker_buffer = 0
card:juice_up(0.8, 0.8)
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
play_sound('slice1', 0.96+math.random()*0.08)
return true end
}))
sendDebugMessage(sliced_card.ability.name.." sliced.")
sendDebugMessage("Chips: "..soul.chips)
sendDebugMessage("Mult: "..soul.mult)
sendDebugMessage("Sell Value: "..soul.extra_value)
if soul.chips > 0 then
card_eval_status_text(card, 'chips', math.ceil(0.5*(soul.chips)), nil, nil, {no_juice = true})
if soul.mult > 0 or soul.extra_value > 0 then
delay(0.4)
end
end
if soul.mult > 0 then
card_eval_status_text(card, 'mult',math.ceil(0.5*(soul.mult)), nil, nil, {no_juice = true})
if soul.extra_value > 0 then
delay(0.4)
end
end
card_eval_status_text(card, 'dollars', math.ceil(0.5*(soul.extra_value)), nil, nil, {no_juice = true})
end
end
if context.joker_main and context.cardarea == G.jokers then
if card.ability.mult == 0 then
return {
message = localize{type='variable',key='a_chips',vars={card.ability.chips}},
colour = G.C.CHIPS,
chip_mod = card.ability.chips,
card = self
}
end
if card.ability.chips and card.ability.chips > 0 then
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.7,
func = function()
card_eval_status_text(card, 'chips', card.ability.chips, nil, nil, {instant=true})
G.GAME.current_round.current_hand['chips'] = G.GAME.current_round.current_hand['chips'] + card.ability['chips']
G.GAME.current_round.current_hand["chip_text"] = G.GAME.current_round.current_hand['chip_text'] + card.ability['chips']
G.hand_text_area['chips']:update(0)
G.hand_text_area['chips']:juice_up()
return true
end
}))
end
return
{
message = localize{type='variable',key='a_mult',vars={card.ability.mult}},
colour = G.C.MULT,
chip_mod = card.ability.chips,
mult_mod = card.ability.mult,
card = self
}
end
end,