Hold And Win Grid
Runs a hold-and-win coin respin bonus: coins lock with a value each, the other cells respin, a new coin refills the respins, and the bonus ends when they run out or the grid is full. A stateful, seeded maths node that also compiles to the RGS.
Fire Start with the triggering spin on Reels (Weighted Reels reels). Every cell showing Coin Symbol locks and gets a value: the one already in Value Grid when a Symbol Value Grid priced that cell, otherwise a draw from Coin Values weighted by Coin Value Weights, multiplied by Bet Amount and rounded to minor units while Values Are Bet Multiples is on. respinsLeft becomes Respins and active turns true. Coin Symbol must be a positive id, or every call fails closed.
Then fire Respin once per respin. The node redraws every unlocked cell itself from Symbol Weights (the symbolWeights array Weighted Reels takes), locks any cell that draws the coin and prices it, and refills respinsLeft to Respins when a coin landed (with Reset Respins On New Coin on) or counts it down otherwise. No external spin is needed: the maths owns the respin and the reel columns only animate the result, landing whole columns, so display grid as the landed grid.
isComplete turns true on the call where respinsLeft reaches 0 or the grid is full; pay totalValue then. grid is the board to show and score, coins in place and Blank Symbol elsewhere; valueGrid is the value per cell in the same shape and lockedCells the held coins as [row, col] pairs for pixi.CellOverlay cells. Do re-emits the current state without spending a respin and behaves like Start while idle; Respin while idle does nothing. Hold grid in a Variable and wire that variable back into Reels.
Every draw comes from Seeds, and only the first seed is used, so wire a fresh ISAAC Random Number Array Generator array before each call or the respins repeat. A call that draws nothing needs no seed. Unseeded with a draw pending, or given an empty or ragged grid, the node fails closed: it logs the reason, writes it to inspect data, empties every output, keeps its state and still fires Done. State persists across rounds for identified players only; a guest cannot carry the bonus from one request to the next.
Inputs
Parameters
| Data | Description |
|---|---|
| Reels (array) | The grid for this call: the triggering spin on Start; the held board from the Variable on Respin. |
| Coin Symbol (number) | Symbol id of the coin. Must be a positive id or the node fails closed. Default 0. |
| Blank Symbol (number) | Symbol id written into every unlocked cell of grid. Default 0. |
| Symbol Weights (respin refill) (array) | Respin alphabet, entry n weights symbol n + 1, the Weighted Reels array. Empty = the grid's own symbols, drawn uniformly. |
| Respins (number) | Respins granted on Start and, with the reset option on, after each new coin. Default 3. |
| Reset Respins On New Coin (boolean) | When on, a new coin refills respinsLeft to Respins; when off, it only counts down. Default on. |
| Coin Values (array) | Possible coin values, as bet multiples or face values. Default [1, 2, 5]. |
| Coin Value Weights (array) | Draw weight per entry of Coin Values; a different length means equal odds. Default empty. |
| Bet Amount (number) | Bet in minor units, multiplied into each value while Values Are Bet Multiples is on. Default 100. |
| Values Are Bet Multiples (boolean) | When on, a value is value x betAmount rounded to minor units; when off, the face value. Default on. |
| Value Grid (optional, pre-priced) (array) | Optional pre-priced values from Symbol Value Grid valueGrid; a positive entry is used instead of a draw on Start. |
| Seeds (array) | Random seeds, wired from ISAAC Random Number Array Generator array. Required; the node refuses to run unseeded. |
Actions
| Signal | Description |
|---|---|
| Do | Runs the node. |
| Start | Starts the bonus from the grid on Reels: locks the coins, prices them and sets the respins. |
| Respin | Redraws every unlocked cell from Symbol Weights and Seeds, locks new coins and updates the respins. |
| Reset | Clears the node's state and starts again. |
Outputs
Events
| Signal | Description |
|---|---|
| Done | Fires when the node has finished, on success and failure alike. |
Results
| Data | Description |
|---|---|
| Grid (array) | The board: coins in place, Blank Symbol elsewhere. Display and score this grid. |
| Value Grid (array) | The coin value per cell in minor units, same shape as grid, 0 where there is no coin. |
| Locked Cells (array) | The held coins as [row, col] pairs; wire to pixi.CellOverlay cells. |
| Locked Count (number) | Number of held coins. |
| New Coins (number) | Coins locked by this call. |
| Respins Left (number) | Respins remaining after this call. |
| Is Complete (boolean) | True on the call that ends the bonus; pay totalValue then. A boolean, not a signal. |
| Active (boolean) | True while the bonus is running. |
| Total Value (number) | Sum of every held coin in minor units. |
| Is Full (boolean) | True when every cell holds a coin. |
Usage
- Set Coin Symbol, Coin Values and Symbol Weights; wire a fresh ISAAC array into Seeds on every call.
- Wire the triggering spin into Reels and fire Start; write
gridto the grid Variable and wire that variable back into Reels. - Wire
lockedCellsinto pixi.CellOverlay Cells and showvalueGridon the coins. - Fire Respin once per respin, after the reels have animated the previous
grid. - When
isCompleteis true, paytotalValueand fire Reset before the next base spin.
Always wire Symbol Weights. Left empty, the respin alphabet is inferred from the symbols on the incoming grid, which after the first respin is only the coin and blank symbols, so the board fills far faster than the game intends.