forked from frangnosquest/Finity
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinity.lua
More file actions
4598 lines (4526 loc) · 159 KB
/
Finity.lua
File metadata and controls
4598 lines (4526 loc) · 159 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
SMODS.Atlas {key = "coconut", path = "coconut.png", px = 128, py = 128}
SMODS.Atlas {key = "modicon", path = "icon.png", px = 32, py = 32}
SMODS.Atlas {key = "tag", path = "tag.png", px = 34, py = 34}
SMODS.Atlas({key = 'bossjokers', path = 'jokers.png', px = 71, py = 95})
SMODS.Atlas({key = 'boss_shinyjokers', path = 'compat/shinyjokers.png', px = 71, py = 95})
SMODS.Atlas({key = 'crybossjokers', path = 'compat/cryptid.png', px = 71, py = 95})
SMODS.Atlas({key = 'cryboss_shinyjokers', path = 'compat/shinycryptid.png', px = 71, py = 95})
SMODS.Atlas({key = 'akyrsbossjokers', path = 'compat/aikoyorisshenanigans.png', px = 71, py = 95})
SMODS.Atlas({key = 'ortalabbossjokers', path = 'compat/ortalab.png', px = 71, py = 95})
SMODS.Atlas({key = 'cardsaucebossjokers', path = 'compat/cardsauce.png', px = 71, py = 95})
SMODS.Atlas({key = 'pokermonbossjokers', path = 'compat/pokermon.png', px = 71, py = 95})
SMODS.Atlas({key = 'pokermonboss_shinyjokers', path = 'compat/pokermonshiny.png', px = 71, py = 95})
SMODS.Atlas({key = 'paperbackbossjokers', path = 'compat/paperback.png', px = 71, py = 95})
SMODS.Atlas({key = 'buncobossjokers', path = 'compat/bunco.png', px = 71, py = 95})
SMODS.Atlas({key = 'consumables', path = 'consumables.png', px = 71, py = 95})
SMODS.Atlas({key = 'marks', path = 'marks.png', px = 71, py = 95})
SMODS.Atlas({key = 'backs', path = 'backs.png', px = 71, py = 95})
SMODS.Atlas({key = 'sleeves', path = 'compat/sleeves.png', px = 73, py = 94})
SMODS.Atlas({key = 'blinddeck', path = 'blinddeck.png', px = 71, py = 95})
SMODS.Atlas({key = 'partners', path = 'compat/partners.png', px = 46, py = 58})
SMODS.Atlas({key = 'vrankhc', path = 'compat/vrankhc.png', px = 71, py = 95})
SMODS.Atlas({key = 'vranklc', path = 'compat/vranklc.png', px = 71, py = 95})
SMODS.Atlas({key = 'vrankhccompat', path = 'compat/vrankhccompat.png', px = 71, py = 95})
SMODS.Atlas({key = 'vranklccompat', path = 'compat/vranklccompat.png', px = 71, py = 95})
SMODS.Atlas({key = 'creditsthanks', path = 'creditsthanks.png', px = 71, py = 95})
local finity_config = SMODS.current_mod.config
SMODS.current_mod.optional_features = function()
return { retrigger_joker = true, post_trigger = true }
end
--hello to whoever is reading this, the following comments will
--guide you through how to create your own boss joker for
--cross-mod compatibility
SMODS.Rarity({
key = "showdown",
loc_txt = {name = "Showdown"},
badge_colour = HEX("690a0f"),
})
--this dictionary-structured table is used to check if a boss blind has a
--relative boss Joker, your mod should add to this table:
--["boss blind key"] = {"joker key", "boss blind display name" (used for showdown tag's description and other stuff)}
--while the mod is meant for showdown boss blinds specifically, nothing stops you from using regular boss blinds
FinisherBossBlindStringMap = {
["bl_final_acorn"] = {"j_finity_amberacorn","Amber Acorn"},
["bl_final_leaf"] = {"j_finity_verdantleaf","Verdant Leaf"},
["bl_final_vessel"] = {"j_finity_violetvessel","Violet Vessel"},
["bl_final_heart"] = {"j_finity_crimsonheart","Crimson Heart"},
["bl_final_bell"] = {"j_finity_ceruleanbell","Cerulean Bell"},
["bl_cry_lavender_loop"] = {"j_finity_lavenderloop","Lavender Loop"}, --built-in cross-mod jokers
["bl_cry_tornado"] = {"j_finity_turquoisetornado","Turquoise Tornado"},
["bl_cry_vermillion_virus"] = {"j_finity_vermillionvirus","Vermillion Virus"},
["bl_cry_sapphire_stamp"] = {"j_finity_sapphirestamp","Sapphire Stamp"},
["bl_cry_obsidian_orb"] = {"j_finity_obsidianorb","Obsidian Orb"},
["bl_cry_trophy"] = {"j_finity_lemontrophy","Lemon Trophy"},
["bl_akyrs_final_periwinkle_pinecone"] = {"j_finity_periwinklepinecone","Periwinkle Pinecone"},
["bl_akyrs_final_razzle_raindrop"] = {"j_finity_razzleraindrop","Razzle Raindrop"},
["bl_akyrs_final_lilac_lasso"] = {"j_finity_lilaclasso","Lilac Lasso"},
["bl_akyrs_final_velvet_vapour"] = {"j_finity_velvetvapour","Velvet Vapour"},
["bl_akyrs_final_chamomile_cloud"] = {"j_finity_chamomilecloud","Chamomile Cloud"},
["bl_akyrs_final_salient_stream"] = {"j_finity_salientstream","Salient Stream"},
["bl_akyrs_final_luminous_lemonade"] = {"j_finity_luminouslemonade","Luminous Lemonade"},
["bl_akyrs_final_glorious_glaive"] = {"j_finity_gloriousglaive","Glorious Glaive"},
["bl_ortalab_celadon_clubs"] = {"j_finity_celadonclubs","Celadon Clubs"},
["bl_ortalab_caramel_coin"] = {"j_finity_caramelcoin","Caramel Coin"},
["bl_ortalab_saffron_shield"] = {"j_finity_saffronshield","Saffron Shield"},
["bl_ortalab_rouge_rose"] = {"j_finity_rougerose","Rouge Rose"},
["bl_ortalab_silver_sword"] = {"j_finity_silversword","Silver Sword"},
["bl_csau_mochamike"] = {"j_finity_mochamike","Mocha Mike"},
["bl_csau_feltfortress"] = {"j_finity_feltfortress","Felt Fortress"},
["bl_poke_cgoose"] = {"j_finity_cgoosejoker","Chartreuse Chamber"},
["bl_paperback_taupe_treble"] = {"j_finity_taupetreble","Taupe Treble"},
["bl_bunc_final_crown"] = {"j_finity_chartreusecrown","Chartreuse Crown"}
}
--this table assigns sprites for the Taunting deck and is completely optional
--["boss blind key"] = {"atlas key", "coordinates"}
FinisherBossBlinddecksprites = {
placeholder = { "finity_blinddeck", { x = 5, y = 0 } },
["bl_final_acorn"] = {"finity_blinddeck",{ x = 2, y = 0 } },
["bl_final_leaf"] = {"finity_blinddeck",{ x = 3, y = 0 } },
["bl_final_vessel"] = {"finity_blinddeck",{ x = 4, y = 0 } },
["bl_final_heart"] = {"finity_blinddeck",{ x = 0, y = 0 } },
["bl_final_bell"] = {"finity_blinddeck",{ x = 1, y = 0 } },
["bl_cry_lavender_loop"] = {"finity_blinddeck",{ x = 3, y = 1 }}, --built-in cross-mod jokers
["bl_cry_tornado"] = {"finity_blinddeck",{ x = 5, y = 1 }},
["bl_cry_vermillion_virus"] = {"finity_blinddeck",{ x = 0, y = 1 }},
["bl_cry_sapphire_stamp"] = {"finity_blinddeck",{ x = 1, y = 1 }},
["bl_cry_obsidian_orb"] = {"finity_blinddeck",{ x = 2, y = 1 }},
["bl_cry_trophy"] = {"finity_blinddeck",{ x = 4, y = 1 }},
["bl_akyrs_final_periwinkle_pinecone"] = {"finity_blinddeck",{ x = 0, y = 2 }},
["bl_akyrs_final_razzle_raindrop"] = {"finity_blinddeck",{ x = 1, y = 2 }},
["bl_akyrs_final_lilac_lasso"] = {"finity_blinddeck",{ x = 2, y = 2 }},
["bl_akyrs_final_velvet_vapour"] = {"finity_blinddeck",{ x = 4, y = 2 }},
["bl_akyrs_final_chamomile_cloud"] = {"finity_blinddeck",{ x = 3, y = 2 }},
["bl_akyrs_final_salient_stream"] = {"finity_blinddeck",{ x = 5, y = 2 }},
["bl_akyrs_final_luminous_lemonade"] = {"finity_blinddeck",{ x = 6, y = 2 }},
["bl_akyrs_final_glorious_glaive"] = {"finity_blinddeck",{ x = 7, y = 2 }},
["bl_ortalab_celadon_clubs"] = {"finity_blinddeck",{ x = 0, y = 3 }},
["bl_ortalab_caramel_coin"] = {"finity_blinddeck",{ x = 1, y = 3 }},
["bl_ortalab_saffron_shield"] = {"finity_blinddeck",{ x = 2, y = 3 }},
["bl_ortalab_rouge_rose"] = {"finity_blinddeck",{ x = 3, y = 3 }},
["bl_ortalab_silver_sword"] = {"finity_blinddeck",{ x = 4, y = 3 }},
["bl_csau_mochamike"] = {"finity_blinddeck",{ x = 0, y = 4 }},
["bl_csau_feltfortress"] = {"finity_blinddeck",{ x = 1, y = 4 }},
["bl_poke_cgoose"] = {"finity_blinddeck",{ x = 2, y = 4 }}
}
--another optional feature is having the boss joker cards appear and say a quip instead of jimbo when losing to their respective blinds.
--["boss blind key"] = {"identifier of your quips in the localization files", number of quips}
--structure your quips this way: lq_identifier_quipnumber
--another feature is having specific game over quips for endless, if you want your blind to have some just add them in your
--localization file as lq_endless_identifier_quipnumber and add the number of quips as the third element in the table
--["boss blind key"] = {"identifier of your quips in the localization files", number of quips, number of endless quips}
FinisherBossBlindQuips = {
["bl_final_acorn"] = {"amber",3,3},
["bl_final_leaf"] = {"verdant",3,3},
["bl_final_vessel"] = {"violet",3,3},
["bl_final_heart"] = {"crimson",3,3},
["bl_final_bell"] = {"cerulean",3,3},
["bl_cry_lavender_loop"] = {"lavender",3,2}, --built-in cross-mod jokers
["bl_cry_tornado"] = {"turquoise",3,3},
["bl_cry_vermillion_virus"] = {"vermillion",3,3},
["bl_cry_sapphire_stamp"] = {"sapphire",3,3},
["bl_cry_obsidian_orb"] = {"obsidian",3,3},
["bl_cry_trophy"] = {"lemon",3,3},
["bl_akyrs_final_periwinkle_pinecone"] = {"periwinkle",3,1},
["bl_akyrs_final_razzle_raindrop"] = {"razzle",3,1},
["bl_akyrs_final_lilac_lasso"] = {"lilac",3,3},
["bl_akyrs_final_velvet_vapour"] = {"velvet",3},
["bl_akyrs_final_chamomile_cloud"] = {"chamomile",3,1},
["bl_akyrs_final_salient_stream"] = {"salient",3},
["bl_akyrs_final_luminous_lemonade"] = {"luminous",3},
["bl_akyrs_final_glorious_glaive"] = {"glorious",3,3},
["bl_poke_cgoose"] = {"chartreuse",3}
}
--and that's all you have to do with stuff here, create your boss joker, make sure to give it the showdown rarity
--and you're good to go, as you can see below the mod handles everything else by itself
SMODS.Tag {
key = "showdown",
name = "Showdown Tag",
atlas = "tag",
pos = { x = 0, y = 0 },
in_pool = function(self)
return false
end,
config = { joker = "none", display = "(Beaten blind)" },
loc_vars = function(self, info_queue, tag)
local _showdowntoget = ""
local _willorgain = ""
local _moneytogain = ""
local _returnquestion = ""
local _parenthesistext = ""
if tag.config.joker == "none" and G.jokers then
_willorgain = "Earn "
_moneytogain = "$10"
_parenthesistext = "(Tag is not authentic)"
else
_showdowntoget = tag.config.display
_willorgain = "will"
_returnquestion = "return in the next shop..."
end
return {
vars = {_showdowntoget,_willorgain,_returnquestion,_moneytogain,_parenthesistext}
}
end,
loc_txt={
name = "Showdown Tag",
text = {
"{C:attention}#1#{} #2#{C:money}#4#",
"#3#{C:inactive}#5#",
}
}, --the tag creates a joker based on the string provided by the wrapped function below
apply = function(self, tag, context)
if context.type == "store_joker_create" then
if tag.config.joker ~= "none" then
local card
card = create_card("Joker", context.area, nil, nil, nil, nil,tag.config.joker)
create_shop_card_ui(card, "Joker", context.area)
card.states.visible = false
tag:yep("+", G.C.RARITY.finity_showdown, function()
card:start_materialize()
card:set_cost()
return true
end)
tag.triggered = true
return card
else
local card
card = create_card("Joker", context.area, nil, nil, nil, nil,nil)
create_shop_card_ui(card, "Joker", context.area)
card.states.visible = false
tag:yep("+", G.C.RARITY.finity_showdown, function()
card:start_materialize()
card:set_cost()
return true
end)
ease_dollars(10)
tag.triggered = true
return card
end
end
end,
}
local old_end_round = end_round
end_round = function()
old_end_round()
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
if FinisherBossBlindStringMap[G.GAME.blind.config.blind.key] then
local tag = Tag('tag_finity_showdown')
tag.config.joker = FinisherBossBlindStringMap[G.GAME.blind.config.blind.key][1]
tag.config.display = FinisherBossBlindStringMap[G.GAME.blind.config.blind.key][2]
add_tag(tag)
play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
G.GAME.blind.savename = G.GAME.blind.config.blind.key
end --this function reads the table above to check when to create the tag and what joker it will give
return true end}))
end
--everything else below is just code for jokers, consumable and decks
SMODS.Joker {
key = "verdantleaf",
name = "Verdant Leaf",
atlas = 'bossjokers',
poke_custom_prefix = "finity_boss",
pronouns = "she_they",
loc_txt = {
name = "Verdant Leaf",
text = {
"When you sell a {C:attention}Joker{}, create",
"one of the next lower {C:attention}rarity{},",
"selling a {C:chips}common{} {C:attention}Joker{} creates",
"a {C:attention}consumable"
}
},
unlocked = true,
discovered = true,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
rarity = "finity_showdown",
pos = { x = 0, y = 3 },
cost = 10,
soul_pos = { x = 1, y = 3 },
calculate = function(self, card, context)
if context.selling_card and context.card.ability.set == "Joker" and context.card ~= card then
local _raritylist = {{1,"akyrs_supercommon","playbook_the","crp_trash","crp_:3"},{2,"akyrs_emerald"},{3,"poke_safari","payasaka_ahead"},{4,"finity_showdown","poke_mega","mf_bossblind","payasaka_daeha"},"cry_exotic"}
local _rarity = context.card.config.center.rarity
local _newrarity
local _raritiesstring = {"Common", "Uncommon", "Rare", "Legendary"}
if next(SMODS.find_mod('Cryptid')) then
_raritylist = {{1,"akyrs_supercommon","playbook_the","crp_trash","crp_:3","crp_common_2"},{2,"cry_candy","akyrs_emerald","crp_uncommon_2"},{3,"poke_safari","payasaka_ahead","crp_rare_2"},{"cry_epic","mf_bossblind","crp_cipe"},{4,"finity_showdown","poke_mega","entr_reverse_legendary","payasaka_daeha"},{"cry_exotic","crp_exotic_2","unik_unik_legendary_blind_finity"},{"entr_entropic","jen_wondrous","jen_ritualistic","playbook_playful","crp_mythic"},{"entr_zenith","jen_extraordinary","jen_transcendent","crp_exomythic"},{"jen_omegatranscendent","jen_omnipotent","crp_all"}}
_raritiesstring = {"Common", "Uncommon", "Rare", "cry_epic", "Legendary", "cry_exotic","entr_entropic","jen_extraordinary"}
if next(SMODS.find_mod('jen')) then
_raritiesstring[7] = "jen_wondrous"
end
if next(SMODS.find_mod('cryptposting')) then
_raritiesstring[7] = "crp_mythic"
_raritiesstring[8] = "crp_exomythic"
table.insert(_raritylist, 2, "crp_2common4me")
table.insert(_raritiesstring, 2, "crp_2common4me")
table.insert(_raritylist, 4, "crp_unrare")
table.insert(_raritiesstring, 4, "crp_unrare")
table.insert(_raritylist, 11, "crp_2exomythic4me")
table.insert(_raritiesstring,"crp_2exomythic4me")
table.insert(_raritylist, 12, "crp_22exomythic4mecipe")
table.insert(_raritiesstring,"crp_22exomythic4mecipe")
table.insert(_raritylist, 13, "crp_exomythicepicawesomeuncommon2mexotic22exomythic4mecipe")
table.insert(_raritiesstring,"crp_exomythicepicawesomeuncommon2mexotic22exomythic4mecipe")
end
end
for index, value in ipairs(_raritylist) do
if value == _rarity then
_newrarity = index - 1
break
elseif type(value) == "table" then
for sub_index, sub_value in ipairs(value) do
if sub_value == _rarity then
_newrarity = index - 1
break
end
end
end
end
if _newrarity then
if _newrarity <= 0 then
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
local randomcons = create_card('Consumeables', G.consumeables, nil, nil, nil, nil, nil)
randomcons:add_to_deck()
G.consumeables:emplace(randomcons)
G.GAME.consumeable_buffer = 0
card:juice_up(0.3, 0.5)
end
elseif #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit + 1 then
SMODS.add_card { set = 'Joker', rarity = _raritiesstring[_newrarity]}
card:juice_up(0.3, 0.5)
end
end
return
end
end
}
SMODS.Joker {
key = "violetvessel",
name = "Violet Vessel",
atlas = 'bossjokers',
poke_custom_prefix = "finity_boss",
pronouns = "he_him",
loc_txt = {
name = "Violet Vessel",
text = {
"All {C:attention}Boss Blinds{} become {C:purple}The Wall{} or ",
"{C:purple}Violet Vessel{}, gains {X:mult,C:white}XMult{} equal to score",
"surplus ratio after beating a {C:attention}Boss Blind{}",
"{C:inactive,s:0.8}(Max {X:mult,C:white,s:0.8}X#2#{C:inactive,s:0.8} Mult per round, currently {X:mult,C:white,s:0.8}X#1#{C:inactive,s:0.8} Mult)",
}
},
config = {
extra = {xmult = 1},
max = 2,
credits = "no"
},
loc_vars = function(self, info_queue, card)
if card.ability.credits == "no" then
return {
vars = {card.ability.extra.xmult,card.ability.max}
}
else
return {
vars = {card.ability.extra.xmult,card.ability.max},
key = card.ability.credits, set = 'Joker'
}
end
end,
unlocked = true,
discovered = true,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
rarity = "finity_showdown",
pos = { x = 0, y = 4 },
cost = 10,
soul_pos = { x = 1, y = 4 },
add_to_deck = function(self, card, from_debuff)
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
G.GAME.round_resets.blind_choices.Boss = get_new_boss()
return true end }))
end,
calculate = function(self, card, context)
if (context.joker_main or context.forcetrigger) and to_big(card.ability.extra.xmult) > to_big(1) then
return {
Xmult_mod = card.ability.extra.xmult,
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } }
}
end
if context.end_of_round and not context.repetition and context.cardarea == G.jokers and G.GAME.blind:get_type() == "Boss" and not context.blueprint then
if to_big(G.GAME.chips) > to_big(G.GAME.blind.chips) then
local surplus = to_big(G.GAME.chips)/to_big(G.GAME.blind.chips)
if to_big(surplus) < to_big(0.01) then
surplus = 0.01
end
if to_number(surplus) >= to_number(card.ability.max) then
print(card.ability.max)
card.ability.extra.xmult = to_number(card.ability.extra.xmult) + card.ability.max
else
print(to_number(surplus))
card.ability.extra.xmult = to_number(card.ability.extra.xmult) + to_number(surplus)
end
return {
message = "X" .. tostring(card.ability.extra.xmult) .. " Mult",
colour = G.C.RED,
card = card
}
end
end
end
}
SMODS.Joker {
key = "amberacorn",
name = "Amber Acorn",
atlas = 'bossjokers',
poke_custom_prefix = "finity_boss",
pronouns = "he_any",
loc_txt = {
name = "Amber Acorn",
text = {
"Gains {X:mult,C:white}X#2#{} Mult for each {C:attention}Joker{}",
"card when {C:attention}Blind{} is defeated, all other",
"{C:attention}Jokers{} are {C:attention}pinned to the left",
"{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)"
}
},
config = {
extra = {xmult = 1},
increase = 0.2
},
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.extra.xmult,card.ability.increase}
}
end,
unlocked = true,
discovered = true,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
rarity = "finity_showdown",
pos = { x = 0, y = 2 },
cost = 10,
soul_pos = { x = 1, y = 2 },
calculate = function(self, card, context)
if (context.joker_main or context.forcetrigger) and card.ability.extra.xmult > 1 then
return {
Xmult_mod = card.ability.extra.xmult,
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } }
}
end
if context.end_of_round and not context.repetition and context.game_over == false and not context.blueprint then
card.ability.extra.xmult = card.ability.extra.xmult + (card.ability.increase * #G.jokers.cards)
return {
message = "X" .. tostring(card.ability.extra.xmult) .. " Mult",
colour = G.C.RED,
card = card
}
end
if not context.blueprint then
for i = 1, #G.jokers.cards do
if (not G.jokers.cards[i].pinned or G.jokers.cards[i].pinned == false) and G.jokers.cards[i].config.center.key ~= "j_finity_amberacorn" then
G.jokers.cards[i].pinned = true
end
end
end
end,
add_to_deck = function(self, card, from_debuff)
for i = 1, #G.jokers.cards do
if (not G.jokers.cards[i].pinned or G.jokers.cards[i].pinned == false) and G.jokers.cards[i].config.center.key ~= "j_finity_amberacorn" then
G.jokers.cards[i].pinned = true
end
end
end,
remove_from_deck = function(self, card, from_debuff)
for i = 1, #G.jokers.cards do
G.jokers.cards[i].pinned = false
if G.jokers.cards[i].ability.pinned then
G.jokers.cards[i].ability.pinned = false
end
end
end
}
SMODS.Joker {
key = "crimsonheart",
name = "Crimson Heart",
atlas = 'bossjokers',
poke_custom_prefix = "finity_boss",
pronouns = "she_they",
loc_txt = {
name = "Crimson Heart",
text = {
"One random {C:attention}Joker{} is {C:attention}marked",
"every hand, marked {C:attention}Jokers{}",
"retrigger {C:attention}#1#{} additional times",
}
},
config = {
extra = {retriggers = 2},
hand_played = true,
identifier = tostring(0)
},
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.extra.retriggers}
}
end,
unlocked = true,
discovered = true,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
rarity = "finity_showdown",
pos = { x = 0, y = 0 },
cost = 10,
soul_pos = { x = 1, y = 0 },
set_ability = function(self, card, initial, delay_sprites)
if card.ability.identifier == tostring(0) then
card.ability.identifier = tostring(pseudorandom('crimsonheart', 1, 999999999999))
end
end,
calculate = function(self, card, context)
if context.before and not context.blueprint then
card.ability.hand_played = true
end
if context.retrigger_joker_check and not context.retrigger_joker and context.other_card then
if context.other_card.ability and context.other_card.ability.finitycrimsonheartmark then
if card.ability.extra.retriggers > 40 then
card.ability.extra.retriggers = 40
end
return {
message = localize("k_again_ex"),
repetitions = card.ability.extra.retriggers,
card = card
}
end
end
if (context.hand_drawn and card.ability.hand_played == true and not context.blueprint) or (context.end_of_round and context.main_eval) then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.finitycrimsonheartmark and G.jokers.cards[i].ability.finitycrimsonheartmark == card.ability.identifier then
G.jokers.cards[i].ability.finitycrimsonheartmark = nil
if G.jokers.cards[i].finity then
G.jokers.cards[i].finity.floating_sprite_mark = nil
end
end
end
if context.hand_drawn then
card.ability.hand_played = false
local _heartlesstable = {}
for _, v in ipairs(G.jokers.cards) do
if v ~= card and v.config.center.key ~= "j_finity_crimsonheart" and not v.ability.finitycrimsonheartmark then
table.insert(_heartlesstable, v)
end
end
if next(_heartlesstable) ~= nil then
local _heart_target = pseudorandom_element(_heartlesstable)
_heart_target.ability.finitycrimsonheartmark = card.ability.identifier
_heart_target.finity = {}
_heart_target.finity.floating_sprite_mark = Sprite(
_heart_target.T.x,
_heart_target.T.y,
_heart_target.T.w,
_heart_target.T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 0, y = 0 }
)
_heart_target.finity.floating_sprite_mark.role.draw_major = _heart_target
_heart_target.finity.floating_sprite_mark.states.hover.can = false
_heart_target.finity.floating_sprite_mark.states.click.can = false
_heart_target:juice_up(0.3, 0.5)
card:juice_up(0.3, 0.5)
end
end
end
end,
remove_from_deck = function(self, card, from_debuff)
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.finitycrimsonheartmark and G.jokers.cards[i].ability.finitycrimsonheartmark == card.ability.identifier then
G.jokers.cards[i].ability.finitycrimsonheartmark = nil
if G.jokers.cards[i].finity then
G.jokers.cards[i].finity.floating_sprite_mark = nil
end
end
end
end
}
SMODS.Joker {
key = "ceruleanbell",
name = "Cerulean Bell",
atlas = 'bossjokers',
poke_custom_prefix = "finity_boss",
pronouns = "she_her",
loc_txt = {
name = "Cerulean Bell",
text = {
"One random card in hand is {C:attention}marked{},",
"marked cards permanently gain",
"{X:mult,C:white}X#1#{} Mult when scored"
}
},
config = {
identifier = tostring(0),
xmultbonus = 2
},
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.xmultbonus}
}
end,
unlocked = true,
discovered = true,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
rarity = "finity_showdown",
pos = { x = 0, y = 1 },
cost = 10,
soul_pos = { x = 1, y = 1 },
set_ability = function(self, card, initial, delay_sprites)
if card.ability.identifier == tostring(0) then
card.ability.identifier = tostring(pseudorandom('ceruleanbell', 1, 999999999999))
end
end,
calculate = function(self, card, context)
if (context.hand_drawn and not context.blueprint) or (context.end_of_round and context.main_eval) then
for i = 1, #G.playing_cards do
if G.playing_cards[i].ability.finityceruleanbellmark and G.playing_cards[i].ability.finityceruleanbellmark == card.ability.identifier then
G.playing_cards[i].ability.finityceruleanbellmark = nil
if G.playing_cards[i].finity then
G.playing_cards[i].finity.floating_sprite_mark = nil
end
end
end
if context.hand_drawn then
local _belllesstable = {}
for _, v in ipairs(G.hand.cards) do
if not v.ability.finityceruleanbellmark then
table.insert(_belllesstable, v)
end
end
if next(_belllesstable) ~= nil then
local _bell_target = pseudorandom_element(_belllesstable)
_bell_target.ability.finityceruleanbellmark = card.ability.identifier
_bell_target.finity = {}
_bell_target.finity.floating_sprite_mark = Sprite(
_bell_target.T.x,
_bell_target.T.y,
_bell_target.T.w,
_bell_target.T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 1, y = 0 }
)
_bell_target.finity.floating_sprite_mark.role.draw_major = _bell_target
_bell_target.finity.floating_sprite_mark.states.hover.can = false
_bell_target.finity.floating_sprite_mark.states.click.can = false
_bell_target:juice_up(0.3, 0.5)
card:juice_up(0.3, 0.5)
end
end
end
if context.individual and context.cardarea == G.play then
if context.other_card.ability.finityceruleanbellmark then
if context.other_card.ability.perma_x_mult ~= 0 then
context.other_card.ability.perma_x_mult = context.other_card.ability.perma_x_mult + 2
else
context.other_card.ability.perma_x_mult = 1
end
return {
extra = {message = localize('k_upgrade_ex'), colour = G.C.MULT},
colour = G.C.MULT,
card = card
}
end
end
end,
remove_from_deck = function(self, card, from_debuff)
for i = 1, #G.playing_cards do
if G.playing_cards[i].ability.finityceruleanbellmark and G.playing_cards[i].ability.finityceruleanbellmark == card.ability.identifier then
G.playing_cards[i].ability.finityceruleanbellmark = nil
if G.playing_cards[i].finity then
G.playing_cards[i].finity.floating_sprite_mark = nil
end
end
end
end
}
if finity_config.spectral == true then
SMODS.Consumable {
key = 'finity',
name = "Finity",
set = 'Spectral',
loc_txt = {
name = "Finity",
text = {
"Creates a",
"{C:hearts,E:2}Showdown{} Joker",
"{C:inactive}(Must have room)",
}
},
hidden = true,
soul_set = 'Spectral',
soul_rate = 0.006,
atlas = 'consumables',
pos = { x = 0, y = 0 },
cost = 4,
use = function(self, card, context, copier)
local new_card = create_card('Joker', G.jokers, nil, "finity_showdown", nil, nil, nil, 'finity')
new_card:add_to_deck()
G.jokers:emplace(new_card)
new_card:start_materialize()
G.GAME.joker_buffer = 0
end,
can_use = function(self, card)
if #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
return true
else
return false
end
end,
}
end
local set_spritesref = Card.set_sprites
function Card:set_sprites(_center, _front)
set_spritesref(self, _center, _front)
if _center and _center.name == "Finity" 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 = 1, 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
end
end
SMODS.DrawStep {
key = 'finity',
order = 51,
func = function(self)
if self.ability.name == 'Finity' 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.5 * G.TIMERS.REAL
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.07 + 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,
nil,
-0.2
)
end
if self.config.center and (self.ability.finitycrimsonheartmark or self.ability.finityceruleanbellmark or self.ability.finityrazzleraindropmark or self.ability.finitysaffronshieldmark) and self.finity and self.finity.floating_sprite_mark 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
self.finity.floating_sprite_mark.role.draw_major = self
self.finity.floating_sprite_mark:draw_shader(
"dissolve",
0,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod,
nil,
-0.07 + 0.03 * math.sin(1.8 * G.TIMERS.REAL),
nil,
0.6
)
self.finity.floating_sprite_mark:draw_shader(
"dissolve",
nil,
nil,
nil,
self.children.center,
scale_mod,
rotate_mod,
nil,
-0.07
)
end
end,
conditions = { vortex = false, facing = 'front' },
}
to_big = to_big or function(value)
return value
end
to_number = to_number or function(value)
return value
end
local old_start_run = Game.start_run
function Game:start_run(args)
old_start_run(self,args)
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.finitycrimsonheartmark then
if G.jokers.cards[i].ability.finitycrimsonheartmark == "lovesick" then
G.jokers.cards[i].finity = {}
G.jokers.cards[i].finity.floating_sprite_mark = Sprite(
G.jokers.cards[i].T.x,
G.jokers.cards[i].T.y,
G.jokers.cards[i].T.w,
G.jokers.cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 3, y = 0 }
)
G.jokers.cards[i].finity.floating_sprite_mark.role.draw_major = G.jokers.cards[i]
G.jokers.cards[i].finity.floating_sprite_mark.states.hover.can = false
G.jokers.cards[i].finity.floating_sprite_mark.states.click.can = false
else
G.jokers.cards[i].finity = {}
G.jokers.cards[i].finity.floating_sprite_mark = Sprite(
G.jokers.cards[i].T.x,
G.jokers.cards[i].T.y,
G.jokers.cards[i].T.w,
G.jokers.cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 0, y = 0 }
)
G.jokers.cards[i].finity.floating_sprite_mark.role.draw_major = G.jokers.cards[i]
G.jokers.cards[i].finity.floating_sprite_mark.states.hover.can = false
G.jokers.cards[i].finity.floating_sprite_mark.states.click.can = false
end
end
end
for i = 1, #G.hand.cards do
if G.hand.cards[i].ability.finityceruleanbellmark then
if G.hand.cards[i].ability.finityceruleanbellmark == "controlling" then
G.hand.cards[i].finity = {}
G.hand.cards[i].finity.floating_sprite_mark = Sprite(
G.hand.cards[i].T.x,
G.hand.cards[i].T.y,
G.hand.cards[i].T.w,
G.hand.cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 4, y = 0 }
)
G.hand.cards[i].finity.floating_sprite_mark.role.draw_major = G.hand.cards[i]
G.hand.cards[i].finity.floating_sprite_mark.states.hover.can = false
G.hand.cards[i].finity.floating_sprite_mark.states.click.can = false
else
G.hand.cards[i].finity = {}
G.hand.cards[i].finity.floating_sprite_mark = Sprite(
G.hand.cards[i].T.x,
G.hand.cards[i].T.y,
G.hand.cards[i].T.w,
G.hand.cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 1, y = 0 }
)
G.hand.cards[i].finity.floating_sprite_mark.role.draw_major = G.hand.cards[i]
G.hand.cards[i].finity.floating_sprite_mark.states.hover.can = false
G.hand.cards[i].finity.floating_sprite_mark.states.click.can = false
end
end
end
for i = 1, #G.playing_cards do
if G.playing_cards[i].ability.finityrazzleraindropmark then
G.playing_cards[i].finity = {}
G.playing_cards[i].finity.floating_sprite_mark = Sprite(
G.playing_cards[i].T.x,
G.playing_cards[i].T.y,
G.playing_cards[i].T.w,
G.playing_cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 2, y = 0 }
)
G.playing_cards[i].finity.floating_sprite_mark.role.draw_major = G.playing_cards[i]
G.playing_cards[i].finity.floating_sprite_mark.states.hover.can = false
G.playing_cards[i].finity.floating_sprite_mark.states.click.can = false
end
end
for i = 1, #G.playing_cards do
if G.playing_cards[i].ability.finitysaffronshieldmark then
G.playing_cards[i].finity = {}
G.playing_cards[i].finity.floating_sprite_mark = Sprite(
G.playing_cards[i].T.x,
G.playing_cards[i].T.y,
G.playing_cards[i].T.w,
G.playing_cards[i].T.h,
G.ASSET_ATLAS['finity_marks'],
{ x = 5, y = 0 }
)
G.playing_cards[i].finity.floating_sprite_mark.role.draw_major = G.playing_cards[i]
G.playing_cards[i].finity.floating_sprite_mark.states.hover.can = false
G.playing_cards[i].finity.floating_sprite_mark.states.click.can = false
end
end
for i = 1, #G.GAME.tags do
if G.GAME.tags[i].key == "tag_finity_showdown" and G.GAME.tags[i].config.joker == "none" then
G.GAME.tags[i].config.joker = FinisherBossBlindStringMap[G.GAME.blind.config.blind.key][1]
G.GAME.tags[i].config.display = FinisherBossBlindStringMap[G.GAME.blind.config.blind.key][2]
end
end
--G.P_CENTERS.b_finity_taunting.atlas, G.P_CENTERS.b_finity_taunting.pos = G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"][6], G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"][7]
end
SMODS.Back{
key = "challenger",
atlas = "backs",
pos = {x = 0, y = 0},
loc_txt = {
name ="Challenger's Deck",
text={
"{C:attention}+1{} Joker slot",
"Start run with {C:attention,T:v_directors_cut}Director's",
"{C:attention}Cut{} and extra {C:money}6$",
"All {C:attention}Boss Blinds{} are {C:attention}Showdowns",
},
},
config = {
voucher = "v_directors_cut",
dollars = 6,
joker_slot = 1
},
}
G.finityblinddecktype = {"bl_final_bell","Cerulean Bell","notchange","atlas","pos"}
SMODS.Back{
key = "taunting",
atlas = "blinddeck",
pos = {x = 5, y = 0},
loc_txt = {
name ="Taunting Deck",
text={
"{C:attention}Boss Blind{} is always {C:attention}#1#{}",
"{C:inactive}(Click to swap)",
},
},
finitychanging = "unknown",
config = {
blind = "none"
},
loc_vars = function(self, info_queue, center)
return { vars = {G.finityblinddecktype[2]} }
end,
apply = function(self)
G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"][5] = G.finityblinddecktype[1]
G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"][6] = G.finityblinddecktype[4]
G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"][7] = G.finityblinddecktype[5]
G.GAME.banned_keys["v_directors_cut"] = true
G.GAME.banned_keys["v_retcon"] = true
end
}
local oldclick = Card.click
function Card:click()
oldclick(self)
if
Galdur
and safely_get(Galdur, "run_setup", "current_page") == 1
and self.config.center.key == "b_finity_taunting"
and self.area == safely_get(Galdur, "run_setup", "selected_deck_area")
or not Galdur
and (safely_get(G.GAME, "viewed_back", "effect", "center", "finitychanging") and (self.back == "viewed_back" or self.edeck_select))
then
local eligible_bosses = {}
for k, v in pairs(G.P_BLINDS) do
if v.boss and v.boss.showdown and not (v.key:match("_dx" .. "$") == "_dx") then
if FinisherBossBlindStringMap[k] then
eligible_bosses[k] = FinisherBossBlindStringMap[k][2]
else
eligible_bosses[k] = v.name
end
end
end
local _keys = {}
local _values = {}
local _atlas
local _coords
local _finityisitinthere = 0
for k, v in pairs(eligible_bosses) do
if k == G.finityblinddecktype[1] then
_finityisitinthere = _finityisitinthere + 1
end
table.insert(_keys, k)
table.insert(_values, v)
end
if _finityisitinthere == 0 then
table.insert(_keys, G.finityblinddecktype[1])
end
for i, k in ipairs(_keys) do
if k == G.finityblinddecktype[1] then
local next_index = (i % #_keys) + 1
G.finityblinddecktype[1] = _keys[next_index]
G.finityblinddecktype[2] = _values[next_index]
if self.children.back then self.children.back:remove() end
if FinisherBossBlinddecksprites[_keys[next_index]] then
_atlas = FinisherBossBlinddecksprites[_keys[next_index]][1]
_coords = FinisherBossBlinddecksprites[_keys[next_index]][2]
else
_atlas = FinisherBossBlinddecksprites["placeholder"][1]
_coords = FinisherBossBlinddecksprites["placeholder"][2]
end
G.finityblinddecktype[4] = _atlas
G.finityblinddecktype[5] = _coords
self.children.back = Sprite(self.T.x, self.T.y, self.T.w, self.T.h, G.ASSET_ATLAS[_atlas], _coords)
self.children.back.states.hover = self.states.hover
self.children.back.states.click = self.states.click
self.children.back.states.drag = self.states.drag
self.children.back.states.collide.can = false
self.children.back:set_role({ major = self, role_type = 'Glued', draw_major = self })
G.P_CENTERS.b_finity_taunting.atlas, G.P_CENTERS.b_finity_taunting.pos = _atlas, _coords
G.finityblinddecktype[3] = "change"
if not G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"] then
G.PROFILES[G.SETTINGS.profile]["finityblinddeckdata"] = {}