roll-parser - v3.4.0
    Preparing search index...

    Type Alias RollOptions

    RollOptions: EvaluationOptions & { rng?: RNG; seed?: string | number }

    Everything roll accepts on top of the shared EvaluationOptions: a randomness source, given either as a ready-made RNG or as a seed.

    Type Declaration

    • Optionalrng?: RNG

      Randomness source. Takes precedence over seed — when both are given, seed is ignored.

    • Optionalseed?: string | number

      Seed for a fresh SeededRNG. Equal seeds replay the same die sequence for the same notation. Ignored when rng is set.

    import { roll, SeededRNG } from 'roll-parser';

    roll('4d6', { seed: 'character-1' }); // reproducible
    roll('4d6', { rng: new SeededRNG(42) }); // rng wins over seed
    roll('1d20+@str', { context: { str: 4 } });