diff --git a/config.lua b/config.lua index e28dc79..a564759 100644 --- a/config.lua +++ b/config.lua @@ -1 +1,7 @@ -return {escapey_debugger = false, equinox_assist = false} +return { + equinox_assist = false, + harsh_ante_scaling = true, + illusion_seal = true, + no_highlight_limit = true, + no_wild_debuff = true, +} diff --git a/localization/en-us.lua b/localization/en-us.lua index 7627281..4a0a2a9 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -13,8 +13,8 @@ return { name = "Pass GO Deck", text = { "Start with a {C:attention}Credit Card", - "Set money to {C:money}$0", - "when entering the shop", + "Set money to {C:money}$0 {}when", + "entering the shop", }, }, b_Roland_swapper = { @@ -28,7 +28,11 @@ return { BakeryCharm = { BakeryCharm_Roland_cocacola = { name = "coca cola phone", - text = {"Values on consumables", "increase by {C:attention}1"}, + text = { + "Values on consumables", + "increase by {C:attention}1", + "{C:inactive}(excluding {C:planet}Planets{C:inactive})", + }, }, BakeryCharm_Roland_fat = { name = "fat i phone", @@ -290,8 +294,8 @@ return { name = "Pass GO Sleeve", text = { "Start with a {C:attention}Credit Card", - "Set money to {C:money}$0", - "when entering the shop", + "Set money to {C:money}$0 {}when", + "entering the shop", }, }, sleeve_Roland_go_alt = { @@ -370,9 +374,13 @@ return { b_Roland_entering_shop = "Entering shop!", b_Roland_escape = "ESCAPE", b_Roland_fuse = "FUSE", - b_Roland_debug_export = "Debug: Import funky.lua to _G", - b_Roland_equinox_assist = "Assist: Only hide text during Equinox", + b_Roland_debug_export = "Import funky.lua", + b_Roland_equinox_assist = "Assist: Only hide text (Equinox)", + b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)", + b_Roland_illusion_seal = "Allow seals from Illusion voucher", b_Roland_most_common_card = "(Rank)", + b_Roland_no_highlight_limit = "No consumable highlight limit", + b_Roland_no_wild_debuff = "No wild card debuffs", b_Roland_na = "N/A", b_Roland_of = " of ", }, diff --git a/src/lib/shared.lua b/src/lib/shared.lua index dde7ece..db76a92 100644 --- a/src/lib/shared.lua +++ b/src/lib/shared.lua @@ -23,8 +23,11 @@ local function protect_ev(fun) return fun end --- This exists to remove the @deprecated warning. if false then + -- This allows for better type inference. + SMODS.Mods.Roland.config = require "config" + + -- This exists to remove the @deprecated warning. ---Returns the elements from the given `list`. This function is equivalent to ---```lua --- return list[i], list[i+1], ยทยทยท, list[j] diff --git a/src/main.lua b/src/main.lua index 682250c..78a5a9e 100644 --- a/src/main.lua +++ b/src/main.lua @@ -1,16 +1,17 @@ local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared" +local f, q = unpack(qol) -qol[1] {"challenge", "spectral", "tweaks", "blind", "charm", "joker", "back", "seal"}:each(function(v) +f {"challenge", "spectral", "tweaks", "blind", "charm", "joker", "back", "seal"}:each(function(v) assert(SMODS.load_file("src/" .. v .. ".lua"))(qol) end) if Balatest then - qol[1] {"joker", "blind", "spectral"}:each(function(v) + f {"joker", "blind", "spectral"}:each(function(v) assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol) end) end -qol[2](function() +q(function() ---@type table local contributors = Bakery_API.contributors @@ -27,6 +28,15 @@ qol[2](function() } end, true) +local function toggle(id) + return create_toggle { + label = localize {type = "variable", key = "b_Roland_" .. id}, + ref_table = SMODS.Mods.Roland.config, + ref_value = id, + scale = 1.5, + } +end + SMODS.Atlas { px = 256, py = 256, @@ -38,28 +48,33 @@ SMODS.Atlas { function SMODS.current_mod.config_tab() return { n = G.UIT.ROOT, - config = {r = 0.1, minw = 4, minh = 4, align = "tr", padding = 0.2, colour = G.C.BLACK}, - nodes = {{ - n = G.UIT.C, - config = {minw = 1, minh = 1, align = "tr", padding = 0.2, colour = G.C.CLEAR}, - nodes = { - create_toggle { - label = localize {type = "variable", key = "b_Roland_equinox_assist"}, - ref_table = SMODS.Mods.Roland.config, - ref_value = "equinox_assist", - scale = 2, - }, - SMODS.Mods.DebugPlus and UIBox_button { - label = {localize {type = "variable", key = "b_Roland_debug_export"}}, - func = G.P_CENTERS.j_Roland_escapey.debug_export, - button = "Roland_debug_export", - colour = G.C.MULT, - col = true, - scale = 5, - minw = 5, + config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.BLACK}, + nodes = { + { + n = G.UIT.C, + config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.CLEAR}, + nodes = { + toggle "illusion_seal", + toggle "no_wild_debuff", + toggle "no_highlight_limit", + _G["Talisman"] and toggle "harsh_ante_scaling", + toggle "equinox_assist", }, }, - }}, + SMODS.Mods.DebugPlus and { + n = G.UIT.C, + config = {minw = 2, minh = 2, align = "tl", padding = 0.2, colour = G.C.CLEAR}, + nodes = { + UIBox_button { + label = {localize {type = "variable", key = "b_Roland_debug_export"}}, + func = G.P_CENTERS.j_Roland_escapey.debug_export, + button = "Roland_debug_export", + colour = G.C.MULT, + col = true, + scale = 5, + }, + }, + }}, } end diff --git a/src/tweaks.lua b/src/tweaks.lua index 4b1901a..5ab634b 100644 --- a/src/tweaks.lua +++ b/src/tweaks.lua @@ -8,7 +8,7 @@ local orig_copy_card = copy_card ---@diagnostic disable-next-line: duplicate-set-field function CardArea:can_highlight(...) - if self ~= G.consumeables then + if self ~= G.consumeables and not SMODS.Mods.Roland.config.no_highlight_limit then return orig_can_highlight(self, ...) end @@ -19,7 +19,9 @@ end ---@diagnostic disable-next-line: duplicate-set-field function Card:set_debuff(...) - if self.config and self.config.center_key == "m_wild" then + if self.config and + self.config.center_key == "m_wild" and + SMODS.Mods.Roland.config.no_wild_debuff then self.debuff = false else orig_set_debuff(self, ...) @@ -28,6 +30,10 @@ end ---@diagnostic disable-next-line: duplicate-set-field function Card:highlight(is_highlighted, ...) + if not SMODS.Mods.Roland.config.no_highlight_limit then + return orig_highlight(self, is_highlighted, ...) + end + self.highlighted = is_highlighted if not G.CONTROLLER.HID.controller then @@ -88,7 +94,9 @@ q(function() ---@diagnostic disable-next-line: duplicate-set-field function Bakery_API.can_highlight_area(area, ...) - return area == G.consumeables or orig_can_highlight_area(area, ...) + return (area == G.consumeables and + SMODS.Mods.Roland.config.no_highlight_limit) or + orig_can_highlight_area(area, ...) end end) @@ -99,6 +107,10 @@ function create_card_for_shop(...) ---@type Card local ret = orig_create_card_for_shop(...) + if not SMODS.Mods.Roland.config.illusion_seal then + return ret + end + if not G.GAME.used_vouchers.v_illusion or not ({Default = true, Enhanced = true})[(((ret or {}).config or {}).center or {}).set] or pseudorandom(pseudoseed "Roland_illusion") <= 0.8 then