mwg API
    Preparing search index...

    Interface MwlWorld

    interface MwlWorld {
        carryover?: MwlCarryover;
        clearedShroud?: Record<string, string[]>;
        firedEvents?: string[];
        gold: Record<string, number>;
        map?: MwlMap | null;
        maps: Record<string, { file?: string; terrain: string }>;
        objects?: {
            id?: string;
            image?: string;
            name?: string;
            side?: string;
            x: number;
            y: number;
        }[];
        pendingDialogue?: { choices: readonly MwlDialogueChoice[]; id: string };
        random?: readonly [number, number, number, number];
        roles?: Record<string, string[]>;
        scheduleIndex?: number;
        sides: Record<
            string,
            {
                controller?: string;
                flag?: string;
                fog?: boolean;
                gold: number;
                heal?: boolean;
                hidden?: boolean;
                income: number;
                leader?: string;
                recruit?: string;
                shareVision?: string;
                shroud?: boolean;
                teamName?: string;
                userTeamName?: string;
                villageGold?: number;
            },
        >;
        sideStatus?: Record<string, "playing" | "won" | "lost">;
        status: "playing" | "won" | "lost";
        story?: { image?: string; music?: string; text: string; title?: string }[];
        timeOfDay?: string;
        turn: number;
        units: Record<
            string,
            {
                alive: boolean;
                can_recruit?: boolean;
                hp: number;
                leader?: boolean;
                moves?: number;
                name?: string;
                role?: string;
                side?: string;
                type?: string;
                x: number;
                y: number;
            },
        >;
        variables: Record<string, MwlValue>;
        villages?: Record<
            string,
            { name?: string; side: string; x: number; y: number },
        >;
    }
    Index
    carryover?: MwlCarryover

    what [endlevel] decided this scenario hands to the next one, until it is applied

    clearedShroud?: Record<string, string[]>

    hexes [clear_shroud] has uncovered, by side id, as "x,y"; the fog itself is a game layer

    firedEvents?: string[]

    ids of one-shot events that already fired, so a restore keeps them spent

    gold: Record<string, number>
    map?: MwlMap | null

    the primary map, when the content declares one

    maps: Record<string, { file?: string; terrain: string }>
    objects?: {
        id?: string;
        image?: string;
        name?: string;
        side?: string;
        x: number;
        y: number;
    }[]

    scenario [object] placements, as data; what an object does on pickup is the game's

    pendingDialogue?: { choices: readonly MwlDialogueChoice[]; id: string }
    random?: readonly [number, number, number, number]

    State of the hook-facing random stream (core.Generator), present once any hook has drawn from HookWorld.random. Carried in world rather than as a separate save concern so a restored runtime resumes exactly the same stream instead of reseeding it.

    roles?: Record<string, string[]>

    unit ids [role] assigned to a named role, so a later event can say role=courier

    scheduleIndex?: number
    sides: Record<
        string,
        {
            controller?: string;
            flag?: string;
            fog?: boolean;
            gold: number;
            heal?: boolean;
            hidden?: boolean;
            income: number;
            leader?: string;
            recruit?: string;
            shareVision?: string;
            shroud?: boolean;
            teamName?: string;
            userTeamName?: string;
            villageGold?: number;
        },
    >
    sideStatus?: Record<string, "playing" | "won" | "lost">

    What each side's own [victory]/[defeat] conditions decided, keyed by the side id [side] declared. Only sides whose conditions fired appear here; a side that wrote none keeps no entry, the same "only what the content made" rule world.sides follows. The scenario-wide status is the aggregate: a side that won or lost ends it too.

    status: "playing" | "won" | "lost"

    Optionalstory

    story?: { image?: string; music?: string; text: string; title?: string }[]

    scenario [story] entries, as data; rendering them is the story-screen work (item 264)

    timeOfDay?: string

    the current schedule entry, by id

    turn: number
    units: Record<
        string,
        {
            alive: boolean;
            can_recruit?: boolean;
            hp: number;
            leader?: boolean;
            moves?: number;
            name?: string;
            role?: string;
            side?: string;
            type?: string;
            x: number;
            y: number;
        },
    >
    variables: Record<string, MwlValue>
    villages?: Record<string, { name?: string; side: string; x: number; y: number }>

    Village ownership, keyed "x,y": what [capture_village] records. The framework owns the fact of who holds a village; what holding one is worth stays the game's rule (income is world.sides[id].villageGold applied by the game, not minted here).