mwg API
    Preparing search index...

    Interface StatStagesOptions

    A bounded, symmetric stage ladder over a StatBlock stat - the Swords Dance/Screech shape, where a stat is boosted or lowered in discrete steps, capped at some number of steps either direction, and reset entirely on switch-out. StatBlock's own modifiers are unbounded and unstructured by design (right for equipment, wrong for this), so this is the seam that shape needed: mwg supplies the clamp and the one-modifier-per-stat bookkeeping, a game supplies multiplier - there is no "official" stage-to-multiplier curve to default to without copying a specific existing game's numbers.

    import { StatStages } from '@datamoc/mw_games/battle';
    import { StatBlock } from '@datamoc/mw_games/actors';

    const stats = new StatBlock({ base: { attack: 10 } });
    const stages = new StatStages(stats, { max: 6, multiplier: (stage) => 1 + stage * 0.5 });

    stages.change('attack', 2); // two stages up
    console.log(stats.get('attack')); // 20

    stages.resetAll(); // switching out clears every stage at once
    interface StatStagesOptions {
        max: number;
        multiplier: (stage: number) => number;
    }
    Index
    max: number

    the furthest a stage can go, either direction (Infinity for no cap at all)

    multiplier: (stage: number) => number

    the multiplier a given stage (negative, zero, or positive) resolves to