Interface Choice<TEffect>

A choice presented to the player at a node.

interface Choice<TEffect> {
    condition?: Condition;
    effect?: TEffect;
    id: string;
    label: string;
    target: {
        knot?: string;
        node: string;
    };
}

Type Parameters

  • TEffect

    The type of effect that can be applied when this choice is made

Properties

condition?: Condition

Optional condition that must be true for this choice to be available

effect?: TEffect

Optional effect applied when this choice is selected

id: string

Unique identifier for this choice

label: string

Display text shown to the player

target: {
    knot?: string;
    node: string;
}

Target location to navigate to when this choice is selected

Type declaration

  • Optional knot?: string

    Optional knot ID - if omitted, stays in current knot

  • node: string

    Node ID to navigate to