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
86 changes: 61 additions & 25 deletions Neuratro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,85 @@
-- -fix negatives in G.playbook

-- These 5 lines of code are from the mod aikoyori's playbook made by aikoyori. Check their mods out!
assert(
SMODS.current_mod.lovely,
"Lovely patches were not loaded.\nMake sure your mod folder is not nested (there should be a bunch of files in the mod folder and not just another folder)."
)
if not SMODS.current_mod.lovely then
print("[Neuratro] Warning: Lovely patches were not loaded. Some features may not work correctly.")
end
AKYRS = SMODS.current_mod
AKYRS.emplace_funcs = {}
assert(SMODS.load_file("./modules/hooks/general.lua"))()
assert(SMODS.load_file("./modules/content/cardarea.lua"))()

-- Load utility modules (order matters - constants first, then utilities)
assert(SMODS.load_file("./modules/utils/constants.lua"))()
assert(SMODS.load_file("./modules/utils/joker_utils.lua"))()
assert(SMODS.load_file("./modules/utils/probability.lua"))()
assert(SMODS.load_file("./modules/utils/card_analysis.lua"))()
assert(SMODS.load_file("./modules/utils/random_utils.lua"))()
assert(SMODS.load_file("./modules/utils/config_builder.lua"))()
assert(SMODS.load_file("./modules/utils/joker_patterns.lua"))()
assert(SMODS.load_file("./modules/utils/safety.lua"))()

-- Config defaults
SMODS.current_mod.config = SMODS.current_mod.config or {}
SMODS.current_mod.config.palette = SMODS.current_mod.config.palette or "default"

assert(SMODS.load_file("./modules/utils/palette.lua"))()
--

-- Palette cycle callback
G.FUNCS.Neurocards_set_palette = function(args)
local palette_keys = { "default", "neuro", "evil" }
local key = palette_keys[args.to_key] or "default"
AKYRS.apply_palette(key)
AKYRS.config.palette = key
AKYRS.save_palette_pref(key)
end

-- Config tab shown in Steamodded mod settings
SMODS.current_mod.config_tab = function()
local palette_options = { "Default", "Neuro-sama", "Evil Neuro" }
local palette_keys = { "default", "neuro", "evil" }
local saved = AKYRS.config.palette or "default"
local current = 1
for i, k in ipairs(palette_keys) do
if k == saved then current = i; break end
end
return {
n = G.UIT.ROOT,
config = { align = "cm", padding = 0.2, colour = G.C.CLEAR },
nodes = {
{
n = G.UIT.R,
config = { align = "cm", padding = 0.1 },
nodes = {
{ n = G.UIT.T, config = { text = "Palette ", scale = 0.4, colour = G.C.UI.TEXT_LIGHT } },
create_option_cycle({
options = palette_options,
current_option = current,
opt_callback = "Neurocards_set_palette",
w = 3.5,
scale = 0.8,
colour = AKYRS.palette.primary or G.C.RED,
}),
},
},
},
}
end

function SMODS.INIT.DecColors()
local dec_mod = SMODS.findModByID("Neurocards")
local sprite_deck1 = SMODS.Sprite:new("cards_1", dec_mod.path, "neuroCards.png", 71, 95, "asset_atli")
local sprite_deck2 = SMODS.Sprite:new("cards_2", dec_mod.path, "neuroCards2.png", 71, 95, "asset_atli")
local sprite_logo = SMODS.Sprite:new("balatro", dec_mod.path, "neuratro.png", 333, 216, "asset_atli")
local sprite_enhancers = SMODS.Sprite:new("centers", dec_mod.path, "neuroEnhancers.png", 71, 95, "asset_atli")

sprite_deck1:register()
sprite_deck1:register()
sprite_deck2:register()
sprite_logo:register()
sprite_enhancers:register()
end

--This will be deleted at some point
jokers = {
j_gros_michel = { pos = 0 },
j_joker = { pos = 1 },
}
SMODS.Atlas({
key = "neuroJokers",
path = "neuroJokers.png",
px = 71,
py = 95,
})
for jkr, data in pairs(jokers) do
SMODS["Joker"]:take_ownership(
jkr,
{ atlas = "neuroJokers", pos = { x = 0 + data.pos, y = 0 }, soul_pos = { x = 0 + data.pos, y = 1 } },
true
)
end
--

assert(SMODS.load_file("./content/hooks/hooks.lua"))()
assert(SMODS.load_file("./content/hooks/nothooks.lua"))()

Expand Down
Binary file removed assets/1x/neuroBlinds.png
Binary file not shown.
Binary file removed assets/1x/neuroCustomJokers.png
Binary file not shown.
Binary file removed assets/1x/neuroCustomJokers2.png
Binary file not shown.
Binary file removed assets/1x/neuroCustomTarots.png
Binary file not shown.
Binary file removed assets/2x/neuroBlinds.png
Binary file not shown.
Binary file removed assets/2x/neuroCustomJokers.png
Binary file not shown.
Binary file removed assets/2x/neuroCustomJokers2.png
Binary file not shown.
Binary file removed assets/2x/neuroCustomTarots.png
Binary file not shown.
77 changes: 38 additions & 39 deletions content/hooks/hooks.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
local er_ref = end_round
function end_round()
er_ref()
local hiyori = false
for _, joker in ipairs(G.jokers.cards) do
if joker.config.center.key == "j_hiyori" then
hiyori = true
end
end
for _, joker in ipairs(G.playbook_extra.cards) do
if joker.config.center.key == "j_hiyori" then
hiyori = true
end
end
for _, v in ipairs(G.playing_cards) do
local hiyori = Neuratro.has_joker("j_hiyori")
for _, v in ipairs(G.playing_cards or {}) do
SMODS.debuff_card(v, false, "filter")
if v:is_suit("Hearts") and hiyori then
SMODS.debuff_card(v, true, "filter")
end
end
for _, v in ipairs(G.jokers.cards) do
for _, v in ipairs(G.jokers and G.jokers.cards or {}) do
SMODS.debuff_card(v, false, "filter")
end
for _, v in ipairs(G.playbook_extra.cards) do
for _, v in ipairs(G.playbook_extra and G.playbook_extra.cards or {}) do
SMODS.debuff_card(v, false, "filter")
end
end
Expand All @@ -38,8 +28,8 @@ end

local smcmb = SMODS.create_mod_badges
function SMODS.create_mod_badges(obj, badges)
smcmb(obj, badges)
if obj and obj.credits then
if smcmb then smcmb(obj, badges) end
if obj and obj.credits and badges then
local function calc_scale_fac(text)
local size = 0.9
local font = G.LANG.font
Expand All @@ -62,13 +52,13 @@ function SMODS.create_mod_badges(obj, badges)
if obj.credits[v] then
for i = 1, #obj.credits[v] do
if pos == 1 then
strings[#strings + 1] = "Suggested by: " .. obj.credits.sug[1]
strings[#strings + 1] = "Suggested by: " .. obj.credits.sug[i]
elseif pos == 2 then
strings[#strings + 1] = "Idea: " .. obj.credits.idea[i]
elseif pos == 3 then
strings[#strings + 1] = "Art: " .. obj.credits.art[1]
strings[#strings + 1] = "Art: " .. obj.credits.art[i]
elseif pos == 4 then
strings[#strings + 1] = "Code: " .. obj.credits.code[1]
strings[#strings + 1] = "Code: " .. obj.credits.code[i]
end
end
end
Expand Down Expand Up @@ -150,37 +140,41 @@ function Card:get_chip_bonus()
return g
end

SMODS.Stickers["rental"].should_apply = function(self, card, center, area, bypass_roll)
if
G.GAME.stake ~= 8
or pseudorandom("rentalapply") <= 0.7
or card.ability.set ~= "Joker"
or card.config.center.rarity == "dev"
or card.config.center.rarity == 4
then
return false

if SMODS.Stickers and SMODS.Stickers["rental"] then
SMODS.Stickers["rental"].should_apply = function(self, card, center, area, bypass_roll)
if
G.GAME.stake ~= 8
or pseudorandom("rentalapply") <= 0.7
or card.ability.set ~= "Joker"
or card.config.center.rarity == "dev"
or card.config.center.rarity == 4
then
return false
end
return true
end
return true
end

local Game_update = Game.update
local prev_money = 0
MONEY_EARNED = 0
Neuratro = Neuratro or {}
Neuratro.MONEY_EARNED = 0
function Game:update(dt)
Game_update(self, dt)

if self.GAME and self.GAME.dollars then
local money = self.GAME.dollars
if money > prev_money then
MONEY_EARNED = MONEY_EARNED + money - prev_money
Neuratro.MONEY_EARNED = Neuratro.MONEY_EARNED + money - prev_money
end
prev_money = money
end
end

local start_run = G.FUNCS.start_run
function G.FUNCS.start_run(e, args)
MONEY_EARNED = 0
Neuratro.MONEY_EARNED = 0
prev_money = 0
start_run(e, args)
end
Expand All @@ -195,12 +189,17 @@ function Game:draw(args)
local x = { drawg(self, args) }
if G.SHADERS["CRT"] and not originalshader then
originalshader = G.SHADERS["CRT"]
else
if false then
G.SHADERS["CRT"] = G.SHADERS["arg"]
else
G.SHADERS["CRT"] = originalshader
end
elseif originalshader and not G.SHADERS["CRT"] then
G.SHADERS["CRT"] = originalshader
end
return unpack(x)
end

local op_ref = open_booster
function open_booster(self, booster, edition, skin, skip_anims)
local chimps = Neuratro.has_joker("j_chimps")
if chimps and booster and booster.ability and booster.ability.name:find("Arcana") and booster.config and booster.config.extra then
booster.config.extra = booster.config.extra + 1
end
return x
return op_ref(self, booster, edition, skin, skip_anims)
end
8 changes: 7 additions & 1 deletion content/hooks/nothooks.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
-- Sorry for misleading file name, i didn't know where to put this.

sea = function(func, delay, trigger, queue)
Neuratro = Neuratro or {}

Neuratro.sea = function(func, delay, trigger, queue)
if not (G and G.E_MANAGER) then
return false
end
G.E_MANAGER:add_event(
Event({
trigger = trigger or "after",
Expand All @@ -9,6 +14,7 @@ sea = function(func, delay, trigger, queue)
}),
queue
)
return true
end

SMODS.current_mod.optional_features = function()
Expand Down
24 changes: 24 additions & 0 deletions content/load/atlas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ SMODS.Atlas({
px = 34,
py = 34,
})
SMODS.Atlas({
key = "animeschizo",
path = "animation/AnimeSchizo.png",
atlas_table = "ANIMATION_ATLAS",
frames = 12,
px = 71,
py = 95,
})
SMODS.Atlas({
key = "animebao",
path = "animation/AnimeBao.png",
atlas_table = "ANIMATION_ATLAS",
frames = 6,
px = 71,
py = 95,
})
SMODS.Atlas({
key = "animeplasma",
path = "animation/AnimePlasma.png",
atlas_table = "ANIMATION_ATLAS",
frames = 6,
px = 71,
py = 95,
})
SMODS.Atlas({
key = "ARG_cards",
px = 71,
Expand Down
Loading