From 065b9951e070ba31f1ac6c90bc48a18160ba5c91 Mon Sep 17 00:00:00 2001 From: Nanuzer0 Date: Mon, 31 Aug 2026 01:54:39 +0300 Subject: [PATCH] fix patches related to negative deck --- lovely/lib_misc.toml | 13 +------------ lovely/misc.toml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lovely/lib_misc.toml b/lovely/lib_misc.toml index 7fab8acf5..8c64c905f 100644 --- a/lovely/lib_misc.toml +++ b/lovely/lib_misc.toml @@ -94,18 +94,7 @@ position = "before" payload = '''elseif _type == 'Consumeables' then _pool[#_pool + 1] = "c_ceres"''' match_indent = true -# hand size forgiveness if playing negative or antimatter deck (someone please fix) -[[patches]] -[patches.pattern] -target = "game.lua" -pattern = "function Game:update_draw_to_hand(dt)" -position = "after" -payload = ''' -if G.GAME.selected_back and (G.GAME.selected_back.name == 'cry--Negative Deck' or G.GAME.selected_back.name == 'cry-Antimatter') and G.hand.config.card_limit <= 0 then -- 'cry--Negative Deck'... sure - G.hand.config.card_limit = 1 -end -''' -match_indent = true + # init Cryptid global through lovely # so other mods can add things to obj pools diff --git a/lovely/misc.toml b/lovely/misc.toml index bc81f7300..3dbb69946 100644 --- a/lovely/misc.toml +++ b/lovely/misc.toml @@ -605,6 +605,26 @@ position = "at" payload = """limit = limit - 1 + (card.edition and card.edition.card_limit or 0)""" match_indent = true +#Fix SMODS.cards_to_draw desync when drawing negative cards (especially when drawing the entire deck) +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "SMODS.cards_to_draw = SMODS.cards_to_draw + (SMODS.cards_to_draw < #G.deck.cards and (cards_to_draw[i].ability.extra_slots_used or 0) - (cards_to_draw[i].ability.card_limit or 0) or 0)" +position = "at" +payload = "SMODS.cards_to_draw = SMODS.cards_to_draw + (cards_to_draw[i].ability.extra_slots_used or 0) - (cards_to_draw[i].ability.card_limit or 0)" +match_indent = true + +#Ensure SMODS.cards_to_draw is reset at the start of each new round +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "G.GAME.current_round.used_packs = {}" +position = "after" +payload = ''' +SMODS.cards_to_draw = nil +''' +match_indent = true + #This fixes a double-sided green seal cards crashing the game while trying to open "View deck" while flipped inside the random deck selection in a booster pack [[patches]]