Skip to content

Commit fd9e2e1

Browse files
authored
Merge pull request #479 from DigitalDetective47/main
Add support for Next Ante Preview 3.0.0
2 parents 6b6e2d6 + f21dc01 commit fd9e2e1

File tree

7 files changed

+63
-6
lines changed

7 files changed

+63
-6
lines changed

Cryptid.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"Steamodded (>=1.0.0~BETA-0314c)"
1616
],
1717
"conflicts": [
18-
"Saturn"
18+
"Saturn",
19+
"AntePreview (>= 2.0.0~0c16a) (<<3.0.0)"
1920
]
2021
}

assets/1x/hands.png

412 Bytes
Loading

assets/2x/hands.png

455 Bytes
Loading

items/blind.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,19 @@ local tax = {
258258
loc_vars = function(self, info_queue, card)
259259
return { vars = { 0.4 * get_blind_amount(G.GAME.round_resets.ante) * 2 * G.GAME.starting_params.ante_scaling } } -- no bignum?
260260
end,
261+
preview_ui = function(self)
262+
local value = self:loc_vars().vars[1]
263+
return {
264+
n = G.UIT.C,
265+
nodes = { {
266+
n = G.UIT.R,
267+
nodes = {
268+
{ n = G.UIT.O, config = { object = get_stake_sprite(G.GAME.stake, 0.25) } },
269+
{ n = G.UIT.T, config = { text = number_format(value), colour = G.C.RED, scale = score_number_scale(0.5, value) } }
270+
}
271+
} }
272+
}
273+
end,
261274
collection_loc_vars = function(self)
262275
return { vars = { localize("cry_tax_placeholder") } }
263276
end,
@@ -394,6 +407,10 @@ local joke = {
394407
},
395408
}
396409
end,
410+
preview_ui = function(self)
411+
local value = self:loc_vars().vars[2]
412+
return { n = G.UIT.T, config = { text = number_format(value), colour = G.C.ORANGE, scale = score_number_scale(0.5, value) } }
413+
end,
397414
collection_loc_vars = function(self)
398415
return { vars = { "8", localize("cry_joke_placeholder") } }
399416
end,

items/tag.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,25 @@ local memory = {
443443
or localize("k_none")
444444
return { vars = { self.config.num, loc_tag } }
445445
end,
446+
preview_ui = function(self, tag)
447+
if G.GAME.cry_last_tag_used then
448+
local last_tag = Tag(G.GAME.cry_last_tag_used, true)
449+
last_tag.ability.orbital_hand = G.GAME.cry_memory_orbital
450+
local tag_sprite
451+
_, tag_sprite = last_tag:generate_UI(0.4)
452+
return {
453+
n = G.UIT.C,
454+
nodes = { {
455+
n = G.UIT.R,
456+
nodes = {
457+
{ n = G.UIT.T, config = { text = ">", colour = G.C.WHITE, scale = 0.4 } },
458+
{ n = G.UIT.O, config = { object = tag_sprite } },
459+
G.P_TAGS[G.GAME.cry_last_tag_used].preview_ui and G.P_TAGS[G.GAME.cry_last_tag_used]:preview_ui(last_tag)
460+
}
461+
} }
462+
}
463+
end
464+
end,
446465
apply = function(self, tag, context)
447466
if context.type == "immediate" and G.GAME.cry_last_tag_used then
448467
local lock = tag.ID

lib/content.lua

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
-- content.lua - adds SMODS objects for content that should always be loaded
22

3+
SMODS.Atlas({
4+
key = "poker_hands",
5+
path = "hands.png",
6+
px = 53,
7+
py = 13,
8+
})
9+
310
SMODS.PokerHand({
411
key = "Bulwark",
512
visible = false,
@@ -14,6 +21,8 @@ SMODS.PokerHand({
1421
{ "S_A", true, "m_stone" },
1522
{ "S_A", true, "m_stone" },
1623
},
24+
atlas = "poker_hands",
25+
pos = { x = 0, y = 0 },
1726
evaluate = function(parts, hand)
1827
if Cryptid.enabled("set_cry_poker_hand_stuff") ~= true or Cryptid.enabled("c_cry_asteroidbelt") ~= true then
1928
return {}
@@ -65,6 +74,8 @@ SMODS.PokerHand({
6574
{ "S_6", true },
6675
{ "C_5", true },
6776
},
77+
atlas = "poker_hands",
78+
pos = { x = 0, y = 1 },
6879
evaluate = function(parts, hand)
6980
local other_hands = next(parts._flush) or next(parts._straight) or next(parts._all_pairs)
7081
if next(parts.cry_cfpart) then
@@ -92,6 +103,8 @@ SMODS.PokerHand({
92103
{ "H_7", true },
93104
{ "H_7", true },
94105
},
106+
atlas = "poker_hands",
107+
pos = { x = 0, y = 2 },
95108
evaluate = function(parts, hand)
96109
if Cryptid.enabled("set_cry_poker_hand_stuff") ~= true or Cryptid.enabled("c_cry_marsmoons") ~= true then
97110
return
@@ -354,7 +367,7 @@ SMODS.Atlas({
354367
py = 95,
355368
inject = function(self)
356369
local file_path = type(self.path) == "table"
357-
and (self.path[G.SETTINGS.language] or self.path["default"] or self.path["en-us"])
370+
and (self.path[G.SETTINGS.language] or self.path["default"] or self.path["en-us"])
358371
or self.path
359372
if file_path == "DEFAULT" then
360373
return
@@ -505,7 +518,8 @@ SMODS.Sound({
505518
pitch = 1,
506519
select_music_track = function()
507520
return G.STAGE == G.STAGES.MAIN_MENU
508-
and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "mainline" or G.selectedGameset and G.selectedGameset ~= "modest" and G.selectedGameset ~= "madness")
521+
and
522+
(G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "mainline" or G.selectedGameset and G.selectedGameset ~= "modest" and G.selectedGameset ~= "madness")
509523
and Cryptid_config.Cryptid.alt_bg_music
510524
end,
511525
})
@@ -520,7 +534,8 @@ SMODS.Sound({
520534
pitch = 1,
521535
select_music_track = function()
522536
return G.STAGE == G.STAGES.MAIN_MENU
523-
and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "madness" or G.selectedGameset == "madness")
537+
and
538+
(G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "madness" or G.selectedGameset == "madness")
524539
and Cryptid_config.Cryptid.alt_bg_music
525540
end,
526541
})
@@ -534,8 +549,9 @@ SMODS.Sound({
534549
},
535550
pitch = 1,
536551
select_music_track = function()
537-
return G.STAGE == G.STAGES.MAIN_MENU
538-
and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "modest" or G.selectedGameset == "modest")
552+
return G.STAGE == G.STAGES.MAIN_MENU
553+
and
554+
(G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "modest" or G.selectedGameset == "modest")
539555
and Cryptid_config.Cryptid.alt_bg_music
540556
end,
541557
})

lib/cross-mod.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ if (SMODS.Mods["AntePreview"] or {}).can_load then
117117
big = get_new_boss()
118118
end
119119
local predictions = predict_hook()
120+
if next(SMODS.find_card("j_cry_kittyprinter")) then
121+
predictions.Small.tag = "tag_cry_cat"
122+
predictions.Big.tag = "tag_cry_cat"
123+
end
120124
if G.GAME.modifiers.cry_no_tags then
121125
for _, pred in pairs(predictions) do
122126
pred.tag = nil

0 commit comments

Comments
 (0)