From 135cd6111907708b64cdde247427c79f72348656 Mon Sep 17 00:00:00 2001 From: wingedcatgirl <69098783+wingedcatgirl@users.noreply.github.com> Date: Sun, 14 Jun 2026 12:59:45 -0400 Subject: [PATCH 1/2] add SMODS.get_virtual_suits --- lovely/playing_card.toml | 2 +- lsp_def/utils.lua | 7 ++++++- src/utils.lua | 13 +++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lovely/playing_card.toml b/lovely/playing_card.toml index 018fd7849..81cbbed62 100644 --- a/lovely/playing_card.toml +++ b/lovely/playing_card.toml @@ -134,7 +134,7 @@ local suits = { } ''' position = 'at' -payload = 'local suits = SMODS.Suit.obj_buffer' +payload = 'local suits = SMODS.get_virtual_suits()' match_indent = true [[patches]] diff --git a/lsp_def/utils.lua b/lsp_def/utils.lua index 1d43499a1..826cb37e3 100644 --- a/lsp_def/utils.lua +++ b/lsp_def/utils.lua @@ -888,4 +888,9 @@ function SMODS.copy_card(card, args) end ---@param card Card|table Card to add ---@param args {set: string?, area: CardArea|table?, playing_card: integer?}? ---@return Card|table -function SMODS.add_to_deck(card, args) end \ No newline at end of file +function SMODS.add_to_deck(card, args) end + +---Returns a copy of SMODS.Suit.obj_buffer +---Hook this function and edit the return if you want the game to see suits that don't exist, or not see suits that do exist +---@return string[] +function SMODS.get_virtual_suits() end \ No newline at end of file diff --git a/src/utils.lua b/src/utils.lua index 11976c115..b2d4b6f02 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -2650,8 +2650,9 @@ end function SMODS.seeing_double_check(hand, suit) local suit_tally = {} - for i = #SMODS.Suit.obj_buffer, 1, -1 do - suit_tally[SMODS.Suit.obj_buffer[i]] = 0 + local suitlist = SMODS.get_virtual_suits() + for i = #suitlist, 1, -1 do + suit_tally[suitlist[i]] = 0 end for i = 1, #hand do if not SMODS.has_any_suit(hand[i]) then @@ -2671,6 +2672,14 @@ function SMODS.seeing_double_check(hand, suit) if saw_double(suit_tally, suit) then return true else return false end end +function SMODS.get_virtual_suits() + local ret = {} + for i,v in ipairs(SMODS.Suit.obj_buffer) do + ret[i] = v + end + return ret +end + local function parse_tooltip_vars(str, separator) separator = separator or ";" From d827a4307b2cf92eb205602d7cbe518c981367fb Mon Sep 17 00:00:00 2001 From: wingedcatgirl <69098783+wingedcatgirl@users.noreply.github.com> Date: Sun, 14 Jun 2026 13:06:36 -0400 Subject: [PATCH 2/2] clarify use --- lsp_def/utils.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lsp_def/utils.lua b/lsp_def/utils.lua index 826cb37e3..49e79f818 100644 --- a/lsp_def/utils.lua +++ b/lsp_def/utils.lua @@ -892,5 +892,6 @@ function SMODS.add_to_deck(card, args) end ---Returns a copy of SMODS.Suit.obj_buffer ---Hook this function and edit the return if you want the game to see suits that don't exist, or not see suits that do exist +---Intended for calculation purposes; to get suits that can actually appear on cards you still want the obj_buffer ---@return string[] function SMODS.get_virtual_suits() end \ No newline at end of file