From 7c52a06e6c24ef1cef92615127458c58a2539447 Mon Sep 17 00:00:00 2001 From: Emik Date: Sun, 15 Feb 2026 16:31:41 +0100 Subject: [PATCH] Fix copying negative playing cards --- src/tweaks.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tweaks.lua b/src/tweaks.lua index bf0b2e4..89c337d 100644 --- a/src/tweaks.lua +++ b/src/tweaks.lua @@ -4,6 +4,7 @@ SMODS.Joker:take_ownership("joker", {cost = 1}, true) local orig_can_highlight = CardArea.can_highlight local orig_set_debuff = Card.set_debuff local orig_highlight = Card.highlight +local orig_copy_card = copy_card ---@diagnostic disable-next-line: duplicate-set-field function CardArea:can_highlight(...) @@ -11,6 +12,7 @@ function CardArea:can_highlight(...) 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 @@ -33,6 +35,19 @@ function Card:highlight(is_highlighted, ...) end end +---@diagnostic disable-next-line: lowercase-global +function copy_card(other, new_card, ...) + local ret = orig_copy_card(other, new_card, ...) + + if new_card and new_card.edition and new_card.edition.key == "e_negative" then + --- Fixes an issue where using 'c_death' will make negative + --- cards do the inverse of what they're supposed to do. + new_card.ability.card_limit = math.max(new_card.ability.card_limit, 1) + end + + return ret +end + q(function() local orig_can_highlight_area = Bakery_API.can_highlight_area