Skip to main content
The Executables class (src/executables/executables.py) groups common spin actions that most games need. It sits in the middle of the class hierarchy between Conditions and your GameExecutables, so every method is available on self inside GameState. Functions in Executables do not return values (unless documented otherwise). They mutate gamestate and emit events as side effects.

Class hierarchy context

To override any method for a specific game, define it with the same signature in GameExecutables or GameStateOverride.

Dependencies

Executables inherits from and relies on:
  • src.state.state_conditions.Conditions — state query helpers
  • src.calculations.board.Boarddraw_board, force_special_board, get_syms_on_reel, count_special_symbols
  • src.calculations.tumble.Tumbletumble_board()
  • src.events.events — all event emission functions
emit_linewin_events() lives on the Lines class (src/calculations/lines.py), and emit_wayswin_events() lives on the Ways class (src/calculations/ways.py). Call them as static methods: Lines.emit_linewin_events(self) and Ways.emit_wayswin_events(self). They are not defined on Executables.

Board functions

draw_board()

Draws the active board from reel strips and optionally emits a reveal event. Behavior depends on the active distribution’s force_freegame condition:
  • force_freegame = True in basegame — randomly selects a scatter count from scatter_triggers in the distribution conditions and calls force_special_board() to guarantee exactly that many scatters on the board.
  • force_freegame = False in basegame — generates boards until none have enough scatters to trigger free spins (prevents accidental freegame entry in non-freegame criteria).
  • In freegame — draws normally from reel strips with no scatter constraint.
bool
default:"True"
When True, calls reveal_event() after drawing. Pass False when you need to inspect the board before emitting.
string
default:"scatter"
The special symbol attribute key used to count trigger symbols. Change this if your game uses a different key for the freespin trigger (e.g. "bonus").

force_special_board()

Forces the board to contain exactly num_force_syms symbols of the given type. Retries internally until the exact count is achieved. Uses weighted random reel-stop selection.
If stacked scatter symbols exist on a reel (multiple scatters on consecutive stops), this method cannot guarantee an exact count. Ensure scatter symbols are not stacked on reel strips when using forced scatter boards.
string
Special symbol attribute key to force (e.g. "scatter", "bonus").
int
Exact number of that symbol type that must appear on the board.

get_syms_on_reel()

Returns the reel-stop index positions where target_symbol (or any symbol with that special attribute) appears on the given reel strip. Returns a list with one entry per reel, each being a list of integer stop indices.

Win event functions

emit_tumble_win_events()

Transmits winInfo and updateTumbleWin events for the current tumble step, then calls evaluate_wincap(). Only emits if win_data["totalWin"] > 0.

Tumble functions

tumble_game_board()

Removes winning symbol positions from the board and cascades remaining symbols down. Emits a tumbleBoard event containing the positions of removed symbols and the new symbols that replaced them. Call after evaluating wins and emitting win events during a tumble sequence:

Win cap

evaluate_wincap()

Checks if win_manager.running_bet_win >= config.wincap. If so, sets self.wincap_triggered = True and emits a wincap event. Returns True if wincap was triggered, False otherwise. Once triggered, win events stop being emitted and check_repeat() no longer retries on win criteria.

Special symbol helpers

count_special_symbols()

Returns the number of symbols currently on the board that have the given special attribute. Reads from self.special_syms_on_board which is populated by the board drawing step.

Free spin functions

check_fs_condition()

Returns True if the scatter count on the current board meets or exceeds the minimum trigger threshold defined in config.freespin_triggers[gametype], and self.repeat is False.

check_freespin_entry()

Verifies that the active distribution criteria expects a free spin trigger (i.e. force_freegame = True). If not, sets self.repeat = True to retry the simulation. Use this when a free spin must only occur in designated criteria.

run_freespin_from_base()

Records the scatter trigger event via self.record(), sets the total free spin count via update_freespin_amount(), then calls self.run_freespin(). This is the standard free spin entry point from the base game:

update_freespin_amount()

Sets self.tot_fs to the number of free spins corresponding to the current scatter count, looked up from config.freespin_triggers[gametype]. Emits a freeSpinTrigger event (from basegame) or freeSpinRetrigger event (from freegame).

update_fs_retrigger_amt()

Adds additional free spins to self.tot_fs when a retrigger scatter condition is met during the free game. Emits a freeSpinRetrigger event.

update_freespin()

Called at the top of the free spin loop before drawing the board. Emits an updateFreeSpin event, increments self.fs, and resets win_manager.spin_win to zero.

end_freespin()

Emits a freeSpinEnd event containing the total amount won during the free game and the corresponding win level. Call this once the free spin loop completes.

Final win

evaluate_finalwin()

Calls update_final_win() to compute and verify the payout multiplier, then emits a finalWin event. Always the last action inside the spin retry loop before check_repeat().

Global multiplier

update_global_mult()

Increments self.global_multiplier by 1 and emits an updateGlobalMult event. Call this whenever the multiplier increases (e.g. on each winning tumble).

Overriding a function

Define the method with the same signature in GameExecutables or GameStateOverride. The MRO ensures your version is called:
game_executables.py