mwg API
    Preparing search index...

    Interface ChargesOptions

    A resource that refills on its own as turns pass - a wand's limited charges regenerating one every few turns - distinct from a straight spendable pool (mana spent per cast, restored only by an explicit event, which a StatBlock stat already covers on its own). What that alone cannot express is "this refills automatically over time," so Charges carries its own regeneration progress instead of leaning on TurnClock for it - a charge either has or does not have enough banked turns to regenerate, which is exactly the kind of running total a class holds more naturally than a callback would.

    import { Charges } from '@datamoc/mw_games/actors';

    const wand = new Charges({ max: 3, regenRate: 10 }); // one charge every 10 turns
    wand.spend(1);

    wand.advance(10); // 10 turns pass; one charge regenerates
    console.log(wand.current); // back to max

    wand.refund(1); // a kill or crit grants a charge directly, outside the normal regen path
    interface ChargesOptions {
        current?: number;
        max: number;
        regenRate: number;
    }
    Index
    current?: number

    starting amount; defaults to max (a fresh wand starts full)

    max: number

    the most this can ever hold

    regenRate: number

    turns of banked time needed to regenerate one charge