All extensions

@open-rgs/pay-ways

Paid by the product of per-column counts.

Counting ways

No paylines. A symbol pays if it appears on consecutive columns from the first reel, and the payout is multiplied by the number of distinct paths through them.

=6
Two on the first reel, one on the second, three on the third: six ways.
import { evalWays, totalWays } from "@open-rgs/pay-ways";

const wins = evalWays(grid, PAY, { roles });

wins[0].ways;
totalWays(grid);

A gap ends the run

Counting every column the symbol appears on, gap or not, inflates both the count and the ways multiplier. Ways games are dense, so this bug is far more expensive here than on lines.

A gap ends the run. Counting past it inflates the multiplier.
evalWay(grid, "HIGH", PAY, { roles });

Variable heights need no change

This never reads the shape. It counts actual matches per column, so a board whose reels drew different heights this spin works unchanged.

12 ways 6 ways 8 ways 16 ways 6 ways
Same evaluator, five board shapes. It counts matching cells per column, so the ways count follows the matches and not the heights.
import { heights, multiwaysFillWeights } from "@open-rgs/multiways";

const H = heights({ 2: 20, 3: 25, 4: 25, 5: 15, 6: 10, 7: 5 }, 6);
const reels = multiwaysFillWeights(H, BASE);

evalWays(reels(host.rng_next), PAY, { roles });