diff --git a/manifest.json b/manifest.json index c3e5362..9d0d527 100644 --- a/manifest.json +++ b/manifest.json @@ -16,5 +16,5 @@ "Bakery (>=3.0.0~*)" ], "conflicts": [], - "version": "1.12.5" + "version": "1.12.6" } \ No newline at end of file diff --git a/src/back.lua b/src/back.lua index 0588732..5ffb665 100644 --- a/src/back.lua +++ b/src/back.lua @@ -157,7 +157,7 @@ local rain_world_jokers = { "j_jane_saint", } -local function add_rain_world_joker() +function Jane.add_rain_world_joker() if not G.jokers then return end @@ -200,14 +200,14 @@ back { }, }, alt_apply = function(_) - Jane.q(add_rain_world_joker) + Jane.q(Jane.add_rain_world_joker) end, apply = function(_) - Jane.q(add_rain_world_joker) + Jane.q(Jane.add_rain_world_joker) end, alt_calculate = function(_, _, context) if Jane.is_end_of_ante(context) then - add_rain_world_joker() + Jane.add_rain_world_joker() end end, } @@ -265,12 +265,12 @@ local function redeem_omen_globe() end) end -local function increase_rates() +function Jane.increase_rates() for _, v in ipairs(SMODS.ConsumableType.obj_buffer) do local key = v:lower() .. "_rate" local n = G.GAME[key] - if type(n) == "number" then + if v ~= "jane_omegaconsumable" and type(n) == "number" then G.GAME[key] = math.max(n, 1) end end @@ -305,13 +305,13 @@ back { alt_apply = function(_) G.GAME.alt_obsidian = true G.GAME.obsidian = true + Jane.increase_rates() redeem_omen_globe() - increase_rates() end, apply = function(_) G.GAME.obsidian = true + Jane.increase_rates() redeem_omen_globe() - increase_rates() end, } @@ -346,7 +346,7 @@ function get_current_pool(_type, ...) return pool, pool_key end -local function apply_orrery() +function Jane.apply_orrery() Jane.q(function() local orrery = {} G.GAME.orrery = orrery @@ -361,7 +361,7 @@ local function apply_orrery() end) end -local function rebalance_orrery() +function Jane.rebalance_orrery() local function small(x) return type(x) == "table" and x:to_number() or x end @@ -454,12 +454,12 @@ back { }, }, alt_apply = function(_) - apply_orrery() + Jane.apply_orrery() end, apply = function(_) - apply_orrery() + Jane.apply_orrery() end, - calculate = rebalance_orrery, + calculate = Jane.rebalance_orrery, alt_calculate = function(_, _, context) local function small(x) return type(x) == "table" and x:to_number() or x @@ -493,7 +493,7 @@ back { ease_discard(new_discards, true) end - rebalance_orrery() + Jane.rebalance_orrery() end, } @@ -663,6 +663,35 @@ back { end, } +function Jane.display_omega_odds() + if not ((G.GAME or {}).modifiers or {}).omega_replacement then + return + end + + local handy_speed = ((Handy or {}).speed_multiplier or {}).value or 1 + play_sound("jane_pop", 0.75, 1) + play_sound("jane_pop") + + Jane.card_status_text( + nil, + "Omega Cards are now a 1 in " .. number_format(1 / G.GAME.modifiers.omega_replacement), + 0, + 0.0001, + G.C.jane_RGB, + 1.5, + nil, + nil, + nil, + "cm", + "jane_pop", + 1, + 1.5, + nil, + nil, + G.SETTINGS.GAMESPEED * handy_speed * 3 + ) +end + local banned_keys = { sleeve_Seen_Seen = true, sleeve_jane_omega = true, @@ -675,8 +704,8 @@ back { loc_txt = { name = "Omega Deck", text = { - "Applies the {C:legendary,E:1}upsides", - "of {C:attention}every Jane deck", + "{C:jane_RGB}Omega {}cards may appear", + "Odds increase per {C:attention}ante", }, }, alt_loc_txt = { @@ -703,22 +732,8 @@ back { end end, apply = function(_) - apply_orrery() - increase_rates() - G.GAME.modifiers.jane_spacious = true - G.GAME.used_vouchers.v_omen_globe = true - G.GAME.modifiers.jane_spacious_omega = true - G.GAME.starting_voucher_count = (G.GAME.starting_voucher_count or 0) + 1 - - Jane.q(function() - add_rain_world_joker() - local wee = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_wee", "weeck") - G.jokers:emplace(wee) - G.GAME.tortoise = true - G.GAME.obsidian = true - G.GAME.mysterious = true - save_run() - end) + G.GAME.banned_keys.j_Bakery_Lua = true + G.GAME.modifiers.omega_replacement = 1 / 301 end, alt_calculate = function(_, ...) for _, v in pairs(G.P_CENTERS) do @@ -734,13 +749,9 @@ back { G.hand.config.card_limit = math.max(G.hand.config.card_limit or 12, 12) end, calculate = function(_, _, context) - rebalance_orrery() - G.GAME.mysterious = nil - if Jane.is_end_of_ante(context) then - Jane.q(function() - Jane.empowered() - end) + G.GAME.modifiers.omega_replacement = G.GAME.modifiers.omega_replacement ^ 0.765 + Jane.q(Jane.display_omega_odds) end end, } diff --git a/src/challenge.lua b/src/challenge.lua index f299332..d3b399d 100644 --- a/src/challenge.lua +++ b/src/challenge.lua @@ -93,3 +93,47 @@ G.localization.misc.v_text.ch_c_jane_downpour2 = G.localization.misc.v_text.ch_c_jane_downpour3 = {"{C:attention}Boss Blind {}is defeated, or {C:red}lose"} + +SMODS.Challenge { + key = "jerma", + loc_txt = {name = "Jerma"}, + rules = {custom = {{id = "jane_jerma1"}, {id = "jane_jerma2"}}}, + apply = function(_) + Jane.apply_orrery() + Jane.increase_rates() + G.GAME.modifiers.jane_spacious = true + G.GAME.used_vouchers.v_omen_globe = true + G.GAME.modifiers.jane_spacious_omega = true + G.GAME.modifiers.omega_replacement = 1 / 301 + G.GAME.starting_voucher_count = (G.GAME.starting_voucher_count or 0) + 1 + + Jane.q(function() + Jane.add_rain_world_joker() + local wee = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_wee", "weeck") + G.jokers:emplace(wee) + G.GAME.tortoise = true + G.GAME.obsidian = true + G.GAME.mysterious = true + save_run() + end) + end, + calculate = function(_, context) + Jane.rebalance_orrery() + G.GAME.mysterious = nil + + if Jane.is_end_of_ante(context) then + G.GAME.modifiers.omega_replacement = G.GAME.modifiers.omega_replacement ^ 0.765 + Jane.q(Jane.display_omega_odds) + + Jane.q(function() + Jane.empowered() + end) + end + end, +} + +G.localization.misc.v_text.ch_c_jane_jerma1 = +{"Applies the {C:legendary,E:1}upsides"} + +G.localization.misc.v_text.ch_c_jane_jerma2 = +{"of {C:attention}every Jane deck"} diff --git a/src/main.lua b/src/main.lua index 299838f..77e20e7 100644 --- a/src/main.lua +++ b/src/main.lua @@ -12,10 +12,9 @@ end Jane = { cry = SMODS.Mods.Cryptid and not SMODS.Mods.Cryptid.disabled, config = { - omega_chance = 1 / 301, texture_pack = "default", wee_sizemod = math.sqrt(2), - bans = {"j_Bakery_Lua", "j_cry_crustulum", "c_cry_hammerspace"}, + bans = {"j_cry_crustulum", "c_cry_hammerspace"}, }, } @@ -28,6 +27,28 @@ if not Jane.misprintize then assert(SMODS.load_file("src/misprintize.lua"))() end +local function update_omega_from_collection() + local buffer = SMODS.ConsumableType.visible_buffer + + if not buffer then + return + end + + local flag + + for i = 1, #buffer do + if buffer[i] == "jane_omegaconsumable" then + table.remove(buffer, i) + flag = true + i = i - 1 + end + end + + if not flag and G.GAME.modifiers.omega_replacement then + buffer[#buffer + 1] = "jane_omegaconsumable" + end +end + function Jane.can_use() return not (((G.play and #G.play.cards > 0) or (G.CONTROLLER.locked) or @@ -52,7 +73,8 @@ function Jane.card_status_text( volume, pitch, trigger, - f + f, + hold ) if (delay or 0) <= 0 then if type(f) == "function" then @@ -62,7 +84,7 @@ function Jane.card_status_text( attention_text({ text = text, scale = size or 1, - hold = 0.7, + hold = hold or 0.7, backdrop_colour = colour or (G.C.FILTER), align = align or "bm", major = card, @@ -94,7 +116,7 @@ function Jane.card_status_text( attention_text({ text = text, scale = size or 1, - hold = 0.7 + (delay or 0), + hold = (hold or 0.7) + (delay or 0), backdrop_colour = colour or (G.C.FILTER), align = align or "bm", major = card, @@ -306,10 +328,11 @@ end local orig_menu = Game.main_menu function Game:main_menu(change_context) - Jane.sinister = nil + orig_menu(self, change_context) + update_omega_from_collection() G.C.BACKGROUND.C[4] = 1 G.C.BACKGROUND.L[4] = 1 - orig_menu(self, change_context) + Jane.sinister = nil end local orig_start_run = Game.start_run @@ -317,9 +340,8 @@ local orig_start_run = Game.start_run function Game:start_run(...) orig_start_run(self, ...) self.GAME.modifiers.omegas_found = nil - - self.GAME.modifiers.omega_replacement = - self.GAME.modifiers.omega_replacement or Jane.config.omega_chance + Jane.q(Jane.display_omega_odds) + update_omega_from_collection() if self.GAME.banned_keys then for _, v in pairs(Jane.config.bans) do @@ -327,7 +349,7 @@ function Game:start_run(...) end end - if next(SMODS.find_card("j_Bakery_Lua")) then + if self.GAME.banned_keys.j_Bakery_Lua and next(SMODS.find_card("j_Bakery_Lua")) then G.C.BACKGROUND.L[4] = 0 end end diff --git a/src/omega.lua b/src/omega.lua index cd8594a..7f13793 100644 --- a/src/omega.lua +++ b/src/omega.lua @@ -36,10 +36,10 @@ SMODS.ConsumableType { undiscovered = { name = "Not Discovered", text = { - "Purchase or use", - "this {C:dark_edition,E:1}rare {}card in", - "an unseeded run to", - "learn what it does", + "Use this {C:dark_edition,E:1}very rare", + "card in an unseeded", + "run to learn what", + "it is {C:dark_edition,E:1}capable of", }, }, }, @@ -1218,9 +1218,16 @@ SMODS.Consumable { end Jane.q(function() + local lua = G.GAME.banned_keys.j_Bakery_Lua + + if G.GAME.banned_keys.j_Bakery_Lua then + SMODS.destroy_cards(G.jokers.cards, {bypass_eternal = true}) + G.jokers:change_size(1 - G.jokers.config.card_limits.base) + else + G.jokers:change_size(1) + end + G.GAME.banned_keys.j_Bakery_Lua = nil - SMODS.destroy_cards(G.jokers.cards, {bypass_eternal = true}) - G.jokers:change_size(1 - G.jokers.config.card_limits.base) SMODS.add_card { set = "Joker", @@ -1230,8 +1237,8 @@ SMODS.Consumable { } play_sound("jane_enchant", 0.75, 1) - G.GAME.banned_keys.j_Bakery_Lua = true - G.GAME.banned_keys.c_jane_soul_omega = true + G.GAME.banned_keys.j_Bakery_Lua = lua + G.GAME.banned_keys.c_jane_soul_omega = lua local function darken(i) if i > 450 then @@ -1267,7 +1274,7 @@ end function create_card(...) local card = orig_create_card(...) - if G.STATE ~= G.STATES.SMODS_BOOSTER_OPENED or not card.gc then + if G.STATE ~= G.STATES.SMODS_BOOSTER_OPENED or not card.gc or not G.GAME.modifiers.omega_replacement then return card end