mwg API
    Preparing search index...

    Interface MonsterAIOptions

    interface MonsterAIOptions {
        blocked?: ReadonlySet<number>;
        climb?: number;
        disposition?: Disposition;
        fleeBelow?: number;
        heights?: Elevation;
        provoked?: boolean;
        sightRadius?: number;
        topology?: 4 | 8;
    }

    Hierarchy (View Summary)

    Index
    blocked?: ReadonlySet<number>

    Cells to treat as blocked beyond the terrain (other creatures, usually).

    Passed per call rather than held, because who is standing where changes every turn and a cached path is a monster walking through its neighbour.

    climb?: number

    how many levels up one step may climb; defaults to 1, the ordinary stair or ramp

    disposition?: Disposition

    defaults to 'hostile' - always hunts on sight, exactly like every monster used to

    fleeBelow?: number

    HP fraction (0 to 1) at or below which a visible target is fled rather than hunted

    heights?: Elevation

    The map's heights, when climbing matters. A step from one cell to the next is allowed when the destination rises no more than climb above the start; going down is always allowed, the way stepping off a ledge is. Needs heights to mean anything on its own.

    provoked?: boolean

    true once this monster has been attacked (or otherwise provoked) - overrides a neutral/peaceful disposition back to hunting, permanently, the same as hostile. A game tracks this per monster and sets it the moment it lands the provoking hit; this function stores no state of its own between calls, same as hpFraction.

    sightRadius?: number

    how far the monster can see, in cells - its own sight range, not the player's

    topology?: 4 | 8

    4 for cardinal moves only, 8 to allow diagonals