From 6ff684ed797c37256163bf6ec1f75a16b81083bf Mon Sep 17 00:00:00 2001 From: Emik Date: Sun, 28 Dec 2025 16:22:39 +0100 Subject: [PATCH] Add new Karma Deck; moving old to Ascension Sleeve; moving old to challenge --- manifest.json | 2 +- src/back.lua | 64 ++++++-------------------------------- src/challenge.lua | 78 +++++++++++++++++++++++++++++++++++++++++++++++ src/main.lua | 1 + 4 files changed, 89 insertions(+), 56 deletions(-) create mode 100644 src/challenge.lua diff --git a/manifest.json b/manifest.json index 01d2345..78d40d9 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.5.18" + "version": "1.5.19" } \ No newline at end of file diff --git a/src/back.lua b/src/back.lua index 759423f..b08647b 100644 --- a/src/back.lua +++ b/src/back.lua @@ -149,7 +149,7 @@ back { end, } -local rain_world_jokers = { +Jane.rain_world_jokers = { "j_jane_monk", "j_jane_survivor", "j_jane_hunter", @@ -161,12 +161,6 @@ local rain_world_jokers = { "j_jane_rot", } -local is_rain_world_joker = {} - -for _, v in pairs(rain_world_jokers) do - is_rain_world_joker[v] = true -end - local function add_rain_world_joker() if not G.jokers then return @@ -174,13 +168,14 @@ local function add_rain_world_joker() local unobtained = {} - for _, v in pairs(rain_world_jokers) do + for _, v in pairs(Jane.rain_world_jokers) do if not next(SMODS.find_card(v, true)) then unobtained[#unobtained + 1] = v end end - local chosen = pseudorandom_element(next(unobtained) and unobtained or rain_world_jokers, pseudoseed("karma_deck")) + local chosen = pseudorandom_element(next(unobtained) and unobtained or Jane.rain_world_jokers, + pseudoseed("karma_deck")) local card = create_card("Joker", G.jokers, nil, nil, nil, nil, chosen, "karma_deck_next") card:add_to_deck() card:start_materialize() @@ -194,65 +189,24 @@ back { loc_txt = { name = "Karma Deck", text = { - "Start with a {C:legendary}Rain World Joker", - "Create another when", - "{C:attention}Boss Blind {}is defeated", + "Start with a", + "{C:legendary}Rain World Joker", }, }, alt_loc_txt = { name = "Ascension Sleeve", text = { - "Start with all {C:legendary}Rain World Jokers {}instead", - "Destroy a random {C:legendary}Rain World Joker {}when", - "{C:attention}Boss Blind {}is defeated, or {C:red}lose", + "Create a {C:legendary}Rain World Joker", + "when {C:attention}Boss Blind {}is defeated", }, }, alt_apply = function(_) - for _, v in ipairs(rain_world_jokers) do - Jane.q(function() - local card = create_card("Joker", G.jokers, nil, nil, nil, nil, v, "karma_deck_next") - card:add_to_deck() - card:start_materialize() - G.jokers:emplace(card) - play_sound("timpani") - end, 0.2) - end + Jane.q(add_rain_world_joker) end, apply = function(_) Jane.q(add_rain_world_joker) end, alt_calculate = function(_, _, context) - local function l() - if G.STAGE == G.STAGES.RUN then - G.STATE = G.STATES.GAME_OVER - G.STATE_COMPLETE = false - end - end - - if not Jane.is_end_of_ante(context) then - return - end - - local destructible_jokers = {} - - for _, v in pairs(G.jokers.cards) do - if is_rain_world_joker[v.config.center.key] and not ((v.ability or {}).eternal or (v.ability or {}).cry_absolute) then - destructible_jokers[#destructible_jokers + 1] = v - end - end - - if not next(destructible_jokers) then - return l() - end - - local chosen = pseudorandom_element(destructible_jokers, pseudoseed("karma_deck")) - - if chosen then - chosen.getting_sliced = true - chosen:start_dissolve() - end - end, - calculate = function(_, _, context) if Jane.is_end_of_ante(context) then add_rain_world_joker() end diff --git a/src/challenge.lua b/src/challenge.lua new file mode 100644 index 0000000..cb90013 --- /dev/null +++ b/src/challenge.lua @@ -0,0 +1,78 @@ +local is_rain_world_joker = {} + +for _, v in pairs(Jane.rain_world_jokers) do + is_rain_world_joker[v] = true +end + +SMODS.Challenge { + key = "downpour", + loc_txt = { + name = "Downpour", + }, + rules = {custom = { + {id = "jane_downpour1"}, + {id = "jane_downpour2"}, + {id = "jane_downpour3"}, + {id = "jane_downpour4"}, + }}, + apply = function(_) + G.GAME.win_ante = 16 + + for _, v in ipairs(Jane.rain_world_jokers) do + Jane.q(function() + local card = create_card("Joker", G.jokers, nil, nil, nil, nil, v, "karma_deck_next") + card:add_to_deck() + card:start_materialize() + G.jokers:emplace(card) + play_sound("timpani") + end, 0.2) + end + end, + calculate = function(_, context) + local function l() + if G.STAGE == G.STAGES.RUN then + G.STATE = G.STATES.GAME_OVER + G.STATE_COMPLETE = false + end + end + + if not Jane.is_end_of_ante(context) then + return + end + + local destructible_jokers = {} + + for _, v in pairs(G.jokers.cards) do + if is_rain_world_joker[v.config.center.key] and not ((v.ability or {}).eternal or (v.ability or {}).cry_absolute) then + destructible_jokers[#destructible_jokers + 1] = v + end + end + + if not next(destructible_jokers) then + return l() + end + + local chosen = pseudorandom_element(destructible_jokers, pseudoseed("karma_deck")) + + if chosen then + chosen.getting_sliced = true + chosen:start_dissolve() + end + end, +} + +G.localization.misc.v_text["ch_c_jane_downpour1"] = { + "Start with all {C:legendary}Rain World Jokers", +} + +G.localization.misc.v_text["ch_c_jane_downpour2"] = { + "Destroy a random {C:legendary}Rain World Joker {}when", +} + +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", +} diff --git a/src/main.lua b/src/main.lua index cf90964..fad6300 100644 --- a/src/main.lua +++ b/src/main.lua @@ -313,6 +313,7 @@ for _, v in ipairs({ "back", "blind", "booster", + "challenge", "edition", "joker", "slugcat",