11SMODS .Atlas {
2- key = " modicon" ,
3- path = " mod_icon.png" ,
4- px = 34 ,
5- py = 34 ,
2+ key = " modicon" ,
3+ path = " mod_icon.png" ,
4+ px = 34 ,
5+ py = 34 ,
66}
77
88SMODS .Atlas {
9- key = " KHJokers" ,
10- path = " KHJokers.png" ,
11- px = 71 ,
12- py = 95 ,
9+ key = " KHJokers" ,
10+ path = " KHJokers.png" ,
11+ px = 71 ,
12+ py = 95 ,
1313}
1414
1515SMODS .Atlas ({
16- key = ' consumabels' ,
17- px = 71 ,
18- py = 95 ,
19- path = ' consumabels.png'
16+ key = ' consumabels' ,
17+ px = 71 ,
18+ py = 95 ,
19+ path = ' consumabels.png'
2020})
2121
2222
2323SMODS .Atlas ({
24- key = ' decks' ,
25- px = 71 ,
26- py = 95 ,
27- path = ' decks.png'
24+ key = ' decks' ,
25+ px = 71 ,
26+ py = 95 ,
27+ path = ' decks.png'
2828})
2929
30+ SMODS .Atlas {
31+ key = " KHSleeves" ,
32+ path = " cardsleeves.png" ,
33+ px = 71 ,
34+ py = 95 ,
35+ }
36+
3037SMODS .Atlas ({
3138 key = ' khblind' ,
3239 path = ' blinds.png' ,
33- px = 34 , py = 34 ,
40+ px = 34 ,
41+ py = 34 ,
3442 frames = 21 ,
35- atlas_table = ' ANIMATION_ATLAS' })
43+ atlas_table = ' ANIMATION_ATLAS'
44+ })
45+
46+ -- adds Kingdom Hearts Joker to the title menu
47+ function Card :resize (mod , force_save )
48+ self :hard_set_T (self .T .x , self .T .y , self .T .w * mod , self .T .h * mod )
49+ remove_all (self .children )
50+ self .children = {}
51+ self .children .shadow = Moveable (0 , 0 , 0 , 0 )
52+ self :set_sprites (self .config .center , self .base .id and self .config .card )
53+ end
54+
55+ local mainmenuref2 = Game .main_menu
56+ Game .main_menu = function (change_context )
57+ local ret = mainmenuref2 (change_context )
58+
59+ local newcard = SMODS .create_card ({ key = ' j_kh_khtrilogy' , area = G .title_top })
60+ G .title_top .T .w = G .title_top .T .w * 1.7675
61+ G .title_top .T .x = G .title_top .T .x - 0.8
62+ G .title_top :emplace (newcard )
63+ newcard :start_materialize ()
64+ newcard :resize (1.1 * 1.2 )
65+ newcard .no_ui = true
66+ return ret
67+ end
68+
3669
3770
3871KH = SMODS .current_mod
@@ -49,121 +82,135 @@ KH.config_tab = function()
4982 r = 0.1 , minw = 5 , align = " cm" , padding = 0.2 , colour = G .C .BLACK
5083 },
5184 nodes = {
52-
53- create_toggle ({
85+
86+ create_toggle ({
5487 id = " enable_jokers" ,
5588 label = localize (" k_khjokers_config_jokers" ),
56- info = {localize (' k_khjokers_config_restart' )},
89+ info = { localize (' k_khjokers_config_restart' ) },
5790 ref_table = KH .config ,
5891 ref_value = " enable_jokers" ,
5992 callback = function ()
6093 KH :save_config ()
6194 end ,
6295 }),
63-
96+
6497 create_toggle ({
6598 id = " enable_tarots" ,
6699 label = localize (" k_khjokers_config_tarots" ),
67- info = {localize (' k_khjokers_config_restart' )},
100+ info = { localize (' k_khjokers_config_restart' ) },
68101 ref_table = KH .config ,
69102 ref_value = " enable_tarots" ,
70103 callback = function ()
71104 KH :save_config ()
72105 end
73106 }),
74-
75- create_toggle ({
107+
108+ create_toggle ({
76109 id = " enable_spectrals" ,
77110 label = localize (" k_khjokers_config_spectrals" ),
78- info = {localize (' k_khjokers_config_restart' )},
111+ info = { localize (' k_khjokers_config_restart' ) },
79112 ref_table = KH .config ,
80113 ref_value = " enable_spectrals" ,
81114 callback = function ()
82115 KH :save_config ()
83116 end
84117 }),
85-
118+
119+
120+ create_toggle ({
121+ id = " enable_seal" ,
122+ label = localize (" k_khjokers_config_seal" ),
123+ info = { localize (' k_khjokers_config_restart' ) },
124+ ref_table = KH .config ,
125+ ref_value = " enable_seal" ,
126+ callback = function ()
127+ KH :save_config ()
128+ end
129+ }),
130+
131+ create_toggle ({
132+ id = " enable_blind" ,
133+ label = localize (" k_khjokers_config_blind" ),
134+ info = { localize (' k_khjokers_config_restart' ) },
135+ ref_table = KH .config ,
136+ ref_value = " enable_blind" ,
137+ callback = function ()
138+ KH :save_config ()
139+ end
140+ }),
141+
86142 }
87143 }
88144end
89145
90146if KH .config .enable_jokers then
91- local subdir = " content/cards"
92- local cards = NFS .getDirectoryItems (SMODS .current_mod .path .. subdir )
93- for _ , filename in pairs (cards ) do
94- assert (SMODS .load_file (subdir .. " /" .. filename ))()
95- end
147+ local subdir = " content/cards"
148+ local cards = NFS .getDirectoryItems (SMODS .current_mod .path .. subdir )
149+ for _ , filename in pairs (cards ) do
150+ assert (SMODS .load_file (subdir .. " /" .. filename ))()
151+ end
152+ SMODS .load_file (" content/challenges/challenges.lua" )() -- Loads Challenges if Jokers are enabled
96153end
97154
98155if KH .config .enable_tarots then
99- SMODS .load_file (" content/consumables/tarots.lua" )()
156+ SMODS .load_file (" content/consumables/tarots.lua" )()
100157end
101158
102- if KH .config .enable_spectrals then
159+ if KH .config .enable_spectrals then
103160 SMODS .load_file (" content/consumables/spectrals.lua" )()
104161end
105162
163+ if KH .config .enable_seal then
164+ SMODS .load_file (" content/consumables/seal.lua" )()
165+ end
166+
167+ if KH .config .enable_blind then
168+ SMODS .load_file (" content/blinds/blinds.lua" )()
169+ end
170+
106171-- load Friends of Jimbo
107172SMODS .load_file (" content/collabs/kingdomheartsxbalatro.lua" )()
108173
109174-- Joker Display Compat
110175if JokerDisplay then
111- SMODS .load_file (" content/JokerDisplay/joker_display_definitions.lua" )()
176+ SMODS .load_file (" content/JokerDisplay/joker_display_definitions.lua" )()
112177end
113178
114- SMODS .load_file (" content/consumables/seal.lua" )()
115-
116- SMODS .load_file (" content/challenges/challenges.lua" )()
117-
118-
119-
120- -- blinds
121- SMODS .Blind {
122- key = ' khblind' ,
123- loc_txt = {
124- name = ' Shuffled' ,
125- text = {
126- ' Shuffles Jokers' ,
127- ' When hand is played' ,
128- }
129- },
130- vars = {},
131- dollars = 5 ,
132- mult = 2 ,
133- debuff = {},
134- boss = {min = 2 , max = 10 },
135- boss_colour = HEX (' c88465' ),
136- pos = {x = 0 , y = 0 },
137- atlas = ' khblind' ,
138- press_play = function (self )
139- G .E_MANAGER :add_event (Event ({
140- trigger = ' after' ,
141- delay = 0.2 ,
142- func = function ()
143- for i = 1 , 3 do
144- G .E_MANAGER :add_event (Event ({
145- trigger = ' after' ,
146- delay = 0.15 * (i - 1 ),
147- func = function ()
148- G .jokers :shuffle (' aajk' )
149- play_sound (' cardSlide1' , 0.85 + 0.15 * i )
150- return true
151- end
152- }))
153- end
154- return true
155- end
156- }))
157- end
158- }
159-
179+ -- Decks
160180SMODS .Back {
161181 key = ' kingdom' ,
162182 atlas = ' decks' ,
163183 pos = { x = 0 , y = 0 },
164- config = {vouchers = { " v_overstock_norm" }, },
184+ config = { vouchers = { " v_overstock_norm" }, },
165185 loc_vars = function (self , info_queue , center )
166186 end ,
167187 calculate = function (self , back , context )
168188 end
169189}
190+
191+ -- CardSleeves Support!
192+ if CardSleeves then
193+ CardSleeves .Sleeve {
194+ key = ' kingdom' ,
195+ deck_buff = ' b_kh_kingdom' ,
196+ atlas = ' KHSleeves' ,
197+ pos = { x = 0 , y = 0 },
198+
199+ loc_vars = function (self )
200+ local key , vars
201+ if self .get_current_deck_key () == " b_kh_kingdom" then
202+ key = self .key .. " _alt"
203+ self .config = { vouchers = { " v_overstock_plus" } }
204+ vars = { self .config .vouchers }
205+ else
206+ key = self .key
207+ self .config = { vouchers = { " v_overstock_norm" } }
208+ vars = { self .config .vouchers }
209+ end
210+ return { key = key , vars = vars }
211+ end ,
212+
213+ calculate = function (self , sleeve , context )
214+ end
215+ }
216+ end
0 commit comments