diff --git a/lovely/center.toml b/lovely/center.toml index 9625c41e8..d49f4473f 100644 --- a/lovely/center.toml +++ b/lovely/center.toml @@ -515,10 +515,7 @@ payload = ''' local nc local select_to = card.area == G.pack_cards and G.pack_cards and booster_obj and SMODS.card_select_area(card, booster_obj) and card:selectable_from_pack(booster_obj) if card.ability.consumeable and not select_to then - local obj = card.config.center - if obj.keep_on_use and type(obj.keep_on_use) == 'function' then - nc = obj:keep_on_use(card) - end + nc = SMODS.should_keep_on_use(card) end if G.booster_pack and not G.booster_pack.alignment.offset.py and ((not select_to and card.ability.consumeable) or not (G.GAME.pack_choices and G.GAME.pack_choices > 1)) then diff --git a/lsp_def/utils.lua b/lsp_def/utils.lua index da02e216f..c7a89b50c 100644 --- a/lsp_def/utils.lua +++ b/lsp_def/utils.lua @@ -768,4 +768,8 @@ function SMODS.challenge_is_unlocked(challenge, k) end --- a custom `func` to modify the values in specific ways. `hands` and `parameters` can --- be limited to specific ones, or default to using all of `G.GAME.hands` and `SMODS.Scoring_Parameters`. --- Use `level_up` to control whether the level of the hand is upgraded. - function SMODS.upgrade_poker_hands(args) end \ No newline at end of file + function SMODS.upgrade_poker_hands(args) end + +---@param card Card|table The card being checked to keep on usage +---@return boolean +function SMODS.should_keep_on_use(card) end \ No newline at end of file diff --git a/src/utils.lua b/src/utils.lua index c67e7374b..5290d9d16 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -3428,4 +3428,12 @@ function SMODS.get_clean_pool(_type, _rarity, _legendary, _append) end end return clean_pool +end + +function SMODS.should_keep_on_use(card) + local obj = card.config.center + if type(obj.keep_on_use) == "function" then + return obj:keep_on_use(card) + end + return false end \ No newline at end of file