From f233a66cef9b691a849bd06826b11f65f590e842 Mon Sep 17 00:00:00 2001 From: toneblock <55140928+Toneblock@users.noreply.github.com> Date: Sat, 2 May 2026 17:05:47 +0400 Subject: [PATCH] shared pockets (challenge deck) --- localization/en-us.lua | 4 ++ objects/challenges/shared_pockets.lua | 73 +++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 objects/challenges/shared_pockets.lua diff --git a/localization/en-us.lua b/localization/en-us.lua index 99b53baa..75771095 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1500,6 +1500,9 @@ return { ch_c_mp_eeeee = { "Some randomly selected RNG queues are {C:attention}bugged{} each Ante", }, + ch_c_mp_shared_pockets = { + "{C:attention}Hand size{}, {C:attention}Joker Slots{}, and {C:attention}Consumable Slots{} are shared", + }, }, challenge_names = { c_mp_standard = "Standard", @@ -1530,6 +1533,7 @@ return { c_mp_planet_tycoon = "Planet Tycoon", c_mp_bacon = "Blue Ice", c_mp_eeeee = "EEEEE", + c_mp_shared_pockets = "Shared Pockets", }, }, } diff --git a/objects/challenges/shared_pockets.lua b/objects/challenges/shared_pockets.lua new file mode 100644 index 00000000..081b60f6 --- /dev/null +++ b/objects/challenges/shared_pockets.lua @@ -0,0 +1,73 @@ +SMODS.Challenge({ + key = "shared_pockets", + rules = { + custom = { + { id = "mp_shared_pockets" }, + }, + }, + restrictions = { + banned_cards = { + { id = "j_stencil" }, + }, + }, + apply = function(self) + -- we're gonna do some hardcoded jank on the backend because slots are weird + -- so handling this like a reasonable person is riskier + G.GAME.starting_params.joker_slots = (G.GAME.starting_params.joker_slots or 0) + 1e5 + G.GAME.starting_params.consumable_slots = (G.GAME.starting_params.consumable_slots or 0) + 1e5 + G.GAME.starting_params.hand_size = (G.GAME.starting_params.hand_size or 0) + 7 + + G.GAME.mp_shared_pockets = {count = 0, slots = 15} + end, + unlocked = function(self) + return true + end, +}) + +-- just copy what vanilla does +local cardarea_update_ref = CardArea.update +function CardArea:update(dt) + if self == G.hand then + if G.GAME.modifiers.mp_shared_pockets then + self.config.mp_last_size = self.config.mp_last_size or 0 + local slots = (G.jokers.config.card_count - (G.jokers.config.card_limit - 100005)) + (G.consumeables.config.card_count - (G.consumeables.config.card_limit - 100002)) + if slots ~= self.config.last_poll_size then + self:change_size(self.config.mp_last_size - slots) + self.config.mp_last_size = slots + end + end + end + local ret = cardarea_update_ref(self, dt) + if G.GAME.modifiers.mp_shared_pockets then + G.GAME.mp_shared_pockets.count = G.hand.config.card_count + G.jokers.config.card_count + G.consumeables.config.card_count + G.GAME.mp_shared_pockets.limit = G.hand.config.card_limit + G.jokers.config.card_count + G.consumeables.config.card_count + end + return ret +end + +-- ok look this might be a giant hack BUT +-- yeah i have nothing to say +-- whatever +local uie_update_text_ref = UIElement.update_text +function UIElement:update_text() + if G.GAME.modifiers.mp_shared_pockets then + if self.config.ref_value == "card_count" then + if self.config.ref_table == G.hand.config + or self.config.ref_table == G.jokers.config + or self.config.ref_table == G.consumeables.config then + self.config.ref_table = G.GAME.mp_shared_pockets + self.config.ref_value = "count" + end + end + if self.config.ref_value == "total_slots" then + if self.config.ref_table == G.hand.config.card_limits + or self.config.ref_table == G.jokers.config.card_limits + or self.config.ref_table == G.consumeables.config.card_limits then + self.config.ref_table = G.GAME.mp_shared_pockets + self.config.ref_value = "limit" + end + end + end + local ret = uie_update_text_ref(self) + return ret +end \ No newline at end of file