Completely rework Escapey joker

This commit is contained in:
Emik 2026-05-07 02:00:00 +02:00
parent adcfc47e21
commit c8ad1ac633
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
5 changed files with 38 additions and 174 deletions

View file

@ -1,6 +1,5 @@
return { return {
equinox_assist = false, equinox_assist = false,
fusable_escapey = false,
harsh_ante_scaling = true, harsh_ante_scaling = true,
illusion_seal = true, illusion_seal = true,
import_funky = false, import_funky = false,

View file

@ -150,27 +150,11 @@ return {
j_Roland_escapey = { j_Roland_escapey = {
name = "Escapey", name = "Escapey",
text = { text = {
"Use to {C:attention}destroy tags{} or {C:attention}unselected consumables", "Use to sell {C:attention}tags",
"in exchange for {C:planet}leveling up {X:planet,C:white}#1#{C:planet} random hands", "for {X:money,C:white}$#1#X{} each",
"{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#", "{s:0.75}If any {C:attention,s:0.75}consumables",
}, "{s:0.75}are unselected, sell",
merge = {"Since none apply, fuse with other ", " jokers"}, "{s:0.75}those for {C:money,s:0.75}$#2# {s:0.75}instead",
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?",
},
}, },
}, },
j_Roland_hardboiled = { j_Roland_hardboiled = {
@ -409,9 +393,7 @@ return {
b_Roland_debuffed = "DEBUFFED", b_Roland_debuffed = "DEBUFFED",
b_Roland_entering_shop = "Entering shop!", b_Roland_entering_shop = "Entering shop!",
b_Roland_escape = "ESCAPE", b_Roland_escape = "ESCAPE",
b_Roland_fuse = "FUSE",
b_Roland_equinox_assist = "Assist: Only hide text (Equinox)", 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_scribable_basket = "Scribable Basket (overpowered)",
b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)", b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)",
b_Roland_illusion_seal = "Allow seals from Illusion voucher", b_Roland_illusion_seal = "Allow seals from Illusion voucher",

View file

@ -6,7 +6,7 @@
"author": [ "author": [
"Emik" "Emik"
], ],
"version": "2.2.13", "version": "2.3.0",
"badge_colour": "8BE9FD", "badge_colour": "8BE9FD",
"main_file": "src/main.lua", "main_file": "src/main.lua",
"badge_text_colour": "44475A", "badge_text_colour": "44475A",

View file

@ -37,57 +37,11 @@ local function destructible(card)
return not card.highlighted and not (card.ability or {}).eternal return not card.highlighted and not (card.ability or {}).eternal
end end
---@param card Card
local function is_carbon(card)
return card.edition and card.edition.key == "e_Bakery_Carbon"
end
---@param card Card ---@param card Card
local function is_frozen(card) local function is_frozen(card)
return card.edition and card.edition.key == "e_Roland_frozen" return card.edition and card.edition.key == "e_Roland_frozen"
end 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 { SMODS.Atlas {
key = "joker", key = "joker",
path = "joker.png", path = "joker.png",
@ -103,8 +57,8 @@ SMODS.Sound {
joker { joker {
key = "escapey", key = "escapey",
pronouns = "they_them", pronouns = "they_them",
config = {extra = {hands = 2}}, config = {extra = {money = 2, xmoney = 1.5}},
attributes = {"destroy_card", "tarot", "planet", "spectral", "tag"}, attributes = {"destroy_card", "economy", "tag"},
cost = 4, cost = 4,
rarity = 2, rarity = 2,
sinis = true, sinis = true,
@ -112,129 +66,59 @@ joker {
eternal_compat = true, eternal_compat = true,
blueprint_compat = false, blueprint_compat = false,
perishable_compat = true, perishable_compat = true,
loc_vars = function(self, _, card) loc_vars = function(_, _, card)
local sinister = (_G["Jen"] or _G["pwx"] or {}).sinister or G.escapey_sinister return {vars = {card.ability.extra.xmoney, card.ability.extra.money}}
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 "",
},
}
end, end,
calculate = function(self, card, context) Bakery_can_use = function(_, card)
return context.forcetrigger and self.proc(card) or nil return not card.debuff and u() and (next(G.GAME.tags) or f(G.consumeables.cards):any(destructible))
end, end,
Bakery_can_use = function(self, card) Bakery_use_button_text = function(_, card)
return not card.debuff and u() and (self.exchangable() or self.fusable(card)) return localize {type = "variable", key = card.debuff and "b_Roland_debuffed" or "b_Roland_escape"}
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"),
}
end, end,
Bakery_use_joker = function(self, card) Bakery_use_joker = function(self, card)
if card.debuff then if card.debuff then
return return
end end
if not self.exchangable() then local times, xtimes = 0, 0
local level_sum, sell_sum = 0, 0 local extra = card.ability.extra
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
f(G.consumeables.cards):where(destructible):each(function(v) f(G.consumeables.cards):where(destructible):each(function(v)
v:start_dissolve({HEX "57ecabff"}, nil, 1.6) v:start_dissolve({HEX "57ecabff"}, nil, 1.6)
destroyed = destroyed + 1 times = times + 1
end) 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 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) f(G.GAME.tags):each(function(v)
q { q {
trigger = trigger, blocking = delay ~= 0,
blocking = #G.GAME.tags < 30,
delay = delay, 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)
end end
self.proc(card, destroyed) ease_dollars(math.ceil(times * extra.money + G.GAME.dollars * (math.pow(extra.xmoney, xtimes) - 1)))
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)
end, end,
tag_threshold = 30, tag_threshold = 30,
} }

View file

@ -60,7 +60,6 @@ function SMODS.current_mod.config_tab()
toggle "no_wild_debuff", toggle "no_wild_debuff",
toggle "no_highlight_limit", toggle "no_highlight_limit",
_G["Talisman"] and toggle "harsh_ante_scaling", _G["Talisman"] and toggle "harsh_ante_scaling",
toggle "fusable_escapey",
G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket", G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket",
toggle "equinox_assist", toggle "equinox_assist",
SMODS.Mods.DebugPlus and toggle "import_funky", SMODS.Mods.DebugPlus and toggle "import_funky",