Skip to content

SMODS.Blind

N edited this page Apr 1, 2026 · 12 revisions

API Documentation: SMODS.Blind

Class prefix: bl

  • Required parameters:
  • Optional parameters (defaults)
    • atlas = 'blind_chips', pos = { x = 0, y = 0 } (reference)
      • To have an animated sprite like vanilla Blinds set atlas_table = 'ANIMATION_ATLAS'. The y value determines the row to use for the animation. The x value is ignored and cycles through each frame of the animation.
    • config = {}, discovered = false, no_collection, prefix_config, dependencies (reference)
      • config values are saved under G.GAME.blind.effect.
    • dollars = 5: Amount of money obtained when defeated.
    • mult = 2: Required score relative to the Ante's Base score.
    • boss: Marks this Blind as a Boss Blind and specifies on which Antes it can appear ({ min = 1, max = 10 }). max is an artifact and not functional. Use in_pool instead for advanced conditions.
      • boss.showdown: Marks this Blind as a Final Boss Blind that shows up on every multiple of the winning Ante. min is ignored, use in_pool to restrict spawning.
    • boss_colour: Sets the background colour to use while playing this Blind (e.g. HEX('56789A'))
    • debuff = {}: Configure vanilla Blind effects with these fields:
      • Disallowing hands in full:
        • hand = { ['Hand Type'] = true} for a specific set of hands,
        • h_size_ge = n, must play at least n cards,
        • h_size_le = n, must play at most n cards.
      • Debuffing cards:
        • suit = 'Hearts' for one specific suit,
        • value = '2' for one specific rank,
        • nominal = n for all ranks scoring n base chips,
        • is_face = true for all face cards.
      • These effects are ignored if you specify a debuff_hand or debuff_card function respectively.
    • ignore_showdown_check: Enabling this allows in_pool to be evaluated regardless of whether a showdown Boss Blind was requested or not.
    • vars = {}: variables for the Blind's description in the collection. Fallback if collection_loc_vars isn't set.
    • modifies_draw: Set to true if the blind modifies the draw similar to The Serpent. This will not handle the functionality but it is necessary for the effects to apply properly.

API methods

In all of the following methods, use the global variable G.GAME.blind to refer to the current blind. (The base game uses self to refer to the current blind in Blind:foo().)

  • set_blind(self)
    • Effects that activate when this Blind is selected
  • calculate(self, blind, context) -> table (reference)
    • This method is both called directly on the center and from Blind:calculate() and incorporated into the standard calculation pipeline. Several blind functions below can be handled here via checking their respective calculation context.
  • calc_dollar_bonus(self, blind) -> number, table
    • (Added in 1531zeebee)
    • For awarding money at the end of the round (e.g. Delayed Gratification, Cloud Nine)
    • Optionally, you can return a table as the second value to modify the text in the round evaluation screen with any of the following arguments:
      • text: Replaces the default name text.
      • key, set: Allows changing the key and/or set of the name in the localization (ignored if text is set)
      • text_colour, scale: Allows changing the colour and scale of the text respectively
  • disable(self)
    • Reverting effects when this Blind gets disabled
  • defeat(self)
    • Reverting effects when this Blind is defeated
  • drawn_to_hand(self)
    • Effects that activate when cards are drawn to hand
  • press_play(self)
    • Effects that activate when a hand is played
  • recalc_debuff(self, card, from_blind) -> bool
    • Determines what cards should be debuffed by this Blind
  • debuff_hand(self, cards, hand, handname, check) -> bool
    • Determines if a hand is disallowed by this Blind
  • stay_flipped(self, area, card) -> bool
    • Determines what cards are drawn face down
  • modify_hand(self, cards, poker_hands, text, mult, hand_chips) -> number, number, bool
    • Used for modifications on the base score of played hands. Expected return values in order are:
      • The modified value of mult
      • The modified value of hand_chips
      • A boolean value indicating whether any values were changed
  • get_loc_debuff_text(self) -> string
    • Allows modifying text displayed for debuff warnings on invalid hands
  • loc_vars(self) -> { vars ?= table, key ?= string } (reference)
    • Due to various constraints, the functionality of loc_vars on blinds is very limited. Only vars, set and key returns are supported, and no info_queue exists.
  • collection_loc_vars(self) -> { vars ?= table, key ?= string }
    • Used for passing variables to Blind descriptions when viewing the collection. If not defined, the game will use the vars field on your object.
  • in_pool(self) -> bool
    • For implementing advanced restrictions on when a Blind may appear in a run. This puts boss.min and boss.max restrictions out of effect.
    • Unless ignore_showdown_check is set, this function will not be evaluated in the following cases:
      • A showdown Boss Blind should appear, but this Blind is a regular Boss Blind.
      • A regular Boss Blind should appear, but this Blind is a showdown Boss Blind.

Clone this wiki locally