From 2bd613b45858b48cd6af51e3169ce398d1fb7f76 Mon Sep 17 00:00:00 2001 From: Emik Date: Sat, 21 Mar 2026 22:04:12 +0100 Subject: [PATCH] Optimize SMODS.get_enhancements patch --- manifest.json | 2 +- src/joker.lua | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 0037f86..8543167 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "author": [ "Emik" ], - "version": "2.2.2", + "version": "2.2.3", "badge_colour": "8BE9FD", "main_file": "src/main.lua", "badge_text_colour": "44475A", diff --git a/src/joker.lua b/src/joker.lua index 9fb61cf..04a0935 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -585,6 +585,12 @@ joker { local suit = (G.GAME.current_round.Roland_suitable or {}).suit or "Spades" return {vars = {localize(suit, "suits_plural"), colours = {G.C.SUITS[suit]}}} end, + add_to_deck = function() + G.GAME.modifiers.Roland_suitable = (G.GAME.modifiers.Roland_suitable or 0) + 1 + end, + remove_from_deck = function() + G.GAME.modifiers.Roland_suitable = (G.GAME.modifiers.Roland_suitable or 0) - 1 + end, } function SMODS.current_mod.reset_game_globals() @@ -606,8 +612,9 @@ end local orig_get_enhancements = SMODS.get_enhancements function SMODS.get_enhancements(card, ...) - if not next(SMODS.find_card "j_Roland_suitable") or - card.base.suit ~= G.GAME.current_round.Roland_suitable.suit then + if (G.GAME.modifiers.Roland_suitable or 0) <= 0 or + card.base.suit ~= G.GAME.current_round.Roland_suitable.suit or + (card.area ~= G.hand and card.area ~= G.play) then return orig_get_enhancements(card, ...) end