import { PMF } from "../pmf/pmf.js"; import type { Trigger, TurnSpec } from "./types.js"; /** * A resolved, validated turn: the ordered steps to walk, plus the trigger * groups it tracks. Building this is where every {@link TurnSpecError} is raised, * so the walk itself can assume a well-formed plan. */ export interface TurnPlan { steps: readonly Step[]; /** One entry per distinct `of` set; each holds the step indices that update it. */ groupCount: number; /** Declared attacks only, in order — what `DiceQuery.singles` gets. */ attackPMFs: readonly PMF[]; /** Every attack id, in declaration order. */ attackIds: readonly string[]; /** Every rider id, in declaration order, including `every-hit` riders. */ riderIds: readonly string[]; /** Rider id → step index, for `fireProbability` and `not-fired`. */ riderSteps: ReadonlyMap; /** * `every-hit` rider id → the group index whose "something landed" bit answers * P(it fired at least once). Such riders are folded into their sources' slices * rather than becoming steps, so they have no step index. */ perHitGroups: ReadonlyMap; } /** * One step of the turn. `slices` non-null ⇒ the step rolls its own attack and * advances the groups listed in `updates`; null ⇒ it is pure damage whose amount * depends only on the mode it fires in. */ export interface Step { id: string; /** Declared attacks always fire; riders consult their trigger. */ trigger: Trigger | null; /** Outcome-labelled sub-mass PMFs, masses summing to 1. */ slices: { hit: PMF; crit: PMF; miss: PMF; } | null; /** Pure-damage payloads, mass 1 each. */ damage: { hit: PMF; crit: PMF; } | null; /** Group indices this step's outcome advances. */ updates: readonly number[]; /** Group index this step's trigger reads, or -1 for `not-fired` / always-fires. */ reads: number; /** For `not-fired`: the step index of the rider being negated. */ negates: number; } export declare function buildPlan(spec: TurnSpec, eps?: number): TurnPlan; //# sourceMappingURL=plan.d.ts.map