mwg API
    Preparing search index...

    Interface CellFeatureDef<TContext>

    A generated cell wearing a named behaviour: a sign, a well, a plant, a statue, a chasm edge, a trap - anything a regional generator places that the player later looks at or steps on. mwg supplies the four rule slots every one of those shares (inspect it without triggering it, interact with it, run the consequence that follows, and decide whether it persists), never what any specific kind actually does - that stays the game's own definition, supplied fresh each load the way QuestLog's quest definitions already are.

    interface CellFeatureDef<TContext = unknown> {
        persistent?: boolean;
        consequence?(cell: number, ctx: TContext): void;
        inspect?(cell: number, ctx: TContext): void;
        interact?(cell: number, ctx: TContext): boolean | void;
    }

    Type Parameters

    • TContext = unknown
    Index
    persistent?: boolean

    false removes the feature immediately after its consequence runs once; default true (repeatable)

    • runs once interact did not refuse it - the actual effect: damage, an item, a reveal

      Parameters

      Returns void

    • stepping on or using the cell; returning false refuses the interaction before any consequence runs

      Parameters

      Returns boolean | void