mwg API
    Preparing search index...

    Interface MultiTurnBeamOptions<T>

    interface MultiTurnBeamOptions<T> {
        applyDamage?: (
            target: T,
            amount: number,
            context: BeamDamageContext,
        ) => void;
        blocker?: BeamBlocker;
        damage: number | ((target: T, context: BeamDamageContext) => number);
        from: Step;
        fronts?: (previous: readonly Step[], turn: number) => readonly Step[];
        isBlocked?: (cell: Step, context: BeamDamageContext) => boolean;
        level: Level;
        onCell?: (cell: Step, context: BeamDamageContext) => void;
        shape?: string;
        stopAtOpaque?: boolean;
        target: Step;
        targetsAt?: (cell: Step) => readonly T[];
    }

    Type Parameters

    • T
    Index
    applyDamage?: (target: T, amount: number, context: BeamDamageContext) => void

    Applies the resolved damage. The game owns health, resistances and effects.

    blocker?: BeamBlocker

    The explicit blocker policy; defaults to 'terrain', matching a plain beam.

    damage: number | ((target: T, context: BeamDamageContext) => number)
    from: Step
    fronts?: (previous: readonly Step[], turn: number) => readonly Step[]

    Opt-in per-turn fronts instead of a straight line. Given the cells the previous turn actually reached (the origin alone at turn 0) and the turn number, it returns the cells this turn affects; an empty list ends the beam. A cone widens, a burst stops moving, a forked front splits, and a moving front is whatever the game returns each turn - none of which the framework has to understand, only sequence and save.

    isBlocked?: (cell: Step, context: BeamDamageContext) => boolean

    An extra game rule on top of blocker, e.g. "a wall of fire melts the beam".

    level: Level
    onCell?: (cell: Step, context: BeamDamageContext) => void

    Called for every cell the front actually reaches, before targets are resolved.

    shape?: string

    Names the shape this beam is, saved so a reload resumes the same one; defaults to 'line'/'fronts'.

    stopAtOpaque?: boolean

    use blocker: 'none'; kept so existing content keeps its meaning

    target: Step
    targetsAt?: (cell: Step) => readonly T[]

    Finds live targets at the cell when that cell is reached.