/** * Reroll modifier implementations. * * Recursive (`r`): re-roll matching dice until the condition no longer holds, * or the per-die iteration limit is reached. * Reroll-once (`ro`): re-roll matching dice exactly once, keeping the second * result regardless of whether it matches. * * @module evaluator/modifiers/reroll */ import type { RNG } from '../../rng/types.js'; import type { CompareOp, DieResult } from '../../types.js'; import { type EvalEnv } from '../env.js'; /** * Default value of `EvaluationOptions.maxRerollIterations`: how many times a * single die may be re-rolled by `r` before `REROLL_LIMIT_EXCEEDED` is * thrown. * * Per die, not per pool — it bounds notations like `1d1r<2`, whose reroll * condition can never stop matching. `ro` re-rolls exactly once and is * unaffected. * * @category Limits */ export declare const DEFAULT_MAX_REROLL_ITERATIONS = 1000; /** * Applies recursive reroll: re-roll each matching die until it no longer * matches or the per-die iteration limit is reached. Intermediate dice are * appended to the output pool with `['rerolled', 'dropped']` so they: * 1. Render as strikethrough (via `renderDice`'s `'dropped'` check). * 2. Are excluded from `sumKeptDice`. * 3. Are ignored by subsequent keep/drop modifiers. */ export declare function applyRecursiveReroll(pool: DieResult[], operator: CompareOp, value: number, rng: RNG, env: EvalEnv): DieResult[]; /** * Applies reroll-once: re-roll each matching die exactly once, keeping the * second result regardless of whether it matches. Non-matching dice pass * through with the `'kept'` slot flag. */ export declare function applyRerollOnce(pool: DieResult[], operator: CompareOp, value: number, rng: RNG, env: EvalEnv): DieResult[]; //# sourceMappingURL=reroll.d.ts.map