diff --git a/config.lua b/config.lua index 3061d48..11eb6d1 100644 --- a/config.lua +++ b/config.lua @@ -1,6 +1,5 @@ return { equinox_assist = false, - fusable_escapey = false, harsh_ante_scaling = true, illusion_seal = true, import_funky = false, diff --git a/localization/en-us.lua b/localization/en-us.lua index d7bf53a..82acfc2 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -150,27 +150,11 @@ return { j_Roland_escapey = { name = "Escapey", text = { - "Use to {C:attention}destroy tags{} or {C:attention}unselected consumables", - "in exchange for {C:planet}leveling up {X:planet,C:white}#1#{C:planet} random hands", - "{C:inactive,s:0.75,E:1}#2#{C:red,s:1.5,E:1}#3#{s:0.9}#4#{C:blue,E:1,s:0.9}#5#{s:0.9}#6#", - }, - merge = {"Since none apply, fuse with other ", " jokers"}, - quotes = { - marble = {"there is no escape..."}, - normal = { - "I can't wait to work with you!", - "Did you need something from me?", - "Oh! I'm just so happy to see you!", - "Can I say something irrelevant? I promise it won't be long.", - "Tell me about your buddies! Assuming you have them, anyway.", - }, - scared = { - "What am I going to do?!", - "I'm not scared, you are!", - "Tell me when this is over...", - "I can't keep looking at this!", - "Let me go hide in this corner... Okay?", - }, + "Use to sell {C:attention}tags", + "for {X:money,C:white}$#1#X{} each", + "{s:0.75}If any {C:attention,s:0.75}consumables", + "{s:0.75}are unselected, sell", + "{s:0.75}those for {C:money,s:0.75}$#2# {s:0.75}instead", }, }, j_Roland_hardboiled = { @@ -409,9 +393,7 @@ return { b_Roland_debuffed = "DEBUFFED", b_Roland_entering_shop = "Entering shop!", b_Roland_escape = "ESCAPE", - b_Roland_fuse = "FUSE", b_Roland_equinox_assist = "Assist: Only hide text (Equinox)", - b_Roland_fusable_escapey = "Fusable Escapey (overpowered)", b_Roland_scribable_basket = "Scribable Basket (overpowered)", b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)", b_Roland_illusion_seal = "Allow seals from Illusion voucher", diff --git a/manifest.json b/manifest.json index e95cb2f..06e89c1 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "author": [ "Emik" ], - "version": "2.2.13", + "version": "2.3.0", "badge_colour": "8BE9FD", "main_file": "src/main.lua", "badge_text_colour": "44475A", diff --git a/src/joker.lua b/src/joker.lua index fed4e46..3938557 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -37,57 +37,11 @@ local function destructible(card) return not card.highlighted and not (card.ability or {}).eternal end ----@param card Card -local function is_carbon(card) - return card.edition and card.edition.key == "e_Bakery_Carbon" -end - ---@param card Card local function is_frozen(card) return card.edition and card.edition.key == "e_Roland_frozen" 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 - 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( - {sound = "button", volume = 0.7, pitch = pitch or 0.8, delay = 0.3}, - {handname = handname, chips = chips, level = level, mult = mult} - ) - end - - if by <= 0 then - return - end - - hand = hand or "NO_HAND_SPECIFIED" - local hand_obj = G.GAME.hands[hand] - - if hand == true then - update(localize "k_all_hands", "...", "...", "") - delay(2) - - 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) - level_up_hand(card, hand, nil, by) - end - - update("", 0, 0, "", 1.1) -end - SMODS.Atlas { key = "joker", path = "joker.png", @@ -103,8 +57,8 @@ SMODS.Sound { joker { key = "escapey", pronouns = "they_them", - config = {extra = {hands = 2}}, - attributes = {"destroy_card", "tarot", "planet", "spectral", "tag"}, + config = {extra = {money = 2, xmoney = 1.5}}, + attributes = {"destroy_card", "economy", "tag"}, cost = 4, rarity = 2, sinis = true, @@ -112,129 +66,59 @@ joker { eternal_compat = true, blueprint_compat = false, perishable_compat = true, - loc_vars = function(self, _, card) - local sinister = (_G["Jen"] or _G["pwx"] or {}).sinister or G.escapey_sinister - local loc = G.localization.descriptions.Joker.j_Roland_escapey - local merge = self.fusable(card) and loc.merge or {} - local quotes = loc.quotes - - local normal = (merge[1] or sinister) and "" or - pseudorandom_element(quotes.normal, pseudoseed "EscapeyQuotes") or "" - - local scared = (merge[1] or not sinister) and "" or - pseudorandom_element(quotes.scared, pseudoseed "EscapeyQuotes") or "" - - return { - vars = { - card.ability.extra.hands, - normal, - scared, - merge[1] or "", - merge[1] and loc.name or "", - merge[2] or "", - }, - } + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.xmoney, card.ability.extra.money}} end, - calculate = function(self, card, context) - return context.forcetrigger and self.proc(card) or nil + Bakery_can_use = function(_, card) + return not card.debuff and u() and (next(G.GAME.tags) or f(G.consumeables.cards):any(destructible)) end, - 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(self, card) - return localize { - type = "variable", - key = card.debuff and "b_Roland_debuffed" or - ((not self.exchangable() and self.fusable(card)) and - "b_Roland_fuse" or "b_Roland_escape"), - } + Bakery_use_button_text = function(_, card) + return localize {type = "variable", key = card.debuff and "b_Roland_debuffed" or "b_Roland_escape"} end, Bakery_use_joker = function(self, card) if card.debuff then return end - if not self.exchangable() then - local level_sum, sell_sum = 0, 0 - local any_carbon = is_carbon(card) - - f(G.jokers.cards):where(is_mergeable_with(card)):each(function(v) - any_carbon = any_carbon or is_carbon(v) - level_sum = level_sum + v.ability.extra.hands * (v.getEvalQty and v:getEvalQty() or 1) - sell_sum = sell_sum + v.sell_cost * (v.getEvalQty and v:getEvalQty() or 1) - v:start_dissolve({HEX "57ecabff"}, nil, 1.6) - end) - - if not any_carbon then - card.ability.extra.hands = card.ability.extra.hands + level_sum - end - - card.sell_cost = card.sell_cost + sell_sum - return - end - - local function fast_delete(tag) - return function() - attention_text { - scale = 0.7, - align = "cm", - text = "ESC", - 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) - tag.HUD_tag.states.visible = false - tag:remove() - end - end - - local destroyed = 0 + local times, xtimes = 0, 0 + local extra = card.ability.extra f(G.consumeables.cards):where(destructible):each(function(v) v:start_dissolve({HEX "57ecabff"}, nil, 1.6) - destroyed = destroyed + 1 + times = times + 1 end) - if destroyed == 0 then + if times == 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" + local trigger = delay == 0 and "immediate" or "before" f(G.GAME.tags):each(function(v) q { - trigger = trigger, - blocking = #G.GAME.tags < 30, + blocking = delay ~= 0, delay = delay, - func = fast_delete(v), + trigger = trigger, + func = function() + attention_text { + scale = 0.7, + align = "cm", + text = "ESC", + cover = v.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() + end, } - destroyed = destroyed + 1 + xtimes = xtimes + 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 or {}).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() - local levels = card.ability.extra.hands * (times or 1) - 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) + ease_dollars(math.ceil(times * extra.money + G.GAME.dollars * (math.pow(extra.xmoney, xtimes) - 1))) end, tag_threshold = 30, } diff --git a/src/main.lua b/src/main.lua index d425258..4302b25 100644 --- a/src/main.lua +++ b/src/main.lua @@ -60,7 +60,6 @@ function SMODS.current_mod.config_tab() toggle "no_wild_debuff", toggle "no_highlight_limit", _G["Talisman"] and toggle "harsh_ante_scaling", - toggle "fusable_escapey", G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket", toggle "equinox_assist", SMODS.Mods.DebugPlus and toggle "import_funky",