From a466a8f032de5bf1b538104f08052db048b9b88b Mon Sep 17 00:00:00 2001 From: Emik Date: Thu, 26 Feb 2026 22:07:04 +0100 Subject: [PATCH] Make fusable escapey a setting (false by default, nerf) --- config.lua | 1 + localization/en-us.lua | 1 + manifest.json | 2 +- src/back.lua | 7 ++-- src/joker.lua | 80 ++++++++++++++++++++++-------------------- src/main.lua | 1 + src/tweaks.lua | 18 ++++------ 7 files changed, 54 insertions(+), 56 deletions(-) diff --git a/config.lua b/config.lua index a564759..b37808d 100644 --- a/config.lua +++ b/config.lua @@ -1,5 +1,6 @@ return { equinox_assist = false, + fusable_escapey = false, harsh_ante_scaling = true, illusion_seal = true, no_highlight_limit = true, diff --git a/localization/en-us.lua b/localization/en-us.lua index 4a0a2a9..d4c7853 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -376,6 +376,7 @@ return { b_Roland_fuse = "FUSE", b_Roland_debug_export = "Import funky.lua", b_Roland_equinox_assist = "Assist: Only hide text (Equinox)", + b_Roland_fusable_escapey = "Fusable Escapey (overpowered)", 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)", diff --git a/manifest.json b/manifest.json index 8fe94e2..9d42386 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "author": [ "Emik" ], - "version": "2.0.4", + "version": "2.0.5", "badge_colour": "8BE9FD", "main_file": "src/main.lua", "badge_text_colour": "44475A", diff --git a/src/back.lua b/src/back.lua index d67ca36..e6fceec 100644 --- a/src/back.lua +++ b/src/back.lua @@ -34,16 +34,15 @@ local back = (function() return false end + local sleeve = (_G["CardSleeves"] or {}).Sleeve SMODS.Back(tbl) x = x + 1 - ---@diagnostic disable-next-line: undefined-global - if not CardSleeves then + if not sleeve then return end - ---@diagnostic disable-next-line: undefined-global - CardSleeves.Sleeve { + sleeve { key = key, pos = tbl.pos, atlas = "back", diff --git a/src/joker.lua b/src/joker.lua index 0a2986d..80e7bac 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -37,10 +37,15 @@ end local function is_mergeable_with(x) return function(y) - return x.rank ~= y.rank and y.label == "j_Roland_escapey" and not (y.ability or {}).eternal + return x.rank ~= y.rank and + y.label == "j_Roland_escapey" and + not (y.ability or {}).eternal end end +---@param hand? string|true +---@param by integer +---@param card Card local function level_up(hand, by, card) local function update(handname, chips, mult, level, pitch) update_hand_text( @@ -56,11 +61,11 @@ local function level_up(hand, by, card) hand = hand or "NO_HAND_SPECIFIED" local hand_obj = G.GAME.hands[hand] - if hand == "all" or hand == "allhands" or hand == "all_hands" then + if hand == true then update(localize "k_all_hands", "...", "...", "") - f(G.GAME.hands):keys():each(function(k) - level_up_hand(card, k, nil, by) + f(G.GAME.hands):where "visible":keys():each(function(k) + level_up_hand(card, k, true, by) end) elseif hand_obj then update(localize(hand, "poker_hands"), hand_obj.chips, hand_obj.mult, hand_obj.level) @@ -89,15 +94,12 @@ joker { blueprint_compat = false, perishable_compat = true, loc_vars = function(_, _, card) - local loc_self = G.localization.descriptions.Joker.j_Roland_escapey + local sinister = (_G["Jen"] or _G["pwx"] or {}).sinister or G.escapey_sinister + local loc = G.localization.descriptions.Joker.j_Roland_escapey + local quotes = loc.quotes - ---@diagnostic disable-next-line: undefined-global - local sinister = (Jen or {}).sinister or G.escapey_sinister - local quotes = loc_self.quotes - - local merge = G.jokers - and f(G.jokers.cards):any(is_mergeable_with(card)) - and loc_self.merge or {} + local merge = (G.jokers and f(G.jokers.cards):any(is_mergeable_with(card))) + and loc.merge or {} local normal = (merge[1] or sinister) and "" or pseudorandom_element(quotes.normal, pseudoseed "EscapeyQuotes") or "" @@ -111,17 +113,13 @@ joker { normal, scared, merge[1] or "", - merge[1] and loc_self.name or "", + merge[1] and loc.name or "", merge[2] or "", }, } end, - Bakery_can_use = function(_, card) - return not card.debuff and u() and ( - #G.GAME.tags ~= 0 or - f(G.consumeables.cards):any(destructible) or - f(G.jokers.cards):any(is_mergeable_with(card)) - ) + Bakery_can_use = function(self, card) + return not card.debuff and u() and (self.exchangable() or self.fusable(card)) end, Bakery_use_button_text = function(_, card) return localize { @@ -143,11 +141,7 @@ joker { return end - local consumables = f(G.consumeables.cards):where(destructible):table() - local consumable_count = #consumables - local tag_count = #G.GAME.tags - - if consumable_count == 0 and tag_count == 0 then + if not self.exchangable() then local level_sum, sell_sum = 0, 0 local any_carbon = is_carbon(card) @@ -166,30 +160,34 @@ joker { return end - local function fast_delete(v) + local function fast_delete(tag) return function() attention_text { scale = 0.7, align = "cm", text = "ESC", - cover = v.HUD_tag, + cover = tag.HUD_tag, colour = G.C.WHITE, cover_colour = G.C.BLACK, hold = 0.3 / G.SETTINGS.GAMESPEED, } play_sound("cancel", 1.66, 0.5) - v.HUD_tag.states.visible = false - v:remove() + tag.HUD_tag.states.visible = false + tag:remove() end end local destroyed = 0 - if consumable_count == 0 then - local threshold = 30 - local delay = #G.GAME.tags >= threshold and 0 or 1 / #G.GAME.tags - local trigger = #G.GAME.tags >= threshold and "immediate" or "before" + f(G.consumeables.cards):where(destructible):each(function(v) + v:start_dissolve({HEX "57ecabff"}, nil, 1.6) + destroyed = destroyed + 1 + end) + + if destroyed == 0 then + local delay = #G.GAME.tags >= self.tag_threshold and 0 or 1 / #G.GAME.tags + local trigger = #G.GAME.tags >= self.tag_threshold and "immediate" or "before" f(G.GAME.tags):each(function(v) q { @@ -199,29 +197,33 @@ joker { func = fast_delete(v), } - destroyed = destroyed + 1 - end) - else - f(consumables):each(function(v) - v:start_dissolve({HEX "57ecabff"}, nil, 1.6) destroyed = destroyed + 1 end) end self.proc(card, destroyed) end, + exchangable = function() + return next(G.GAME.tags) or f(G.consumeables.cards):any(destructible) + end, + ---@param card Card + fusable = function(card) + return SMODS.Mods.Roland.config.fusable_escapey and + f(G.jokers.cards):any(is_mergeable_with(card)) + end, ---@param card Card ---@param times? integer proc = function(card, times) local hands = f(G.GAME.hands):where "visible":keys():table() - pseudoshuffle(hands, pseudoseed "RolandEscapey") local levels = card.ability.extra.hands * (times or 1) - level_up("all", math.floor(levels / #hands), card) + pseudoshuffle(hands, pseudoseed "RolandEscapey") + level_up(true, math.floor(levels / #hands), card) f(hands):take(levels % #hands):each(function(v) level_up(v, 1, card) end) end, + tag_threshold = 30, } joker { diff --git a/src/main.lua b/src/main.lua index 78a5a9e..c22b76f 100644 --- a/src/main.lua +++ b/src/main.lua @@ -58,6 +58,7 @@ function SMODS.current_mod.config_tab() toggle "no_wild_debuff", toggle "no_highlight_limit", _G["Talisman"] and toggle "harsh_ante_scaling", + toggle "fusable_escapey", toggle "equinox_assist", }, }, diff --git a/src/tweaks.lua b/src/tweaks.lua index 5ab634b..0d3c986 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 and not SMODS.Mods.Roland.config.no_highlight_limit then + if self ~= G.consumeables or not SMODS.Mods.Roland.config.no_highlight_limit then return orig_can_highlight(self, ...) end @@ -30,13 +30,9 @@ 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 + if not G.CONTROLLER.HID.controller or not SMODS.Mods.Roland.config.no_highlight_limit then return orig_highlight(self, is_highlighted, ...) end end @@ -83,7 +79,8 @@ function copy_card(other, new_card, ...) if new_card and new_card.edition and new_card.edition.key == "e_negative" then --- Fixes an issue where using 'c_death' will make negative --- cards do the inverse of what they're supposed to do. - new_card.ability.card_limit = math.max(new_card.ability.card_limit, 1) + local ability = new_card.ability + ability.card_limit = math.max(ability.card_limit, 1) end return ret @@ -107,11 +104,8 @@ 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 + if not SMODS.Mods.Roland.config.illusion_seal or + 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 return ret