mwg API
    Preparing search index...

    Interface TimedEffect

    The slower clock a roguelike's hunger, poison and other long-running effects run on - distinct from mwg/roguelike's Scheduler, which decides who acts next within a turn. TurnClock counts turns that have already happened and drives whatever should happen once per turn, or run out after a fixed number of them, regardless of who took the turn.

    interface TimedEffect {
        duration?: number;
        onExpire?: () => void;
        tick: (turn: number) => void;
    }
    Index
    duration?: number

    turns remaining before this effect is removed automatically; omit to run forever

    onExpire?: () => void

    called once, the moment duration runs out, right before the effect is removed

    tick: (turn: number) => void

    called once per advance, with the clock's new total