Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,640 changes: 338 additions & 1,302 deletions items/sleeve.lua

Large diffs are not rendered by default.

144 changes: 143 additions & 1 deletion lib/content.lua
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ function Cryptid.antimatter_compat(key, on_load)
not back
or back.set ~= "Back"
or (SMODS.Centers[key] and Cryptid.enabled(key) ~= true)
or not (Cryptid.gameset(G.P_CENTERS.b_cry_antimatter) == "madness" or ((Cryptid.safe_get(
or not (Cryptid.gameset(G.P_CENTERS.b_cry_antimatter or "b_cry_antimatter") == "madness" or ((Cryptid.safe_get(
G.PROFILES,
G.SETTINGS.profile,
"deck_usage",
Expand All @@ -896,6 +896,39 @@ function Cryptid.antimatter_compat(key, on_load)
return false
end

function Cryptid.antimatter_sleeve_compat(sleeve_key)
if not sleeve_key then
return false
end
local full_key = sleeve_key
if not full_key:find("^sleeve_") then
full_key = "sleeve_" .. full_key
end
if full_key == "sleeve_cry_antimatter_sleeve" or full_key == "sleeve_casl_none" or full_key == "sleeve_none" then
return false
end
if Cryptid.gameset(G.P_CENTERS.sleeve_cry_antimatter_sleeve or "sleeve_cry_antimatter_sleeve") == "madness" then
return true
end
return (
Cryptid.safe_get(
G.PROFILES,
G.SETTINGS.profile,
"sleeve_usage",
full_key,
"wins_by_key",
"stake_gold"
) or Cryptid.safe_get(
G.PROFILES,
G.SETTINGS.profile,
"sleeve_usage",
sleeve_key,
"wins_by_key",
"stake_gold"
) or 0
) > 0
end

--Edition Deck Selection
SMODS.RunSelectPage({
key = "edeck_ed",
Expand Down Expand Up @@ -1398,3 +1431,112 @@ SMODS.RunSelectPage({
return SMODS.RunSelect.Setup.choices.deck_choice == "b_cry_antimatter"
end,
})

--Antimatter Sleeve selection
SMODS.RunSelectPage({
key = "cry_antimatter_sleeve",
include_deck_preview = true,
area_type = "deck",
stack_size = 11,
preview_size = 11,
inject = function(self)
local sleeve_idx = nil
if SMODS.RunSelect and SMODS.RunSelect.Internals and SMODS.RunSelect.Internals.pages then
for idx, p_key in ipairs(SMODS.RunSelect.Internals.pages) do
if p_key == "casl_sleeve_choice" or p_key == "sleeve_choice" then
sleeve_idx = idx
break
end
end
end
if sleeve_idx then
self.page = sleeve_idx + 1
else
self.page = #SMODS.RunSelect.Internals.pages + 1
end
SMODS.RunSelectPage.inject(self)
end,
card_hover = function(self, card)
local page = SMODS.RunSelect and SMODS.RunSelect.Pages and (SMODS.RunSelect.Pages.casl_sleeve_choice or SMODS.RunSelect.Pages.sleeve_choice)
if page and page.card_hover then
return page:card_hover(card)
end
end,
generate_pool = function(self)
local pool = {}
if G.P_CENTER_POOLS and G.P_CENTER_POOLS.Sleeve then
for _, c in ipairs(G.P_CENTER_POOLS.Sleeve) do
if c.key ~= "sleeve_cry_antimatter_sleeve" and Cryptid.antimatter_sleeve_compat(c.key) then
pool[#pool + 1] = c
end
end
end
return pool
end,
set_default = function(self, choice)
local selected = {}
if choice and type(choice) == "table" then
for k, v in pairs(choice) do
if Cryptid.antimatter_sleeve_compat(k) then
selected[k] = (v == true)
end
end
else
if G.P_CENTER_POOLS and G.P_CENTER_POOLS.Sleeve then
for _, c in ipairs(G.P_CENTER_POOLS.Sleeve) do
if Cryptid.antimatter_sleeve_compat(c.key) then
selected[c.key] = true
end
end
end
end
return selected
end,
quick_start_text = function()
local slv = G.PROFILES[G.SETTINGS.profile].last_choices.casl_sleeve_choice
or G.PROFILES[G.SETTINGS.profile].last_choices.sleeve_choice
if slv == "sleeve_cry_antimatter_sleeve" then
local curr = G.PROFILES[G.SETTINGS.profile].last_choices.cry_antimatter_sleeve
local sleeve_total = 0
for k in pairs(curr or {}) do
if Cryptid.antimatter_sleeve_compat(k) then
sleeve_total = sleeve_total + 1
else
curr[k] = nil
end
end
end
end,
create_selection_card = function(self, card_key, card_number, area)
local page = SMODS.RunSelect and SMODS.RunSelect.Pages and (SMODS.RunSelect.Pages.casl_sleeve_choice or SMODS.RunSelect.Pages.sleeve_choice)
if page and page.create_selection_card then
local card = page:create_selection_card(card_key, card_number, area)
card.cry_antimatter_sleeve_card = true
if not Cryptid.antimatter_sleeve_compat(card_key) then
card.cry_antimatter_sleeve_locked = true
end
return card
end
end,
handle_choice = function(self, choice, remove)
SMODS.RunSelect.Setup.choices[self.key] = SMODS.RunSelect.Setup.choices[self.key] or {}
local choices = SMODS.RunSelect.Setup.choices[self.key]
local s_key = choice.config.center.key
if Cryptid.antimatter_sleeve_compat(s_key) then
choices[s_key] = not choices[s_key]
end
end,
start_run = function(self, choice)
G.GAME.cry_antimatter_sleeves = SMODS.shallow_copy(choice or {})
end,
optional = function(self)
local s_choice = Cryptid.safe_get(SMODS.RunSelect, "Setup", "choices", "casl_sleeve_choice")
or Cryptid.safe_get(SMODS.RunSelect, "Setup", "choices", "sleeve_choice")
or (G.GAME and G.GAME.selected_sleeve)
or Cryptid.safe_get(G.PROFILES, G.SETTINGS.profile, "last_choices", "casl_sleeve_choice")
return s_choice == "sleeve_cry_antimatter_sleeve" or s_choice == "cry_antimatter_sleeve"
end,
})



2 changes: 1 addition & 1 deletion lib/overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function get_new_boss()
return v
end
--This is how nostalgic deck replaces the boss blinds with Nostalgic versions
if G.GAME.modifiers.cry_beta then
if G.GAME.modifiers.cry_beta or G.GAME.modifiers.cry_antimatter_beta then
local bl_key = string.sub(bl, 4)
local nostalgicblinds = {
arm = (Cryptid.enabled("bl_cry_oldarm") == true),
Expand Down
48 changes: 46 additions & 2 deletions lib/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,40 @@ SMODS.DrawStep({
end,
conditions = { vortex = false, facing = "back" },
})

-- Sleeve Edition / Shaders
SMODS.DrawStep({
key = "sleeve_edition",
order = 6,
func = function(self)
if self.children.back and not self.cry_antimatter_sleeve_locked then
local s_center = self.config.center
local s_key = s_center and s_center.key or self.config.center_key
if s_key == "sleeve_cry_antimatter_sleeve" or s_key == "cry_antimatter_sleeve" then
self.children.back:draw_shader("negative", nil, self.ARGS.send_to_shader, true)
self.children.back:draw_shader("negative_shine", nil, self.ARGS.send_to_shader, true)
end
end
end,
conditions = { vortex = false, facing = "back" },
})

if CardSleeves then
local old_CardArea_draw = CardArea.draw
function CardArea:draw(...)
old_CardArea_draw(self, ...)
if
self == G.deck
and self.states.visible
and (G.GAME.selected_sleeve == "sleeve_cry_antimatter_sleeve" or G.GAME.selected_sleeve == "cry_antimatter_sleeve")
and self.sleeve_sprite
then
self.sleeve_sprite:draw_shader("negative", nil, nil, true)
self.sleeve_sprite:draw_shader("negative_shine", nil, nil, true)
end
end
end

-- Third Layer
SMODS.DrawStep({
key = "floating_sprite2",
Expand Down Expand Up @@ -268,12 +302,22 @@ SMODS.DrawStep({
card.children.center:draw_shader("debuff", nil, card.ARGS.send_to_shader)
end
if
Cryptid.safe_get(card, "params", "run_select_selection_choice", 2) == "cry_antimatter"
and not SMODS.RunSelect.Setup.choices.cry_antimatter[card.config.center_key]
(Cryptid.safe_get(card, "params", "run_select_selection_choice", 2) == "cry_antimatter" or Cryptid.safe_get(card, "params", "run_select_selection_choice", 2) == "antimatter")
and SMODS.RunSelect.Setup.choices.antimatter
and not SMODS.RunSelect.Setup.choices.antimatter[card.config.center_key]
and not card.cry_antimatter_locked
then
card.children.back:draw_shader("debuff", nil, card.ARGS.send_to_shader, true)
end
if
(Cryptid.safe_get(card, "params", "run_select_selection_choice", 2) == "cry_antimatter_sleeve" or Cryptid.safe_get(card, "params", "run_select_selection_choice", 2) == "antimatter_sleeve")
and card.params.sleeve_card
and SMODS.RunSelect.Setup.choices.cry_antimatter_sleeve
and not SMODS.RunSelect.Setup.choices.cry_antimatter_sleeve[card.config.center_key]
and not card.cry_antimatter_sleeve_locked
then
card.children.back:draw_shader("debuff", nil, card.ARGS.send_to_shader, true)
end
end,
})

Expand Down
16 changes: 7 additions & 9 deletions localization/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3424,21 +3424,19 @@ return {
sleeve_cry_antimatter_sleeve = {
name = "Antimaterie-Hülle",
text = {
"Übernimmt die {C:attention}Effekte{}",
"und {C:attention}Spezialeffekte{}",
"aller Deckhüllen",
"{C:red}WIP",
"Hat die {C:legendary,E:1}positiven Effekte{}",
"von jedem {C:attention}Effekt{} und {C:attention}Spezialeffekt{}",
"aller {C:attention}ausgewählten Hüllen{}",
},
},
sleeve_cry_antimatter_sleeve_balanced = {
name = "Antimaterie-Hülle",
text = {
"Übernimmt die {C:attention}Effekte{}",
"und {C:attention}Spezialeffekt{}",
"{C:attention}aller{} Deckhüllen",
"auf denen ein Durchlauf auf",
"Hat die {C:legendary,E:1}positiven Effekte{} der {C:attention}Effekte{}",
"aller {C:attention}ausgewählten Hüllen{}, die auf",
"{C:gold}Goldener Einsatz{} gewonnen wurden, und {C:attention}Spezialeffekte{}",
"für jedes entsprechende {C:attention}Deck{}, das auf",
"{C:gold}Goldener Einsatz{} gewonnen wurde",
"{C:red}WIP",
},
},
},
Expand Down
17 changes: 9 additions & 8 deletions localization/en-us.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3573,19 +3573,19 @@ return {
sleeve_cry_antimatter_sleeve = {
name = "Antimatter Sleeve",
text = {
"applies the {C:attention}effects{}",
"and {C:attention}special effects{}",
"of all deck sleeves",
"{C:red}WIP",
"Applies the {C:legendary,E:1}upsides{}",
"of every {C:attention}effect{} and {C:attention}special effect{}",
"of {C:attention}all selected sleeves{}",
},
},
sleeve_cry_antimatter_sleeve_balanced = {
name = "Antimatter Sleeve",
text = {
"applies the {C:attention}effects{}",
"and {C:attention}special effects{}",
"of {C:attention}every{} sleeve won",
"with {C:gold}Gold Stake{}",
"Applies the {C:legendary,E:1}upsides{} of the {C:attention}effects{}",
"of {C:attention}all selected sleeves{} won",
"with {C:gold}Gold Stake{}, and {C:attention}special effects{}",
"for every corresponding {C:attention}deck{}",
"won with {C:gold}Gold Stake{}",
},
},
},
Expand Down Expand Up @@ -5394,6 +5394,7 @@ return {
run_select_cry_edeck_sl = "Select Seal",
run_select_cry_edeck_sl_random = "Random Seal",
run_select_cry_antimatter = "Antimatter Decks",
run_select_cry_antimatter_sleeve = "Antimatter Sleeves",
},
labels = {
food_jokers = "Food Jokers",
Expand Down
20 changes: 19 additions & 1 deletion localization/es_419.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2290,14 +2290,32 @@ return {
},
},
sleeve_cry_legendary_sleeve = {
name = "Manga legendaria<",
name = "Manga legendaria",
text = {
"Comienza con un comodín {C:legendary}legendario{C:legendary}",
"{C:green}1 en 5{} probabilidades para crear otro",
"cuando se derrota a la ciega jefe",
"{C:inactive}(debe haber espacio){}",
},
},
sleeve_cry_antimatter_sleeve = {
name = "Manga de antimateria",
text = {
"Aplica las {C:legendary,E:1}ventajas{}",
"de cada {C:attention}efecto{} y {C:attention}efecto especial{}",
"de {C:attention}todas las mangas seleccionadas{}",
},
},
sleeve_cry_antimatter_sleeve_balanced = {
name = "Manga de antimateria",
text = {
"Aplica las {C:legendary,E:1}ventajas{} de los {C:attention}efectos{}",
"de {C:attention}todas las mangas seleccionadas{} ganadas",
"con {C:gold}Pozo de oro{}, y {C:attention}efectos especiales{}",
"para cada {C:attention}baraja{} correspondiente",
"ganada con {C:gold}Pozo de oro{}",
},
},
},
Spectral = {
c_cry_adversary = {
Expand Down
19 changes: 14 additions & 5 deletions localization/es_ES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3060,12 +3060,21 @@ return {
},
},
sleeve_cry_antimatter_sleeve = {
name = "Funda de Antimateria",
name = "Funda de antimateria",
text = {
"Aplica los {C:attention}efectos{}",
"y {C:attention}efectos especiales{}",
"de {C:attention}todas{} las fundas",
"{C:red}WIP",
"Aplica las {C:legendary,E:1}ventajas{}",
"de cada {C:attention}efecto{} y {C:attention}efecto especial{}",
"de {C:attention}todas las fundas seleccionadas{}",
},
},
sleeve_cry_antimatter_sleeve_balanced = {
name = "Funda de antimateria",
text = {
"Aplica las {C:legendary,E:1}ventajas{} de los {C:attention}efectos{}",
"de {C:attention}todas las fundas seleccionadas{} completadas",
"en la dificultad {C:gold}Pozo de oro{}, y {C:attention}efectos especiales{}",
"para cada {C:attention}baraja{} correspondiente",
"completada en la dificultad {C:gold}Pozo de oro{}",
},
},
},
Expand Down
17 changes: 8 additions & 9 deletions localization/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3475,20 +3475,19 @@ return {
sleeve_cry_antimatter_sleeve = {
name = "Pochette d'Antimatière",
text = {
"Applique les {C:attention}effets{}",
"et autres {C:attention}effets spéciaux{}",
"de toutes les autres pochettes",
"{C:red}WIP",
"Applique les {C:legendary,E:1}avantages{}",
"de chaque {C:attention}effet{} et {C:attention}effet spécial{}",
"de {C:attention}toutes les pochettes sélectionnées{}",
},
},
sleeve_cry_antimatter_sleeve_balanced = {
name = "Pochette d'Antimatière",
text = {
"Applique les {C:attention}effets{}",
"et autres {C:attention}effets spéciaux{}",
"de {C:attention}toutes{} les pochettes",
"battues avec la {C:gold}Mise Or{}",
"{C:red}WIP",
"Applique les {C:legendary,E:1}avantages{} des {C:attention}effets{}",
"de {C:attention}toutes les pochettes sélectionnées{} battues",
"avec la {C:gold}Mise Or{}, et les {C:attention}effets spéciaux{}",
"pour chaque {C:attention}jeu{} correspondant",
"battu avec la {C:gold}Mise Or{}",
},
},
},
Expand Down
Loading