-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpotassium.lua
More file actions
2228 lines (2155 loc) · 84.6 KB
/
potassium.lua
File metadata and controls
2228 lines (2155 loc) · 84.6 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
G.C.BANAN1 = HEX('f5d953')
G.C.BANAN2 = HEX('9be344')
G.C.MULT = darken(G.C.BANAN1, 0.1)
G.C.CHIPS = darken(G.C.BANAN2, 0.2)
G.C.RED = darken(G.C.BANAN1, 0.1)
G.C.BLUE = darken(G.C.BANAN2, 0.2)
G.C.BLIND.Small = darken(G.C.BANAN1, 0.1)
G.C.BLIND.won = darken(G.C.BANAN2, 0.2)
G.trollRate = 100
SMODS.config.no_mod_badges = true
SMODS.current_mod.optional_features = {
post_trigger = true
}
if not to_big then
function to_big(x) return x end
end
if not is_number then
function is_number(x) return type(x) == 'number' end
end
-- ===Texture replacement and new Atlases===
SMODS.Atlas{
key = "centers",
path = "Enhancers.png",
px = 71,
py = 95,
raw_key = true
}
SMODS.Atlas{
key = "Joker",
path = "Jokers.png",
px = 71,
py = 95,
raw_key = true
}
SMODS.Atlas{
key = "banana",
path = "Bananokers.png",
px = 71,
py = 95,
}
SMODS.Atlas{
key = "hologram",
path = "Hologram.png",
px = 95,
py = 95,
}
SMODS.Atlas{
key = "sticker",
path = "sticker.png",
px = 71,
py = 95,
}
SMODS.Atlas{
key = "balatro",
path = "title.png",
px = 333,
py = 216,
raw_key = true
}
SMODS.Atlas{
key = "blinds",
atlas_table = "ANIMATION_ATLAS",
path = "blinds.png",
px = 34,
py = 34,
frames = 21,
}
SMODS.Atlas{
key = "tag",
path = "tag.png",
px = 34,
py = 34,
}
-- ==New Sounds==
SMODS.Sound({
key = "glopedition",
path = "GlopEdition.wav"
})
SMODS.Sound({
key = "glop",
path = "Glop.wav"
})
-- ===Add updates to existing Jokers===
SMODS.Joker:take_ownership('j_oops', {
name = "Oops! All Bananas",
add_to_deck = function(self, card, from_debuff)
G.GAME.probabilities.normal = 10^309
end,
remove_from_deck = function(self, card, from_debuff)
if not next(SMODS.find_card('j_oops')) then
G.GAME.probabilities.normal = 1
end
end
})
SMODS.Joker:take_ownership('j_matador', {
name = "Banatador",
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.extra}
}
end,
calculate = function(self, card, context)
-- add context.joker_main if this is too OP
if G.GAME.blind and G.GAME.blind.boss and context.cardarea == G.jokers and not context.destroy_card and not context.destroying_card then
return {
dollars = card.ability.extra
}
end
end
})
SMODS.Enhancement:take_ownership('m_stone', {
--[[loc_txt = {
name = "Gros Michel",
text = {
"{C:mult}+#1#{} Mult",
"{C:green}#2# in #3#{} to",
"destroy card"
}
},]]
config = {
extra = {
mult = 15,
chance = 6,
}
},
replace_base_card = true,
no_edeck = true,
loc_vars = function(self, info_queue, card)
return { vars = {
card.ability.extra.mult or self.config.extra.mult,
G.GAME and G.GAME.probabilities.normal or 1,
card.ability.extra.chance or self.config.extra.chance,
}}
end,
calculate = function(self, card, context)
if context.cardarea == G.play and context.main_scoring then
return {
mult = card.ability.extra.mult
}
end
if context.cardarea == G.play and context.destroying_card and context.destroy_card == card then
if pseudorandom('stone_gros_michel') < G.GAME.probabilities.normal/card.ability.extra.chance then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.play:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
SMODS.calculate_context({extinct = true, other_card = card})
return {
message = localize('k_extinct_ex'),
remove = true
}
else
card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize('k_safe_ex')})
end
end
end
})
SMODS.Joker:take_ownership('j_marble', {
--[[loc_txt = {
name = "Banana Farm",
text = {
"Adds one {C:attention}Gros Michel{}",
"to deck when",
"{C:attention}Blind{} is selected",
}
},]]
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = G.P_CENTERS.m_stone
end,
})
SMODS.Joker:take_ownership('j_stone', {
--[[loc_txt = {
name = "Banana-Flavored Banana",
text = {
"Gives {C:chips}+#1#{} Chips for",
"each {C:attention}Gros Michel",
"in your {C:attention}full deck",
"{C:inactive}(Currently {C:chips}+#2#{C:inactive} Chips)",
}
},]]
--[[loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = G.P_CENTERS.m_stone
end,--]]
})
SMODS.Stake:take_ownership('stake_blue', {
modifiers = function()
G.GAME.starting_params.discards = 0
G.GAME.modifiers.no_discards = true
end,
loc_txt = {
name="Blue Stake",
text={
"{C:red}Removes{} Discards",
},
}
})
SMODS.Joker:take_ownership('j_hologram', {
display_size = { w = 95, h = 95 },
atlas = "hologram",
pos = { x = 0, y = 10 },
soul_pos = { x = 0, y = 0 },
})
-- animate hologram sprite
-- code adapted from Cryptid's jimball
banana_hologram_dt = 0
local _game_update = Game.update
function Game:update(dt)
_game_update(self, dt)
banana_hologram_dt = banana_hologram_dt + dt -- cryptid has a check here but im not sure what it's for
if G.P_CENTERS and G.P_CENTERS.j_hologram and banana_hologram_dt > 0.05 then
banana_hologram_dt = banana_hologram_dt - 0.05
local hologramobj = G.P_CENTERS.j_hologram
if hologramobj.soul_pos.x == 11 and hologramobj.soul_pos.y == 9 then
hologramobj.soul_pos.x = 0
hologramobj.soul_pos.y = 0
elseif hologramobj.soul_pos.x < 11 then
hologramobj.soul_pos.x = hologramobj.soul_pos.x + 1
elseif hologramobj.soul_pos.y < 9 then
hologramobj.soul_pos.x = 0
hologramobj.soul_pos.y = hologramobj.soul_pos.y + 1
end
-- oh my god i hate this so much but ARGH
-- note that this can't use find_card because it also needs to work in the collection
-- unless there's some other way you can do it
for _, card in pairs(G.I.CARD) do
if card and card.config.center == hologramobj then
card.children.floating_sprite:set_sprite_pos(hologramobj.soul_pos)
end
end
end
if not G.GAME.probabilities.normal and SMODS.find_card("j_oops") then
G.GAME.probabilities.normal = 10^1000
end
--scoring gratification logic
if G.STATE == G.STATES.HAND_PLAYED then
if is_number(G.GAME.current_round.current_hand.chips) and is_number(G.GAME.current_round.current_hand.mult) and is_number(G.GAME.current_round.current_hand.glop) then
local val = G.GAME.current_round.current_hand.chips * G.GAME.current_round.current_hand.mult * G.GAME.current_round.current_hand.glop
if to_big(val) > to_big(G.ARGS.score_intensity.required_score) then
local scaler = math.min(1000,math.log10(val/G.ARGS.score_intensity.required_score))
if math.random() < scaler * dt * 1.5 then
local glop_scaler = 1/(1+math.exp(-2*(math.log10(G.GAME.current_round.current_hand.glop)-1)))
local text = pseudorandom_element(G.localization.misc.banana_quips, pseudoseed("🍌"))
local color = G.C["BANAN"..tostring(math.random(2))]
if math.random() < glop_scaler then
text = pseudorandom_element(G.localization.misc.glop_quips, pseudoseed("🟩"))
color = G.C.GLOP
end
attention_text({
text = text,
offset = {
x = math.random() * (G.TILE_W - 1) - G.TILE_W / 2,
y = math.random() * (G.TILE_H - 1) - G.TILE_H / 2,
},
major = G.play,
colour = color,
hold = (math.random() * 3 + 2 + scaler/10)*G.SETTINGS.GAMESPEED,
text_rot = math.random() * math.pi * 1 - math.pi * 0.5,
emboss = 0.05
})
end
end
end
end
end
-- ===Banana Content===
SMODS.Back{
key = "banana",
prefix_config = {
atlas = false
},
atlas = 'Joker',
pos = {x = 7, y = 6},
apply = function(self, back)
G.GAME.starting_params.banana = true
end
}
if not (SMODS.Mods["Cryptid"] or {}).can_load then
function Card:calculate_banana()
if not self.ability.extinct then
if self.ability.banana and (pseudorandom("banana") < G.GAME.probabilities.normal / 10) then
self.ability.extinct = true
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()
if self.area then
self.area:remove_card(self)
end
self:remove()
self = nil
return true
end,
}))
return true
end,
}))
if self.ability.name == "Gros Michel" then
G.GAME.pool_flags.gros_michel_extinct = true
end
if self.ability.name == "Cavendish" then
G.GAME.pool_flags.cavendish_extinct = true
end
SMODS.calculate_context({extinct = true, other_card = self})
return {
message = localize("k_extinct_ex")
}
elseif self.ability.banana then
return {
message = localize("k_safe_ex")
}
end
end
end
function Card:set_banana(_banana)
self.ability.banana = _banana
end
local se = Card.set_eternal
function Card:set_eternal(_eternal)
if not self.ability.banana then
se(self, _eternal)
end
end
SMODS.Sticker({
badge_colour = HEX("e8c500"),
prefix_config = { key = false },
key = "banana",
atlas = "sticker",
pos = { x = 0, y = 0 },
needs_enable_flag = true,
--Either SMODS doesn't do this or I am silly
should_apply = function(self, card, center, area, bypass_roll)
return (area == G.pack_cards or area == G.shop_jokers) and card.ability.set == "Joker" and pseudorandom(pseudoseed("stickernana"..G.GAME.round_resets.ante)) < 0.3 and G.GAME.modifiers.enable_banana
end,
loc_vars = function(self, info_queue, card)
local key
if card.ability.set ~= "Joker" then
key = "banana_playing_card"
end
return { key = key, vars = { G.GAME.probabilities.normal or 1, 10 } }
end,
calculate = function(self, card, context)
if
context.end_of_round
and not context.repetition
and not context.playing_card_end_of_round
and not context.individual
then
if card.ability.set == "Joker" then
return card:calculate_banana()
end
end
if context.cardarea == G.play and context.destroying_card and context.destroy_card == card then
if pseudorandom('banana_playing_card') < G.GAME.probabilities.normal/10 then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.play:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
SMODS.calculate_context({extinct = true, other_card = card})
return {
message = localize('k_extinct_ex'),
remove = true
}
else
return {
message = localize('k_safe_ex'),
}
end
end
end,
})
SMODS.Stake({
key = "banana",
pos = { x = 3, y = 1 },
sticker_atlas = "sticker",
sticker_pos = {x = 0, y = 0},
applied_stakes = { "stake_gold" },
prefix_config = false,
modifiers = function()
G.GAME.modifiers.enable_banana = true
end,
colour = HEX("e8c500"),
})
--yoink floating_sprite2 for glopway
SMODS.DrawStep({
key = "floating_sprite2",
order = 59,
func = function(self)
if self.ability.name == "cry-Gateway" and (self.config.center.discovered or self.bypass_discovery_center) then
local scale_mod2 = 0.07 -- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
local rotate_mod2 = 0 --0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
self.children.floating_sprite2:draw_shader(
"dissolve",
0,
nil,
nil,
self.children.center,
scale_mod2,
rotate_mod2,
nil,
0.1 --[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],
nil,
0.6
)
self.children.floating_sprite2:draw_shader(
"dissolve",
nil,
nil,
nil,
self.children.center,
scale_mod2,
rotate_mod2
)
local scale_mod = 0.05
+ 0.05 * math.sin(1.8 * G.TIMERS.REAL)
+ 0.07
* math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL)) * math.pi * 14)
* (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 3
local rotate_mod = 0.1 * math.sin(1.219 * G.TIMERS.REAL)
+ 0.07
* math.sin(G.TIMERS.REAL * math.pi * 5)
* (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 2
self.children.floating_sprite.role.draw_major = self
self.children.floating_sprite:draw_shader(
"dissolve",
0,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod,
nil,
0.1 + 0.03 * math.sin(1.8 * G.TIMERS.REAL),
nil,
0.6
)
self.children.floating_sprite:draw_shader(
"dissolve",
nil,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod
)
end
if
self.config.center.soul_pos
and self.config.center.soul_pos.extra
and (self.config.center.discovered or self.bypass_discovery_center)
then
local scale_mod = 0.07 -- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
local rotate_mod = 0 --0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
self.children.floating_sprite2:draw_shader(
"dissolve",
0,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod,
nil,
0.1 --[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],
nil,
0.6
)
self.children.floating_sprite2:draw_shader(
"dissolve",
nil,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod
)
end
end,
conditions = { vortex = false, facing = "front" },
})
SMODS.draw_ignore_keys.floating_sprite2 = true
local set_spritesref = Card.set_sprites
function Card:set_sprites(_center, _front)
set_spritesref(self, _center, _front)
if _center and _center.name == "cry-Gateway" then
self.children.floating_sprite = Sprite(
self.T.x,
self.T.y,
self.T.w,
self.T.h,
G.ASSET_ATLAS[_center.atlas or _center.set],
{ x = 2, y = 0 }
)
self.children.floating_sprite.role.draw_major = self
self.children.floating_sprite.states.hover.can = false
self.children.floating_sprite.states.click.can = false
self.children.floating_sprite2 = Sprite(
self.T.x,
self.T.y,
self.T.w,
self.T.h,
G.ASSET_ATLAS[_center.atlas or _center.set],
{ x = 1, y = 0 }
)
self.children.floating_sprite2.role.draw_major = self
self.children.floating_sprite2.states.hover.can = false
self.children.floating_sprite2.states.click.can = false
end
if _center and _center.soul_pos and _center.soul_pos.extra then
self.children.floating_sprite2 = Sprite(
self.T.x,
self.T.y,
self.T.w,
self.T.h,
G.ASSET_ATLAS[_center.atlas or _center.set],
_center.soul_pos.extra
)
self.children.floating_sprite2.role.draw_major = self
self.children.floating_sprite2.states.hover.can = false
self.children.floating_sprite2.states.click.can = false
end
end
end
BANANA_EVOLUTIONS = {
j_ice_cream = "j_banana_bananasplit",
j_selzer = "j_banana_potassium",
j_egg = "j_banana_begg",
j_turtle_bean = "j_banana_bean",
}
SMODS.Consumable{
key = "fruit",
pos = {x = 0, y = 7},
atlas = "banana",
set = "Spectral",
can_use = function(self, card)
for i = 1, #G.jokers.cards do
if not G.jokers.cards[i].ability.banana and not G.jokers.cards[i].ability.eternal then
return true
end
end
end,
use = function(self, card, area)
local eligible_jokers = {}
for i = 1, #G.jokers.cards do
if not G.jokers.cards[i].ability.banana and not G.jokers.cards[i].ability.eternal then
eligible_jokers[#eligible_jokers+1] = G.jokers.cards[i]
end
end
local joker = pseudorandom_element(eligible_jokers, pseudoseed("fruit"..G.GAME.round_resets.ante))
if joker then
play_sound('tarot1')
if BANANA_EVOLUTIONS[joker.config.center.key] then
joker:set_ability(G.P_CENTERS[BANANA_EVOLUTIONS[joker.config.center.key]])
else
joker:set_banana(true)
end
joker:juice_up(0.3, 0.4)
ease_dollars(20)
end
end,
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = {set = "Other", key = "banana", vars = {G.GAME.probabilities.normal or 1,10}}
end,
}
SMODS.Joker{
key = "plantation",
pos = { x = 1, y = 6 },
atlas = "banana",
config = { extra = { xmult = 2 } },
rarity = 3,
cost = 8,
blueprint_compat = true,
loc_vars = function(self, info_queue, center)
info_queue[#info_queue+1] = {set = "Other", key = "banana", vars = {G.GAME.probabilities.normal or 1,10}}
return { vars = { center.ability.extra.xmult } }
end,
calculate = function(self, card, context)
if context.other_joker and context.other_joker.ability.banana then
return {
xmult = card.ability.extra.xmult,
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
if i > 1 then
G.jokers.cards[i - 1]:set_banana(true)
G.jokers.cards[i - 1]:juice_up(0.3, 0.4)
end
if i < #G.jokers.cards then
G.jokers.cards[i + 1]:set_banana(true)
G.jokers.cards[i + 1]:juice_up(0.3, 0.4)
end
end
end
end
end,
}
SMODS.Joker:take_ownership('j_gros_michel', {
calculate = function(self, card, context)
if context.joker_main then
return {
message = localize{type='variable',key='a_mult',vars={card.ability.extra.mult}},
mult_mod = card.ability.extra.mult,
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('gros_michel') < G.GAME.probabilities.normal/card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
G.GAME.pool_flags.gros_michel_extinct = true
SMODS.calculate_context({extinct = true, other_card = card})
return {
message = localize('k_extinct_ex')
}
else
return {
message = localize('k_safe_ex')
}
end
end
end
})
SMODS.Joker:take_ownership('j_cavendish', {
no_pool_flag = 'cavendish_extinct',
calculate = function(self, card, context)
if context.joker_main then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.extra.Xmult}},
Xmult_mod = card.ability.extra.Xmult,
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('cavendish') < G.GAME.probabilities.normal/card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
G.GAME.pool_flags.cavendish_extinct = true
SMODS.calculate_context({extinct = true, other_card = card})
return {
message = localize('k_extinct_ex')
}
else
return {
message = localize('k_safe_ex')
}
end
end
end
})
SMODS.Joker{
key = "bluejava",
yes_pool_flag = 'cavendish_extinct',
pos = { x = 2, y = 2 },
atlas = "banana",
rarity = 1,
cost = 4,
config = { extra = { emult = 2, odds = 2^1023.99 } },
blueprint_compat = true,
loc_vars = function(self, info_queue, center)
return { vars = { center.ability.extra.emult, G.GAME.probabilities.normal, center.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
emult = card.ability.extra.emult
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('bluejava') < G.GAME.probabilities.normal/card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
return {
message = localize('k_extinct_ex')
}
else
return {
message = localize('k_safe_ex')
}
end
end
end,
}
SMODS.Joker{
key = "bananasplit",
pos = { x = 2, y = 7 },
atlas = "banana",
rarity = 1,
cost = 4,
config = { extra = { chips = 200, odds = 6 } },
blueprint_compat = true,
in_pool = function() return false end,
loc_vars = function(self, info_queue, center)
return { vars = { center.ability.extra.chips, G.GAME.probabilities.normal, center.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('split') < G.GAME.probabilities.normal/card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card:juice_up(0.3, 0.4)
card.ability.extra.chips = card.ability.extra.chips / 2
local c = SMODS.create_card({key = "j_banana_bananasplit"})
c.ability.extra.chips = card.ability.extra.chips
G.jokers:emplace(c)
return true
end
}))
return {
message = localize('k_split_ex')
}
else
return {
message = localize('k_safe_ex')
}
end
end
end,
}
SMODS.Joker{
key = "potassium",
pos = { x = 2, y = 3 },
atlas = "banana",
rarity = 2,
cost = 7,
config = { extra = { retr = 2, odds = 6 } },
blueprint_compat = true,
in_pool = function() return false end,
loc_vars = function(self, info_queue, center)
info_queue[#info_queue+1] = {set = "Other", key = "banana_playing_card", vars = {G.GAME.probabilities.normal or 1,10}}
return { vars = { center.ability.extra.retr, G.GAME.probabilities.normal, center.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if not context.other_card.ability.banana then
context.other_card:set_banana(true)
if context.other_card.ability.banana then
context.other_card:juice_up(0.3, 0.4)
end
end
return {
repetitions = card.ability.extra.retr
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('potassium') < G.GAME.probabilities.normal/card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
return {
message = localize('k_extinct_ex')
}
else
return {
message = localize('k_safe_ex')
}
end
end
end,
}
SMODS.Joker{
key = "begg",
pos = { x = 2, y = 4 },
atlas = "banana",
rarity = 1,
cost = 4,
config = { extra = { gain = 6, odds = 6 } },
blueprint_compat = true,
in_pool = function() return false end,
loc_vars = function(self, info_queue, center)
return { vars = { center.ability.extra.gain, G.GAME.probabilities.normal, center.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if pseudorandom('begg') < G.GAME.probabilities.normal/card.ability.extra.odds then
card.ability.extra_value = math.floor(math.max(1, math.floor(card.cost/2)) + card.ability.extra_value)/2 - math.max(1, math.floor(card.cost/2))
card:set_cost()
return {
message = localize('k_nope_ex'),
}
else
card.ability.extra_value = card.ability.extra_value + card.ability.extra.gain
card:set_cost()
return {
message = localize('k_val_up')
}
end
end
end,
}
SMODS.Joker{
key = "bean",
pos = { x = 2, y = 6 },
atlas = "banana",
rarity = 2,
cost = 7,
config = { extra = { h_size = 3, h_size_mod = 1, odds = 20 } },
blueprint_compat = true,
in_pool = function() return false end,
loc_vars = function(self, info_queue, center)
return { vars = { center.ability.extra.h_size, center.ability.extra.h_size_mod, G.GAME.probabilities.normal, center.ability.extra.odds } }
end,
add_to_deck = function(self, card, from_debuff)
G.hand:change_size(card.ability.extra.h_size)
end,
remove_from_deck = function(self, card, from_debuff)
G.hand:change_size(-card.ability.extra.h_size)
end,
calculate = function(self, card, context)
if context.cardarea == G.jokers and context.before then
if pseudorandom('bananabean') < G.GAME.probabilities.normal/card.ability.extra.odds then
card.ability.extinct = true
end
end
if context.destroying_card and card.ability.extinct then
return { remove = true }
end
if context.cardarea == G.jokers and context.after and card.ability.extinct and not context.blueprint then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
return {
message = localize('k_extinct_ex'),
}
end
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.h_size_mod
G.hand:change_size(card.ability.extra.h_size_mod)
return {
message = localize('k_upgrade_ex')
}
end
end,
}
SMODS.Joker{
key = "bread",
pos = { x = 1, y = 7 },
atlas = "banana",
rarity = 2,
cost = 6,
config = { extra = { xmult = 1, xmult_mod = 0.5 } },
blueprint_compat = true,
loc_vars = function(self, info_queue, center)
info_queue[#info_queue+1] = {set = "Other", key = "banana", vars = {G.GAME.probabilities.normal or 1,10}}
info_queue[#info_queue+1] = G.P_CENTERS.j_gros_michel
info_queue[#info_queue+1] = G.P_CENTERS.j_cavendish
return { vars = { center.ability.extra.xmult_mod, center.ability.extra.xmult } }
end,
calculate = function(self, card, context)
if context.joker_main and card.ability.extra.xmult > 1 then
return {
xmult = card.ability.extra.xmult
}
end
if context.extinct then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
return {
message = localize('k_upgrade_ex'),
}
end
end,
}
--Misc stuff
local cuib = create_UIBox_buttons
function create_UIBox_buttons()
local t = cuib()
if G.GAME.modifiers.no_discards then