diff --git a/assets/1x/default/j_jane_escapey.png b/assets/1x/default/j_jane_escapey.png new file mode 100644 index 0000000..0d18ab2 Binary files /dev/null and b/assets/1x/default/j_jane_escapey.png differ diff --git a/assets/2x/default/j_jane_escapey.png b/assets/2x/default/j_jane_escapey.png new file mode 100644 index 0000000..afc0352 Binary files /dev/null and b/assets/2x/default/j_jane_escapey.png differ diff --git a/manifest.json b/manifest.json index 4ed2bfb..ff2ce74 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.5.38" + "version": "1.6.0" } \ No newline at end of file diff --git a/src/challenge.lua b/src/challenge.lua index 1ad4dd3..78181b2 100644 --- a/src/challenge.lua +++ b/src/challenge.lua @@ -28,7 +28,7 @@ SMODS.Challenge { {id = "jane_downpour4"}, }}, apply = function(_) - G.GAME.win_ante = 16 + G.GAME.win_ante = 10 for _, v in ipairs(rain_world_jokers) do Jane.q(function() @@ -83,4 +83,4 @@ G.localization.misc.v_text.ch_c_jane_downpour3 = {"{C:attention}Boss Blind {}is defeated, or {C:red}lose"} G.localization.misc.v_text.ch_c_jane_downpour4 = -{"Win on {C:attention}Ante 16"} +{"Win on {C:attention}Ante 10"} diff --git a/src/joker.lua b/src/joker.lua index 714ed13..5f0ba99 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -1,4 +1,4 @@ -for _, v in pairs({"7granddad", "betmma", "honey", "oxy", "maxie", "peppino"}) do +for _, v in pairs({"7granddad", "betmma", "escapey", "honey", "oxy", "maxie", Cryptid and "peppino" or nil}) do SMODS.Atlas { px = 71, py = 95, @@ -48,6 +48,10 @@ local granddad_palette = { HEX("6c0700"), } +local function destructible(card) + return not card.highlighted and not (card.ability or {}).eternal +end + local function food_jokers_count() if not G.jokers or not next(G.jokers.cards) then return 0 @@ -116,6 +120,98 @@ local function voucher_count() return count end +SMODS.Joker { + key = "escapey", + atlas = "janeescapey", + pronouns = "they_them", + loc_txt = { + name = "Escapey", + text = { + "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", + }, + }, + config = {extra = {money = 2, xmoney = 1.5}}, + attributes = {"destroy_card", "economy", "tag"}, + pos = {x = 0, y = 0}, + sinis = {x = 2, y = 0}, + soul_pos = {x = 1, y = 0}, + cost = 4, + rarity = 2, + eternal_compat = true, + blueprint_compat = false, + perishable_compat = true, + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.xmoney, card.ability.extra.money}} + end, + Bakery_can_use = function(_, card) + if not Jane.can_use() or card.debuff or G.GAME.used_vouchers.v_jane_token_voucher then + return false + end + + if next(G.GAME.tags) then + return true + end + + for _, v in ipairs(G.consumeables.cards) do + if destructible(v) then + return true + end + end + + return false + end, + Bakery_use_button_text = function(_, card) + return (card.debuff or G.GAME.used_vouchers.v_jane_token_voucher) and "DEBUFFED" or "ESCAPE" + end, + Bakery_use_joker = function(self, card) + if card.debuff then + return + end + + local times, xtimes = 0, 0 + local extra = card.ability.extra + + for _, v in ipairs(G.consumeables.cards) do + if destructible(v) then + v:start_dissolve({HEX "57ecabff"}, nil, 1.6) + times = times + 1 + end + end + + if times == 0 then + local delay = #G.GAME.tags >= self.tag_threshold and 0 or 1 / #G.GAME.tags + local trigger = delay == 0 and "immediate" or "before" + + for _, v in ipairs(G.GAME.tags) do + Jane.q(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, delay, nil, trigger, nil, delay ~= 0) + + xtimes = xtimes + 1 + end + end + + ease_dollars(math.ceil(times * extra.money + G.GAME.dollars * (math.pow(extra.xmoney, xtimes) - 1))) + end, + tag_threshold = 30, +} + local maxie_quotes = { normal = { "Hey! I hope we can become great friends together!", @@ -608,6 +704,10 @@ SMODS.Joker { end, } +if not Cryptid then + return +end + SMODS.Joker { key = "peppino", atlas = "janepeppino", diff --git a/src/main.lua b/src/main.lua index fad6300..3652fc1 100644 --- a/src/main.lua +++ b/src/main.lua @@ -206,6 +206,28 @@ function Jane.q(func, delay, timer, trigger, blockable, blocking) })) end +local orig_can_highlight = CardArea.can_highlight + +function CardArea:can_highlight(...) + if self ~= G.consumeables then + return orig_can_highlight(self, ...) + end + + --- Allows more flexibility when using the Escapey joker to delete specific consumables. + self.config.highlighted_limit = 1 / 0 + return true +end + +local orig_highlight = Card.highlight + +function Card:highlight(is_highlighted, ...) + self.highlighted = is_highlighted + + if not G.CONTROLLER.HID.controller then + return orig_highlight(self, is_highlighted, ...) + end +end + function Card:gc() return (self.config or {}).center or {} end diff --git a/src/voucher.lua b/src/voucher.lua index 0b08e31..35ef401 100644 --- a/src/voucher.lua +++ b/src/voucher.lua @@ -35,12 +35,15 @@ SMODS.Voucher { atlas = "janetokenvoucher", loc_txt = { name = "Token Voucher", - text = {"{C:attention}Tokens {}can appear", "in the shop", SMODS.Mods.Roland and "{C:inactive}(Permanently disables Escapey)"}, + text = {"{C:attention}Tokens {}can appear", "in the shop", "{C:inactive}(Disables Escapey)"}, }, pos = {x = 0, y = 0}, cost = 10, + loc_vars = function(_, info_queue, _) + info_queue[#info_queue + 1] = G.P_CENTERS.j_jane_escapey + return {vars = {}} + end, redeem = function(_, _) G.GAME.jane_tokens_rate = 1.5 - G.GAME.modifiers.Roland_debuff_escapey = true end, }