Skip to content

Commit da3ca83

Browse files
authored
SMODS.is_active_blind() function (#1015)
1 parent 127f51d commit da3ca83

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lsp_def/utils.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ function SMODS.is_getter_context(context) end
742742
--- skipping the evaluation of the object and preventing an infinite loop.
743743
function SMODS.check_looping_context(eval_object) end
744744

745+
---@param key string The key or name of the Blind to check
746+
---@param ignore_disabled? boolean Whether to ignore the Blind being disabled
747+
function SMODS.is_active_blind(key, ignore_disabled) end
748+
745749
---Check if `challenge` is unlocked.
746750
---@param challenge SMODS.Challenge
747751
---@param k? number Index of challenge in G.CHALLENGES. Only relevant for challenges defined outside SMODS

src/utils.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3234,7 +3234,11 @@ function CardArea:handle_card_limit()
32343234
end
32353235
end
32363236

3237+
function SMODS.is_active_blind(key, ignore_disabled)
3238+
return G.GAME and G.GAME.blind and G.GAME.facing_blind and (G.GAME.blind.name == key or G.GAME.blind.config.key == key) and (not G.GAME.blind.disabled or ignore_disabled)
3239+
end
3240+
32373241
-- Function used to determine whether the current blind modifies the number of cards drawn
32383242
function SMODS.blind_modifies_draw(key)
32393243
if SMODS.Blinds.modifies_draw[key] then return true end
3240-
end
3244+
end

0 commit comments

Comments
 (0)