From 311b1d37689b083ecff1b57dced924c6ac757d48 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 01:57:59 -0400 Subject: [PATCH 1/8] added commented out brute force fix for hybrid double sided crash --- lovely/ccd.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lovely/ccd.toml b/lovely/ccd.toml index 98c0f2e0e..6d8880812 100644 --- a/lovely/ccd.toml +++ b/lovely/ccd.toml @@ -124,7 +124,7 @@ target = "card.lua" pattern = '''return generate_card_ui(self.config.center, nil, loc_vars, card_type, badges, hide_desc, main_start, main_end, self)''' position = "before" payload = ''' -if card_type ~= 'Default' and card_type ~= 'Enhanced' and self.playing_card then +if card_type ~= 'Default' and card_type ~= 'Enhanced' and self.playing_card then -- and card_type ~= 'Joker' then loc_vars = loc_vars or {} loc_vars.ccd = { playing_card = not not self.base.colour, value = self.base.value, suit = self.base.suit, colour = self.base.colour, @@ -143,6 +143,7 @@ pattern = '''local loc_vars = {}''' position = "before" payload = ''' if specific_vars and specific_vars.ccd then + local debug_table = specific_vars.ccd full_UI_table.ccd = {name = {}, main = {}} localize{type = 'other', key = 'playing_card', set = 'Other', nodes = full_UI_table.ccd.name, vars = {localize(specific_vars.ccd.value, 'ranks'), localize(specific_vars.ccd.suit, 'suits_plural'), colours = {specific_vars.ccd.colour}}} full_UI_table.ccd.name = full_UI_table.ccd.name[1] From afbea71a8b260de1f3a046c7fded6da60adb35d5 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 02:11:02 -0400 Subject: [PATCH 2/8] Blocked merging of playing cards and non-playing cards --- items/misc.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/items/misc.lua b/items/misc.lua index e78758351..26ac61343 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -2435,6 +2435,7 @@ G.FUNCS.can_merge_ds = function(e) and not other.merged and card.area and card.area.config.type ~= "shop" + and (not not card.playing_card) == (not not other.playing_card) --prevents merging playing cards with non-playing cards, which can cause various issues then e.config.colour = G.C.PURPLE e.config.button = "merge_ds" From ecadb1ad518d06676707353ca91e02acb7b7a395 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 02:40:43 -0400 Subject: [PATCH 3/8] Made double sided playing cards correctly flip between bases --- items/misc.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/items/misc.lua b/items/misc.lua index e78758351..5b4f7a4b5 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -2163,10 +2163,12 @@ local double_sided = { else card:remove_from_deck(true) end + local curr_pc = card.playing_card local curr_abil = copy_table(card.ability) local key = card.config.center.key local base = copy_table(card.base) local seal = card.seal + card.playing_card = card.ability.immutable.other_side.playing_card if card.ability.immutable.other_side.base then card.base = card.ability.immutable.other_side.base else @@ -2194,6 +2196,8 @@ local double_sided = { card.ability.immutable = {} end card.ability.immutable.other_side = curr_abil + card.ability.immutable.other_side.base = base + card.ability.immutable.other_side.playing_card = curr_pc card.ability.immutable.other_side.key = key card.ability.immutable.other_side.seal = G.P_SEALS[seal] and seal or nil if next(find_joker("cry-Flip Side")) then @@ -2213,9 +2217,11 @@ local double_sided = { card:remove_from_deck(true) end local curr_abil = copy_table(card.ability) + local curr_pc = card.playing_card local key = card.config.center.key local seal = card.seal local base = copy_table(card.base) + card.playing_card = card.ability.immutable.other_side.playing_card if card.ability.immutable.other_side.base then card.base = card.ability.immutable.other_side.base else @@ -2246,6 +2252,8 @@ local double_sided = { card.ability.immutable = {} end card.ability.immutable.other_side = curr_abil + card.ability.immutable.other_side.base = base + card.ability.immutable.other_side.playing_card = curr_pc card.ability.immutable.other_side.key = key card.ability.immutable.other_side.seal = G.P_SEALS[seal] and seal or nil if next(find_joker("cry-Flip Side")) then @@ -2458,6 +2466,7 @@ G.FUNCS.merge_ds = function(e) card.ability.immutable.other_side = copy_table(other.ability) card.ability.immutable.other_side.key = copy_table(other.config.center.key) card.ability.immutable.other_side.seal = copy_table(other.seal) + card.ability.immutable.other_side.playing_card = other.playing_card if other.base.nominal ~= 0 then card.ability.immutable.other_side.base = copy_table(other.base) end From 935bc95344ea811982c689117e52ef4a1eb33575 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 11:54:46 -0400 Subject: [PATCH 4/8] Removed unnecessary brute force fix --- lovely/ccd.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lovely/ccd.toml b/lovely/ccd.toml index 6d8880812..65151b7f3 100644 --- a/lovely/ccd.toml +++ b/lovely/ccd.toml @@ -124,7 +124,7 @@ target = "card.lua" pattern = '''return generate_card_ui(self.config.center, nil, loc_vars, card_type, badges, hide_desc, main_start, main_end, self)''' position = "before" payload = ''' -if card_type ~= 'Default' and card_type ~= 'Enhanced' and self.playing_card then -- and card_type ~= 'Joker' then +if card_type ~= 'Default' and card_type ~= 'Enhanced' and self.playing_card then loc_vars = loc_vars or {} loc_vars.ccd = { playing_card = not not self.base.colour, value = self.base.value, suit = self.base.suit, colour = self.base.colour, From e5c21191558664bd139c9d28d5a461a1ed73c752 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 17:32:08 -0400 Subject: [PATCH 5/8] Removed redundant modification to other_side.base --- items/misc.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/items/misc.lua b/items/misc.lua index 007c3bbfe..36b094d5f 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -2252,7 +2252,6 @@ local double_sided = { card.ability.immutable = {} end card.ability.immutable.other_side = curr_abil - card.ability.immutable.other_side.base = base card.ability.immutable.other_side.playing_card = curr_pc card.ability.immutable.other_side.key = key card.ability.immutable.other_side.seal = G.P_SEALS[seal] and seal or nil From 8f43d3233f814828f3e8b0a4a836bc8a03ab63f4 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 19:19:13 -0400 Subject: [PATCH 6/8] Fixed blank side of playing cards erroneously showing a rank and suit --- items/misc.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/items/misc.lua b/items/misc.lua index 36b094d5f..0a966ea45 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -2182,11 +2182,6 @@ local double_sided = { end if card.base.nominal ~= 0 then SMODS.change_base(card, card.base.suit, card.base.value) - else - if card.children.front then - card.children.front:remove() - card.children.front = nil - end end card.seal = G.P_SEALS[card.ability.immutable.other_side.seal] and card.ability.immutable.other_side.seal @@ -2235,11 +2230,6 @@ local double_sided = { end if card.base.nominal ~= 0 then SMODS.change_base(card, card.base.suit, card.base.value) - else - if card.children.front then - card.children.front:remove() - card.children.front = nil - end end card.seal = G.P_SEALS[card.ability.immutable.other_side.seal] and card.ability.immutable.other_side.seal @@ -2332,6 +2322,14 @@ local double_sided = { return no_suitref(card) end + local should_hide_frontref = Card.should_hide_front + function Card:should_hide_front(...) + if self.edition and self.edition.key == "e_cry_double_sided" and not self.base.value then + return true + end + return should_hide_frontref(self, ...) + end + -- local calculate_joker = Card.calculate_joker -- function Card:calculate_joker(context) -- if next(SMODS.find_card("cry-Flip Side")) and type(self.ability.immutable.other_side) ~= "string" and self.ability.immutable.other_side then From e6162545971a7e3f91314200e0a816ea805d3a99 Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 19:27:16 -0400 Subject: [PATCH 7/8] Removed code only added for local debugging --- lovely/ccd.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lovely/ccd.toml b/lovely/ccd.toml index 65151b7f3..98c0f2e0e 100644 --- a/lovely/ccd.toml +++ b/lovely/ccd.toml @@ -143,7 +143,6 @@ pattern = '''local loc_vars = {}''' position = "before" payload = ''' if specific_vars and specific_vars.ccd then - local debug_table = specific_vars.ccd full_UI_table.ccd = {name = {}, main = {}} localize{type = 'other', key = 'playing_card', set = 'Other', nodes = full_UI_table.ccd.name, vars = {localize(specific_vars.ccd.value, 'ranks'), localize(specific_vars.ccd.suit, 'suits_plural'), colours = {specific_vars.ccd.colour}}} full_UI_table.ccd.name = full_UI_table.ccd.name[1] From da24093201e3efebacd32fee0ca1b527f611beac Mon Sep 17 00:00:00 2001 From: paulkent-coder Date: Sun, 10 May 2026 19:46:09 -0400 Subject: [PATCH 8/8] Undid blocking of joker-playing card hybrids (so that change can get its own separate PR) --- items/misc.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/items/misc.lua b/items/misc.lua index 0a966ea45..e284ef58f 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -2440,7 +2440,6 @@ G.FUNCS.can_merge_ds = function(e) and not other.merged and card.area and card.area.config.type ~= "shop" - and (not not card.playing_card) == (not not other.playing_card) --prevents merging playing cards with non-playing cards, which can cause various issues then e.config.colour = G.C.PURPLE e.config.button = "merge_ds"